Use Raspberry Pi Pico W and micropython to add temperature sensors to your Home Assitant setup.
Usually you’ll start with the latest micropython for Pico W.
On your workstation, you will also want mpremote
The README goes into this. There is mip_install.py
that relies on secrets.py
being properly configured (see Config below) and copied to Pico W.
DS18B20 1-Wire sensors are 3.3 V
. Fortunately, the Pico W has a regulated 3.3 V
output that can be used.
TODO: I2C like BME280 or SSD1306 OLED.
There are assorted micropython scripts name test_AREA.py
moremote run test_ds18b20.py
There are example files intended to be used as configuration templates.
config.py
device.py
def-secrets.py
-> secrets.py
Since I may have more than one picow
in use, I like to have local corresponding device files, e.g., device-picow1.py
mpremote fs cp secrets.py :
mpremote fs cp config.py :
mpremote fs cp device-picow1.py :device.py
# testing them out
mpremote run main.py
Micropython auto-runs a file named main.py
in the top-level directory. Assuming it has been configured and tested, can just copy to device.
mpremote fs cp main.py :
# Power cycle or otherwise reset, and it should start up automatically.
mpremote repl