Should be an easy one, i had this working fine then was messing around with something else in config and lost it all. And the last backup was before adding the garage door config…
So i have an esp device running tasmota that controls my garage door with a relay and 2 limit switches to indicate open and closed thru mqtt.
I have 2 entities that would show the change, now i just get “unknown” on the entities.
When i listen to the topic of the tasmota i can see the limit switch states change.
as such -
Here’s the part from my configuration.yaml.
After i lost the working config, this is what i have remembered and i know ive forgotten something.
Can anyone spot the issue?
I could be completely wrong too haha
I suspect its in the value_json
The switches are showing 'ON' or 'OFF' — why are you using "Open" and "Closed" in your sensor config? payload_on needs to be whatever the MQTT message (out of value_template) is for the switch to be on. Should be:
payload_on: "ON"
payload_off: "OFF"
…and I suspect one of those will need reversing as the switches are showing different things, open or closed.
I assume there’s a top-level mqtt: declaration ahead of the first line you’ve pasted?
No problem. It’s not just regulars being picky: without the correct formatting, there could be all sorts of indentation errors lurking; and we can’t copy and paste your code to correct it as it’s got all the wrong quote marks once the forum software has processed it as text.
Glad it works now: fresh eyes are invaluable. You should get a rubber duck and explain each line of your code to it — that would also have exposed the bug.