Work on house status report
This commit is contained in:
@ -2,3 +2,12 @@
|
|||||||
{% set current = state_attr(entity_id,'brightness') %}
|
{% set current = state_attr(entity_id,'brightness') %}
|
||||||
{{ ((current / 255) * 100) | float | round(2) }}
|
{{ ((current / 255) * 100) | float | round(2) }}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro lightsOn(type,method) %}
|
||||||
|
{% set lights = states('sensor.current_lights_on') %}
|
||||||
|
{% if method == 'tts' %}
|
||||||
|
'Around the house, there {% if lights == '1' %}is{% else %}are{% endif %}currently{{ lights }} {% if lights == '1' %}light {% else %}lights {% endif %} on. '
|
||||||
|
{% elif method == 'text' %}
|
||||||
|
There {% if lights == '1' %}is {% else %}are {% endif %}currently {{ lights }} {% if lights == '1' %}light {% else %}lights {% endif %}on.
|
||||||
|
{% endif %}
|
||||||
|
{% endmacro %}
|
@ -1,7 +1,54 @@
|
|||||||
{% from 'time.jinja' import input_datetime_read, ct, next_twitch_stream, calendar_event_today, time_from_calendar %}
|
{% from 'time.jinja' import input_datetime_read, ct, next_twitch_stream, calendar_event_today, time_from_calendar %}
|
||||||
{% from 'easy_time.jinja' import count_the_days, custom_time, custom_time_between, clock %}
|
{% from 'easy_time.jinja' import count_the_days, custom_time, custom_time_between, clock %}
|
||||||
|
{% from 'lighting.jinja' import lightsOn %}
|
||||||
{% set ct = ct() | int %}
|
{% set ct = ct() | int %}
|
||||||
|
|
||||||
|
{% macro airLeaks(type,method) %}
|
||||||
|
{% set windows = states('sensor.windows_open') %}
|
||||||
|
{% set doors = states('sensor.doors_open') %}
|
||||||
|
{% if states('sensor.total_faults') > '0' %}
|
||||||
|
{% if method == 'tts' %}
|
||||||
|
{% if type == 'full' %}
|
||||||
|
{% if states('sensor.total_faults') > '0' %}
|
||||||
|
"Additionally, "
|
||||||
|
{% if windows > '0' and doors > '0' %}
|
||||||
|
"There are currently {{ states('sensor.windows_open') }} {% if windows == '1' %}window {% else %}windows {% endif %}and {{ states('sensor.doors_open') }} {% if doors == '1' %}door {% else %}doors {% endif %}open. "
|
||||||
|
{% else %}
|
||||||
|
{% if windows > '0' %}
|
||||||
|
"There {% if windows == '1' %}is {% else %}are {% endif %}currently {{ states('sensor.windows_open') }} {% if windows == '1' %}window {% else %}windows {% endif %}open. "
|
||||||
|
{% endif %}
|
||||||
|
{% if doors > '0' %}
|
||||||
|
"There {% if doors == '1' %}is {% else %}are {% endif %}currently {{ states('sensor.doors_open') }} {% if doors == '1' %}door {% else %}doors {% endif %}open. "
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% elif method == 'text' %}
|
||||||
|
{% if windows > '0' and doors > '0' %}
|
||||||
|
There are currently {{ states('sensor.windows_open') }} {% if windows == '1' %}window {% else %}windows {% endif %}and {{ states('sensor.doors_open') }} {% if doors == '1' %}door {% else %}doors {% endif %}open.
|
||||||
|
{% else %}
|
||||||
|
{% if windows > '0' %}
|
||||||
|
There {% if windows == '1' %}is {% else %}are {% endif %}currently {{ states('sensor.windows_open') }} {% if windows == '1' %}window {% else %}windows {% endif %}open.
|
||||||
|
{% endif %}
|
||||||
|
{% if doors > '0' %}
|
||||||
|
There {% if doors == '1' %}is {% else %}are {% endif %}currently {{ states('sensor.doors_open') }} {% if doors == '1' %}door {% else %}doors {% endif %}open.
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro houseStatusReport(type,method) %}
|
||||||
|
{% if type == 'airleaks' %}
|
||||||
|
{{ airLeaks(type,method) }}
|
||||||
|
{% elif type == 'lights' %}
|
||||||
|
{{ lightsOn(type,method) }}
|
||||||
|
{% elif type == 'full' %}
|
||||||
|
{{ lightsOn(type,method) }}
|
||||||
|
{{ airLeaks(type,method) }}
|
||||||
|
{% endif %}
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro tony_morning_meds(type,method) %}
|
{% macro tony_morning_meds(type,method) %}
|
||||||
{% if is_state('binary_sensor.overnight','off') %}
|
{% if is_state('binary_sensor.overnight','off') %}
|
||||||
{% if is_state('input_boolean.tony_morning_meds_taken','on') %}
|
{% if is_state('input_boolean.tony_morning_meds_taken','on') %}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
{# Daily Briefing #}
|
{# Daily Briefing #}
|
||||||
{%- macro getReport() -%}
|
{%- macro getReport() -%}
|
||||||
{% from 'speech.jinja' import greeting, dadjoke, inspirational_quote %}
|
{% from 'speech.jinja' import greeting, dadjoke, inspirational_quote %}
|
||||||
{% from 'status.jinja' import tonyStatusReport, tinaStatusReport, kallenStatusReport, emmaStatusReport %}
|
{% from 'status.jinja' import houseStatusReport, tonyStatusReport, tinaStatusReport, kallenStatusReport, emmaStatusReport %}
|
||||||
{% from 'easy_time.jinja' import count_the_days %}
|
{% from 'easy_time.jinja' import count_the_days %}
|
||||||
{% from 'weather.jinja' import weatherReport %}
|
{% from 'weather.jinja' import weatherReport %}
|
||||||
<p>
|
<p>
|
||||||
@ -221,22 +221,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
'Around the house, there are currently {{ states('sensor.current_lights_on') }} lights on. '
|
{{ houseStatusReport('full','tts') }}
|
||||||
{% set windows = states('sensor.windows_open') %}
|
|
||||||
{% set doors = states('sensor.doors_open') %}
|
|
||||||
{% if states('sensor.total_faults') > '0' %}
|
|
||||||
"Additionally, "
|
|
||||||
{% if windows > '0' and doors > '0' %}
|
|
||||||
"There are currently {{ states('sensor.windows_open') }} {% if windows == '1' %}window {% else %}windows {% endif %}and {{ states('sensor.doors_open') }} {% if doors == '1' %}door {% else %}doors {% endif %}open. "
|
|
||||||
{% else %}
|
|
||||||
{% if windows > '0' %}
|
|
||||||
"There {% if windows == '1' %}is {% else %}are {% endif %}currently {{ states('sensor.windows_open') }} {% if windows == '1' %}window {% else %}windows {% endif %}open. "
|
|
||||||
{% endif %}
|
|
||||||
{% if doors > '0' %}
|
|
||||||
"There {% if doors == '1' %}is {% else %}are {% endif %}currently {{ states('sensor.doors_open') }} {% if doors == '1' %}door {% else %}doors {% endif %}open. "
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
Reference in New Issue
Block a user