Files
fresh-home/scripts/people/marshall/marshall_travel_sensor.yaml
T
2024-04-14 14:08:56 -04:00

21 lines
758 B
YAML

alias: Marshall travel sensor
mode: restart
sequence:
- service: input_text.set_value
data_template:
entity_id: input_text.person_marshall
value: >-
{% if is_state('input_boolean.marshall_home', 'on') %}
{% if is_state('input_boolean.marshall_is_awake','off') %}
Sleeping
{% elif is_state('input_boolean.marshall_in_bed','on') %}
In bed
{% else %}
{{ states("input_select.marshall_status_dropdown") }}
{% endif %}
{% elif is_state('group.person_marshall', 'home') and is_state('input_boolean.marshall_home', 'off') %}
Near home ({{ states('input_select.marshall_status_dropdown') }})
{% else %}
Away
{% endif %}