home-assistant-configuration/sensors/smartthings.yaml

18 lines
703 B
YAML

- platform: template
sensors:
garage_door:
unit_of_measurement: ''
value_template: >-
{%- if is_state("cover.garage_door", "open") %}
Open
{% elif is_state("cover.garage_door", "opening") %}
Opening
{% elif is_state("cover.garage_door", "closed") %}
Closed
{% elif is_state("cover.garage_door", "closing") %}
Closing
{% else %}
Unknown
{%- endif %}
icon_template: '{%- if is_state("sensor.garage_door", "unknown") %}mdi:sync-alert{%- elif is_state("cover.garage_door", "open") %}mdi:garage-open{% else %}mdi:garage{%- endif %}'