Hello
I have just looked into Template cover for my garage door. I have a magnet sensor that has the states “on” and “off”, on being an open door. I have made a sensor of it that returns “Åpen” and “Lukket”.
When I hen try to use that sensor in my template cover nothing happens. The state of the cover is “open” whatever I do.
This is in my configuration.yaml
cover:
- platform: template
covers:
garage_door:
device_class: garage
friendly_name: "Garage Door"
position_template: "{{ states('sensor.garage_door') }}"
open_cover:
service: switch.turn_on
data:
entity_id: switch.garasjeport
close_cover:
service: switch.turn_on
data:
entity_id: switch.garasjeport
stop_cover:
service: switch.turn_on
data:
entity_id: switch.garasjeport
icon_template: >-
{% if states('sensor.garage_door', 'Åpen') %}
mdi:garage-open
{% else %}
mdi:garage
{% endif %}