MQTT Client for RP2040 based boards that directly interfaces with Home Assistant
MIT License
A simple micro-python mqtt client which enables simple plug-and-play functionality and interoperability with Home Assistant.
"availability_topic": "home/wateringsystem/back/status",
"state_topic": "home/wateringsystem/back/output/solenoid3",
"command_topic": "home/wateringsystem/back/output/solenoid3/set",
The overall standard of MQTT topics that will be used going forward is:
<area>/<entity>/<location>/<property>/<object>/<modifier>
but there's no set requirement on structure.
topic_prefix is: <area>/<entity>/<location>
This simplifies it down to:
<topic_prefix>/<property>/<object>/<modifier>
Following the official Raspberry Pi Docs
Tools
, there should be an option to Manage Packages
, select that optionumqtt
in the package manager, there should be one called micropython-umqtt.simple
and install it onto the Pi Pico.
mpremote mip install micropython-umqtt.simple
(untested) in the Thonny console when the Pi Pico is connectedconfig.json
file based off the test-config.json
config.json
, main.py
, boot.py
and main
to the Pi Picoboot.py
and main.py
in Thonny to ensure that the SSID and password are correct, in addition to the Home Assistant connection.main.py
is running and the Pi Pico should be up and running!requirements.txt
by running python -m pip install -r requirements.txt