docker-apps/home-assistant/templates.yml

37 lines
1.1 KiB
YAML

template:
- binary_sensor:
- name: Sun Up
state: >
{{ is_state("sun.sun", "above_horizon") }}
icon: >
{% if is_state("binary_sensor.sun_up", "on") %}
mdi:weather-sunset-up
{% else %}
mdi:weather-sunset-down
{% endif %}
#notify:
# - platform: androidtv
# name: Android TV
# host: 10.0.0.71
- sensor:
- name: alarm_triggered_gui
state: "{{ states('switch.sthome_ut1_alarm_zone_4') }}"
icon: >
{%- set state = states('switch.sthome_ut1_alarm_zone_4') -%}
{%- if state == 'on' -%}
mdi:alarm-light
{%- elif state == 'off' -%}
mdi:alarm-light-off
{%- endif -%}
- name: gate_lock_gui
state: "{{ states('switch.sthome_ut4_relay_5') }}" # should change to binary sensor
icon: >
{%- set state = states('switch.sthome_ut4_relay_5') -%}
{%- if state == 'on' -%}
mdi:lock-open
{%- elif state == 'off' -%}
mdi:lock
{%- else -%}
mdi:lock-off
{%- endif -%}