masoko
(Hristo Jelev)
January 30, 2024, 7:08pm
1
Hi All,
I am trying to implement remote updates via MQTT Update for my monitoring script GitHub - hjelev/rpi-mqtt-monitor: Raspberry Pi MQTT Monitor gathers system information and sends it to a MQTT server. but I am having hard time figuring out the exact MQTT communication needed for this.
If some one have already implemented this pls help with some examples.
Thanks
Hi,
Sorry - I’m not going to read through an entire GitHub repository for reasons .
Can you tell us what are you trying to do specifically please?
I’ve implemented fully automated HASS integration via HASS MQTT Discovery in Python, although the dev cycle is quick as you can test instantly using mosquitto_pub
& mosquitto_sub
in Bash scripts to prototype MQTT auto-discovery:
HASS MQTT setup help is here:
Hi,
I’d start with a clean slate - re-flash the device (or Tasmota → Configuration → Reset Device), and delete the Mosquitto Add-on and reinstall.
HASS Mosquitto broker Add-In, MQTT integration, Tasmota Integration
Mosquitto broker Add-In
The recommended way to configure uses is shown on the Add-On Documentation tab - e.g. create a HASS user.
http://homeassistant.local:8123/hassio/addon/core_mosquitto/documentation
I personally use additional Mosquitto users, BUT these are configured not b…
Here’s a mosquitto_pub
example to get you started hacking together a proof of concept:
Note to developers - Whilst you’re re-factoring your MQTT Discovery code, can I suggest adding additional values to improve how users can interact with your hardware?
Here’s an example from my own test code (with some light changes) which adds:
The example Device is configured with optional extra information such as manufacturer, version, and the ‘suggested_location’ which can be used to set the Area.
The example Entity adds optional extra values such as an icon, the device class and unit of …
HASS changes immediately on receiving the publish.
Another example:
Hi,
After writing a Python device using HASS Discovery, I found HASS changes configuration state almost immediately after I published the discovery topics to the broker. This made manual testing of the structure straightforward as the debug cycle was basically:
Delete the previous retained topics using MQTT Explorer
Publish new discovery data with mosquitto_pub on the command line
See what happened in HASS immediately
Cross-check what the broker actually published using https://mqtt-explorer…
If this helps, this post!