question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Homebridge MQTT not updating state

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Comments:32 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
Kepetecommented, Jan 9, 2019

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.

0reactions
NorthernMan54commented, Jan 9, 2019

Glad to hear everyone

Read more comments on GitHub >

github_iconTop Results From Across the Web

MQTTThing not updating state if changed remotely. - Reddit
I'm running Homebridge (HOOBS) with plug-in MQTTThing on a pi. Seems to work well with Tasmota except not updating the power on state...
Read more >
Developers - Homebridge MQTT not updating state -
I have setup different sensors and switches with MQTT. At first it worked great, the status of the switch is instantly updated over...
Read more >
homebridge-http-switch Plugin - HOOBS
Updating the switch state in HomeKit. The 'On' characteristic from the 'switch' service has the permission to notify the HomeKit controller of ...
Read more >
MQTT - Tasmota
Go to Configuration -> Configure Other and make sure "MQTT Enable" box is checked. Once MQTT is enabled you need to set it...
Read more >
homebridge-http-lightbulb - npm
Updating the light bulb state in HomeKit ... the new value is updated instantly and homebridge-http-lightbulb does not need to make needless ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found