MQTT Client for RP2040 based boards which integrates into Home Assistant
Project description
mqtt-home
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>
Software Setup
From a fresh Raspberry Pi Pico
Following the official Raspberry Pi Docs
- Hold down the bootsel button while plugging in pi pico for the first time
- Open Thonny with the pico plugged in
- Choose the micropython language selector in the bottom right hand corner of the UI
- Choose the latest version of Micropython and install it onto the raspberry pi
From an existing Raspberry Pi Pico with micropython installed
- In the top bar of Thonny, under
Tools, there should be an option toManage Packages, select that option - Then search for
umqttin the package manager, there should be one calledmicropython-umqtt.simpleand install it onto the Pi Pico.- You could potentially use mpremote
mpremote mip install micropython-umqtt.simple(untested) in the Thonny console when the Pi Pico is connected
- You could potentially use mpremote
- Clone the mqtt-home repository to a local area
- Create an appropriate
config.jsonfile based off thetest-config.json - Upload
config.json,main.py,boot.pyandmainto the Pi Pico - Manually run
boot.pyandmain.pyin Thonny to ensure that the SSID and password are correct, in addition to the Home Assistant connection. - Once confirmed connected, disconnect the Pi Pico and plug it in from cold to ensure that the start up works as expected.
- Once the status LED is shining, that is an indication that
main.pyis running and the Pi Pico should be up and running!
Virtual Environment Setup
- Using a virtual environment, install the python dependencies listed in
requirements.txtby runningpython -m pip install -r requirements.txt
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rp2040home-0.1.6.tar.gz.
File metadata
- Download URL: rp2040home-0.1.6.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51f1b6ce7e7fffc0431fa8a6f944f7ec9c917540197a888604db503b40bbf71f
|
|
| MD5 |
b2334c5114a3b69bb5eb73f42a9d5d63
|
|
| BLAKE2b-256 |
8f837c278bfd7478dec91efc9eeac4bd3be5515c4e9c1c7829f05784bb558244
|
File details
Details for the file RP2040Home-0.1.6-py3-none-any.whl.
File metadata
- Download URL: RP2040Home-0.1.6-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22f494bff01f1e4dd7db5a0b46ace94424e4c7dc0a52df971e3b5afb1c8bcd6f
|
|
| MD5 |
7c205d83cd7eca54c8cd909563d1479c
|
|
| BLAKE2b-256 |
5310de09b708f06489646230e63ff8284ee2b06d63ada81e6e03dfe3488a69ef
|