I have a pool controller which I have connected to a raspberry pi running nodejs-poolController. The njsPC is connected to my MQTT broker and publishes a topic that indicates the status of my automatic pool cover. I’m trying to set up a binary sensor that reports the cover status in HA. Here is what I have in my configuration.yaml:
But no matter what the actual payload on that topic is, I can’t get the binary sensor to reflect the change. It just always shows “off”. even where I can use MQTT Explorer to verify the payload for the topic is currently {“id”:1,“isClosed”:“true”}
I don’t really under stand templating, and I’m just mimicking what I’ve done for other MQTT sensors and switches, so maybe there’s something wrong with my value_template?
For context, “value_template” extracts from the MQTT message the value the payload_* will be compared to. In your case, you compare the full payload so it’s unnecessary.
So if I wanted to only read the “isClosed” value from the payload, I would use the value_template? If yes, what would be the syntax to do that? Something like this?