Closed reinisb closed 2 years ago
@arachnetech Could you please have a quick look? I bet you could infer the issue in a few seconds by looking at the above config screenshot. Thanks!
Try changing Get On MQTT topic to: stat/sonoff-basic-r2-b/POWER
Try changing Get On MQTT topic to: stat/sonoff-basic-r2-b/POWER
I tried, but that does not resolve the problem.
I figured it out. The solution was neither documented, nor obvious.
You see, my Sonoff Basic is running Tasmota firmware. When the physical switch (or the tasmota web ui switch) is toggled, tasmota sends the following MQTT messages:
stat/sonoff-basic-r2-b/POWER = ON
or
stat/sonoff-basic-r2-b/POWER = OFF
What I realized is that homebridge-mqttthing does not understand what ON
or OFF
means. It expects the values to be true
or false
. I would expect homebridge-mqttthing to understand what ON
or OFF
means.
The solution is to go into homebridge-mqttthing Advanced settings in Homebridge and add ON
or OFF
values to these fields.
The final working config looks like:
"accessories": [
{
"type": "lightbulb-OnOff",
"name": "Lampa",
"username": "reinis",
"password": "macbook",
"topics": {
"getOnline": "tele/sonoff-basic-r2-b/LWT",
"getOn": "stat/sonoff-basic-r2-b/POWER",
"setOn": "cmnd/sonoff-basic-r2-b/POWER"
},
"onlineValue": "ON",
"offlineValue": "OFF",
"integerValue": false,
"onValue": "ON",
"offValue": "OFF",
"accessory": "mqttthing"
}
]
Thank you for posting this solution. I was struggling with the same and found the missing on=true off=false mapping too obvious to consider.
Gosh this was brutal. Same went for me when trying to integrate Nodered with Homebridge. Thank you for posting this!
What happens
When I press the physical button located on Sonoff Basic, then it toggles the switch, but the updated status is not reflected in Homebridge.
What should happen
I expect the status to be reflected in Homebridge when using Sonoff Basic's physical button.
Config