Still working on getting a video out but i figured i would post some sensors used in HA for MQTT usage. I use a sensor file to keep the sensors from taking up too much space in the configuration.yaml. Add this line mqtt: “!include mqtt.yaml” under “sensor:” in your configuration.yaml. Make a file in the root folder named mqtt.yaml. Here is a direct example of how i create the sensors in that file. Also make sure to connect the MQTT node with JSON output
“msh/2/json/testnet/!fa666218” is the full topic that the mesh device will post to “testnet” is whatever you named your channel and “!fa666218” is the device id what is the uplink and downlink node for the mesh. the “-93958068” is the node that is sending the information to the MQTT node. A good way to figure out what devices are in the mesh is by using a program like “MQTT Explorer” in windows at least. There are other utilities and i have a few that are specifically for seeing/sending JSON messages in the MQTT broker from/to the mesh. Below is an example of a message sent in the mesh showing the “from” and the message payload. RT2 is the name of my node so all I did was carry that over as the name of the entity.
When i get time to post the video on everything else such as sending and receiving messages directly from Home Assistant etc. I will make sure to get it posted here. There are a lot of useful automations that can be done with text information such as arming and disarming alarmo in home assistant or getting the weather report from your weather station in the back yard.
Hello!
I also killed my Friday with reated project, stucked at mqtt from broker (dridged with local broked +msh) I see messages on MQTT explored as such: "
Z
��������*0�1��j��I�L��vH� 爺�5s��f��:m_�0-ڸ�\7y��5V�6’=(m�eE�@H`���������LongFast
" to me is it related to encryption if yes, how to decrypt?
+in documentation it say to use such format:
state_topic: “msh/2/json/LongFast/!67ea9400”
why tere is /json/ there? in explores I dont see such prefix. tried both, in HA values are " unknown" .
I could try to set up other HA to eliminate this bridge need, just to test am I right with this if I put diredt MQTT.meshatastic… into HA but no shortcuts, dont want to give up
I just noticed this message. You can enable mqtt via the web interface. I had to go the web interface route before the settings were in the Android app.
Could it be that firmware 2.2.19 did some changes, as I sat back to this, re-flashed device and it now sending to topic msh/2/2/json/LongFast/!.. and I am getting sensor to HA.
but if I want to use encryption, where to get PSK? this is still not clear… Thanks!
PSK would be from your MQTT server setting and you will need to change the port connection. Port 8883 is the default encrypted port for the MQTT add-on in HA.
Hello, thanks for replay!
Ok, will start with basic… I sat up client-router (with wifi access) - it works fine, I can get sensor data, send messge to client (without wifi)… but how to get sensor data from client, thru router… on mqtt explorer I jsut see status -online, no telemetry thru mesh.
if this will be fixed, then I will move to next level- encyprion did research on youtube, but did not found such topic. thanks!
They should also come in via mqtt after the radio has been on for roughly a minute. Environment telemetry data should send instantly when the radio boots. Make sure if it’s environmental data you want to see, you have it turned on in the telemetry settings menu under the radio configuration menu. Voltage, channel utilization, airtime utilization and battery % all send about a minute after the radio turns on and is part of the default settings to send every 15 minutes (900 seconds).
Also if you have multiple channels on your radio the first channel you setup(default) will be the mqtt topic in which the data is sent.
Hello, thanks for replay!
not sure what setting I missed…
For Router, I see data in this topic:
msh/EU_433/2/json/LongFast/!XXXXX
and for Client, I found only this topic on msh broker (by search functiion)
msh/2/2/stat/!XXXXXX and it show: online
*I see sensors data on display and also in display it show " joined XXX - my Router " name" ) chat messhages come and go thru.