Homebridge MQTT not updating state
See original GitHub issueI have setup different sensors and switches with MQTT. At first it worked great, the status of the switch is instantly updated over MQTT if the switch is used manually. But now I have discovered that after a while it will not update the status anymore. I can still toggle the switch, turn it on and off, but manual switch toggling won’t change the status in Homa app. It works after every homebridge restart for few hours and then status updates stop. I also have a temperature plugin, same problem there. Temperature readings are sent over MQTT. After a while it just won’t update the temperature and show still the sensor as online.
It is not a plugin problem(what I was thinking about first) because different plugins have the same issue.
All MQTT messages are sent, I can confirm it from the MQTT broker side.
Versions
- Homebridge: 0.4.38
- Node: 8.9.4
- OS: Raspbian GNU/Linux 9 (stretch)
Configuration
{
"accessory": "mqtt-switch-tasmota",
"switchType": "lightbulb",
"name": "Test",
"url": "mqtt://1.1.1.1",
"username": "usr",
"password": "pswd",
"topics": {
"statusGet": "stat/sonoff_test/POWER2",
"statusSet": "cmnd/sonoff_test/POWER2",
"stateGet": "tele/sonoff_test/STATE"
},
"onValue": "ON",
"offValue": "OFF",
"activityTopic": "tele/sonoff_test/LWT",
"activityParameter": "Online",
"startCmd": "cmnd/sonoff_test/TelePeriod",
"startParameter": "60",
"manufacturer": "ITEAD",
"model": "Sonoff",
"serialNumberMAC": "sonoff"
},
{
"accessory": "mqtt-temperature-tasmota",
"name": "Test2",
"url": "mqtt://1.1.1.1",
"username": "usr",
"password": "pswd",
"topic": "tele/sonoff_test2/SENSOR",
"activityTopic": "tele/sonoff_test2/LWT",
"activityParameter": "Online",
"startCmd": "cmnd/sonoff_test2/TelePeriod",
"startParameter": "60",
"sensorPropertyName": "DS18B20",
"manufacturer": "ITEAD",
"model": "Sonoff TH",
"serialNumberMAC": "sonoff_test2"
},
Homebridge Log / Command Output
Couldn’t find the log file at /var/log/homebridge.log Will update it when I find the logs.
Issue Analytics
- State:
- Created 5 years ago
- Comments:32 (10 by maintainers)
Top GitHub Comments
Thank you both @bartoszwas and @NorthernMan54 for troubleshooting it. Valuable information. Mqttthings now also supports LWT as it is the way to go seems. Only need to add the possibility to extract temperature readings from JSON.
Glad to hear everyone