Hi guys,
i have a templated cover, which is using the value_template
to get the state. It is working good, but every time, when I restart HA, the state falls back to open. How do I code it, to use the old state? Here is the template:
- platform: template
covers:
garagentor:
friendly_name: "Garage"
device_class: garage
value_template: "{{ is_state('binary_sensor.garagentor', 'on') }}"
open_cover:
service: switch.turn_on
data:
entity_id: switch.shelly
close_cover:
service: switch.turn_on
data:
entity_id: switch.shelly
stop_cover:
service: switch.turn_on
data:
entity_id: switch.shelly
icon_template: >-
{% if states('binary_sensor.garagentor') == "on" %}
mdi:garage-open
{% else %}
mdi:garage
{% endif %}