Hi,
I have a Z-wave Tilt Sensor for my garage door to report the state, and a relay with esphome to activate the door.
It’s ok to activate the door with the template cover but I’m not able to read the status with my configuration. The Door is always close…
What I’m missing in my code ?
cover:
- platform: template
covers:
garage_door:
device_class: garage
friendly_name: "Garage Door"
position_template: >-
{% if states('binary_sensor.ecolink_tilt_sensor_sensor', 'on') %}
open
{% else %}
closed
{% endif %}
open_cover:
- condition: state
entity_id: binary_sensor.ecolink_tilt_sensor_sensor
state: "off"
- service: switch.turn_on
target:
entity_id: switch.porte_garage
close_cover:
- condition: state
entity_id: binary_sensor.ecolink_tilt_sensor_sensor
state: "on"
- service: switch.turn_off
target:
entity_id: switch.porte_garage
stop_cover:
service: switch.toggle
target:
entity_id: switch.porte_garage
icon_template: >-
{% if states('binary_sensor.ecolink_tilt_sensor_sensor', 'off') %}
mdi:garage
{% else %}
mdi:garage-open
{% endif %}