I’m using the MQTT Cover component with the Linear zwave garage door opener (on a different HASS instance). The door reports “open”, “opening”, “closing” and “closed” as states (no tilt or other position info). So when I open or close the door, i get the following error: Payload is not True or False: closing (or opening, depending which way the door is going).
Is there a way to template state_topic (maybe with value_template) so that it will recognize “opening” as the same as “open” and vice versa? It’s only a single error line so it’s not the end of the world but it’s annoying.
Well the controlling part is based on what commands it excepts from MQTT. So you need to find that out. You are using the defaults currently which are “OPEN” and “CLOSE”.
Right, the default commands work. The issue was that my door would report “closing” and “opening” and the MQTT cover doesn’t support those two states it seems. So i just needed to tell it to treat the value “opening”/"open as “open” and “closing”/“closed” as “closed” so I don’t get an error. Works perfectly fine now.
Makes sense. Wasn’t aware you needed to return ‘open’/‘closed’. I would assume it’s binary. Anyways if you want a short concise template that takes up less space you can use an inline if statement.
value_template: "{{ 'open' if 'open' in value else 'closed' }}"