Hello, I have a louvered roof with the states opening, closing, open and closed. Since only the two states opening and closing work reliably, I would like to create a template sensor that reflects the two states and switches to open and closed after 10 seconds! I just can’t get it to work. Maybe someone can help me. Thanks a lot
# configuration.yaml
template:
- binary_sensor:
- name: Cover State
delay_on: 10
delay_off: 10
device_class: window
state: >
{% if is_state('cover.louvered_roof','opening') %}
{{ true }}
{% elif is_state('cover.louvered_roof','closing') %}
{{ false }}
{% eles %}
{{ this.state if this is defined else false }}
{% endif %}
Thanks for the quick help! But in the solution I only have the states open and closed, or do I understand it wrong? I would like to have all four states (open, closed, opening, closing). Is that possible?
That is not what you asked for:
oh sorry, that was my mistake. Could you help me anyway?
What exactly do you want?
And what is unreliable about the cover state?
Well, the closed status doesn’t work with my sunroof, it always stays in the closing position for a while and then switches back to open. I have no idea why! Since the two states closing and opening work reliably and I know how long it takes to close and open, I wanted to derive the two remaining states (open and closed) from them.
I need a sensor with the states (open, opening, closed, closing). Thank you very much for your help!
Which integration are you using to incorporate your cover into Home Assistant?
It’s a somfy slatted roof and I use the overkiz integration
Open an issue here and get it fixed then:
The develoepr is very active.
ok, thank you