Using the following I am getting an “unknow sensor state” and non-functioning button. This code has worked well until a recent core update and restart. I can use the Shelly integration control to open the door and I can see that the reed switch (open or closed) is working so something in the code is changed. Have tried adding unique id: but no change any help for a nube welcome. Mark
- sensor:
- name: "Open Sesame"
unique id: 38b3cc96-f308-458f-84e3-324562b90a87
state: >
{% if is_state('binary_sensor.open_sesame_sensor', 'off') and is_state('switch.open_sesame', 'on') %}
opening
{% elif is_state('binary_sensor.open_sesame_sensor', 'off') and is_state('switch.open_sesame', 'on') %}
closing
{% elif is_state('binary_sensor.open_sesame_sensor', 'on') %}
open
{% else %}
closed
{% endif %}
cover:
- platform: template
covers:
garage_door:
device_class: garage
friendly_name: "Garage Door"
value_template: "{{ states('sensor.open_sesame') }}"
open_cover:
- condition: state
entity_id: sensor.open_sesame
state: "closed"
- service: switch.toggle
target:
entity_id: switch.open_sesame
close_cover:
- condition: state
entity_id: sensor.open_sesame
state: "open"
- service: switch.toggle
target:
entity_id: switch.open_sesame
stop_cover:
service: switch.toggle
target:
entity_id: switch.open_sesame
icon_template: >-
{% if is_state('cover.garage_door', 'opening') or is_state('cover.garage_door', 'closing') %}
mdi:garage-alert
{% elif is_state('cover.garage_door', 'open') %}
mdi:garage-open
{% else %}
mdi:garage
{% endif %}