Improve speech. Group lights and windows

This commit is contained in:
2020-03-08 02:16:38 +02:00
parent 1ecfc9166e
commit 4daa60d782
8 changed files with 57 additions and 36 deletions

View File

@@ -1,11 +1,11 @@
>-
{%- if is_state('light.living_room_all_lights', 'on') -%}
There are
{%- if is_state('light.all_lights', 'on') -%}
There are
{%- for state in states.light if state.state == 'on' -%}
{%if loop.last %} {{ loop.index }} {% endif %}
{% if loop.last %} {{ loop.index }} {% endif %}
{%- endfor -%}
lights on right now.
lights turned on right now.
{%- else -%}
There are no lights on right now.
There are no lights turned on right now.
{%- endif -%}

View File

@@ -0,0 +1,3 @@
>-
The time is {{ now().hour }} {{ "%0.02d" | format(now().strftime("%-M") | int) }}.

View File

@@ -1,9 +1,12 @@
>-
{%- if is_state('binary_sensor.living_room_right_window_on_off', 'on') -%}
The living room window is opened.
{%- endif -%}
{%- if is_state('binary_sensor.bedroom_right_window_on_off', 'on') -%}
The master bedroom window is opened.
{%- if is_state('group.all_windows', 'on') -%}
{%- if is_state('binary_sensor.living_room_right_window_on_off', 'on') -%}
The living room window is opened.
{%- endif -%}
{%- if is_state('binary_sensor.bedroom_right_window_on_off', 'on') -%}
The master bedroom window is opened.
{%- endif -%}
{%- else -%}
All windows are closed.
{%- endif -%}