Stuggling again with Home Assistant/MQTT discovery

For reasons (devices with the same name) I had to reset one of my gateways and now it’s no longer discovered by Home Assistant. How can I start this over again?

I’ve deleted the gateway from HA and removed all of the mqtt topics under homeassistant/switch/

How do I get the gateway to start sending these again?

Further confusion. I reflashed my gateways again (I have three of them ;)) and they again show up in home assistant. But, after a while they become greyed out and uncontrollable from HA.

Hard to debug what’s gong on - anyone else seeing this?

@1technophile could it be possible the gateways are somehow interfering with each other? I have one ble2mqtt, one rtl_433 (OOK) and one rtl_433 (FSK) and I cannot get all three to stay online in HA.

Only if you use the same gateway_name.

Try to connect them to a serial monitor to get the logs, it will give more information.

Thanks, I did discover a while ago that not changing the gateway name was a problem.
I can’t detect any information from serial usb, I’ve tried all baud rates.
It’s driving me crazy. Two of the gateways default name is “OMG_lilygo_rtl_433_ESP”. Each time I reflash one of them, the other one goes offline in home assistant. I add -OOK at the end of one of them every time - there are never two connected to mqtt at the same time with the same name.

Stuck :frowning:

115200

If you have only one of them connected it works ?

It seems that way. I’ll experiment some more tomorrow. It very strange behaviour. How often should they send status/discovery messages - they just appear to stop sending them.

At start and when a new device is detected, after 30min the auto discovery goes OFF automatically

I seem to be in the same boat as @simowilso. I have 2 lilygo Lora32 devices (one flashed with 433 ook and the other with 433 fsk) the 433 ook is only used to pick up my Fineoffset wh1080 weather station and the 433 fsk is only to pick up my Oil watchman Sonic advance. They both work and send the correct data to mqtt but I can only control one at a time in HA. They both have unique settings to keep the mqtt side seperate for ease of use.

The 433 ook board was set up months ago and autodetected the weather station and HA configured all the sensors etc and was working great. Untill a couple of days ago when I got the new board and flashed it with 433 fsk.

HA then found the new board and started to make new sensors for the Oil Watchman but then made ALL the sensors and 433 ook hardware unavailable.

I checked the mqtt data and all the weather station data was still comming in so I had to manually configure new sensors to get them back into HA.

I know HA seems to want unique ID for devices and sensors so I was wondering if both 433ook and 433fsk use the exact same way of talking to HA and this is why one overwrites the other causing our problem. If so could it be possible to change the way they do this or would it need under the hood code to be changed ??

Hi @sirhc_bruce

What are the names of your two rtl_433 OMG gateways? It sounds as if they might have identical names, causing the issue you are seeing.

One was called lilygo_433_ook when it showed up in HA and the other was lilygo_433_fsk.
lilygo_433_ook is unavailable and lilygo_433_fsk still shows and works.

If i Reflash lilygo_433_ook, HA will find the new device and set the weatherstation sensors up and then make lilygo_433_fsk unavailable along with the oil watchman sensors. That makes me think its not the names but some other hardware ID or simmilar that causes the problem.

since they are both the same hardware but with different software loaded HA could be getting its knickers in a twist and only wanting to talk to the last found hardware ??

Whiloe that might sounds like a possible reason, it should really not be an issue at all. While I do not have different rtl_433 gateways running myself, I have several BLE gateways not showinjg any similar issues.

Could you post a screenshot of the two gateways how they show up (expanded) in MQTT Explorer?
Are the messages still coming in regularly in MQTT Explorer for both gateways?

the mqtt explorer shows both 433ook and 433fsk show both working as they should and updating when they should. (oil watchman every 30 mins & weather station on every change)

And both online, and both publishing their respective devices under RTL_433toMQTT, so all looking fine there.

I cannot really see the very top of the MQTT Explorer window, but I assume that the two gateways, along with all your other MQTT devices are all under the home topic.

Can you also post some comparable identical discovery messages for each of the gateways, e.g. for the gateways themselves, like the Restart button, under
homeassistant/button/XXXXXXXXXXXX-restart
and discovery messages for an identical property of the two received devices, e. g. battery_ok, if the Oil-SonicAdv also has it, otherwise its temperature_C will also be fine.

Please copy and paste these texts directly, not as screenshots.

{“stat_t”:“esp_433fsk/LWT”,“avty_t”:“esp_433fsk/LWT”,“dev_cla”:“restart”,“name”:“SYS: Restart gateway”,“uniq_id”:“10061C082668-restart”,“pl_prs”:“{"cmd":"restart"}”,“pl_avail”:“online”,“pl_not_avail”:“offline”,“cmd_t”:“esp_433fsk/commands/MQTTtoSYS/config”,“device”:{“ids”:[“10061C082668”],“name”:“fsk”,“mdl”:“["LilyGo_SSD1306","WebUI","rtl_433"]”,“mf”:“OMG_community”,“cu”:“http://192.168.1.239/",“sw”:"v1.7.0”}}

just now:–
{“model”:“Oil-SonicAdv”,“id”:5387924,“temperature_C”:22,“depth_cm”:71,“status”:144,“mic”:“CRC”,“protocol”:“Watchman Sonic Advanced / Plus”,“rssi”:-72,“duration”:98035}

30 mins ago.
{“model”:“Oil-SonicAdv”,“id”:5387924,“temperature_C”:26,“depth_cm”:71,“status”:144,“mic”:“CRC”,“protocol”:“Watchman Sonic Advanced / Plus”,“rssi”:-72,“duration”:98000}

That is all I have. there is nothing for the 433ook.

I can see a unique id of 10061C082668 tho…

Later tonight I will reflash the 433ook and see if it turns up again but I suspect the 433fsk will then vanish…

While there seems to be some bits missing from this discovery message, what still confuses me is the missing top home topic I already mentioned above, usually the default for any HA MQTT integrations.

Please use the Preformatted Text formatting when posting code/JSON in a message.

Also, at which stage do you generally rename the gateways, after the binary upload/installation while setting up all the WiFi and MQTT details, or only at a later stage through the WebUI?

Also the other two messages are not the discovery messages, but the actual published MQTT messages, have a look under
homeassistant/sensor/XXXXXXXXXXXX-battery_ok
homeassistant/sensor/XXXXXXXXXXXX-temperature_C

How about trying this first?
In MQTT Explorer, go to, and expand if not already expanded, the Publish section.
Enter
esp_433ook/commands/MQTTtoSYS/config
make sure the json format is selected, and enter this into the payload field.
{"disc":true,"save":true}
and hit PUBLISH.

Then keep the Publish topic as is, but change the payload field to
{"cmd":"restart"}
and hit PUBLISH.

This should restart the OOK gateway and have it auto-discover itself and the Fineoffset weather station - in addition to the existing discovered FSK gateway.

Have a look then to see if there are two restart discovery entries now, and also if both gateways do show up in HA.

That has brung 433ook back alive and reinstalled the weather station sensors but it looks as if its boot looping now. its online for 10 seconds then its unavailable. and repeats over and over.

I can not get into the web interface for the device either.

I use the web upload to flash the devices as it was the easiest way to get going so had to configure from the web page once booted to change settings.

That constant rebooting should not happen of course, but it confirms my suspicion, that the original problem was due to conflicting names, as the default name for both the OOK binar and the FSK binary were/are identical, basically overwriting the discovery of the previous gateway, again and again with every new install.

This only does happen though when the name is changed at a later state, like through the WebUI, which you seem to have done. It would not happen however if you change the gateway name already during the original WiFi and MQTT credentials set-up.

A fix is already on its way and should be included in the development binaries by tomorrow.

This is also what I would suggest for you to do now, to remedy the looping reboot issue. Install the lilygo-rtl_433 binary, but already set up all the details, including the new gateway name esp_433ook right at the beginning when connecting through the gateway AP, as described here.

After that both your esp_433ook and esp_433fsk gateways should be fine, both discovered and showing up in HA, as well as their respective Fineoffset and Oil_SonicAdv sensors.

@DigiH Thanks for trhe help.

Any idea how to stop the boot loop so I can reflash the device without having to resort to vscode & platformio

You should still be able to use the Web Upload, by holding down the Reset (labelled RST) button on the LilyGo when initiating the install and letting it go at the right time - might take a few goes at it, but should work.

And make sure to keep the Erase Flash option ticked.