178 lines
8.4 KiB
YAML
178 lines
8.4 KiB
YAML
>
|
|
{# Welcome Home #}
|
|
{%- macro getReport() -%}
|
|
<p>
|
|
"Welcome home, "
|
|
{% if is_state('person.tony_stork','home') and is_state('person.christina_stork','home') %}
|
|
"Stork family. "
|
|
{% elif is_state('person.tony_stork','home') %}
|
|
"Tony. "
|
|
{% elif is_state('person.christina_stork','home') %}
|
|
"Tina. "
|
|
{% else %}
|
|
"Whoever you are, Tony must have broken me again. "
|
|
{% endif %}
|
|
{% if now().strftime('%H')|int < 12 %}
|
|
"I hope you're having a great morning!"
|
|
{% elif now().strftime('%H')|int >= 12 and now().strftime('%H')|int < 17 %}
|
|
"I hope your afternoon has been a good one!"
|
|
{% else %}
|
|
"and good evening. I hope you had a good day!"
|
|
{% endif %}
|
|
</p>
|
|
|
|
<p>
|
|
{% set endbefore = state_attr('input_datetime.school_day_end','timestamp') - 3600 %}
|
|
{% set endafter = state_attr('input_datetime.school_day_end','timestamp') + 3600 %}
|
|
{% set current = ((now().hour * 60 + now().minute) * 60 ) %}
|
|
{% if is_state('input_boolean.school_today_extended','on') and current > endbefore and current < endafter %}
|
|
"Welcome home Colin as well, "
|
|
{{ [
|
|
'I hope you had a great day at school! ',
|
|
'I hope school was as boring, uh I mean exciting as ever! ',
|
|
'Hopefully your day at school was educational and fun! ',
|
|
'Do not forget to do your homework! ',
|
|
'You must be glad that your school day is over! '
|
|
] | random }}
|
|
{% if is_state('input_boolean.kallen_band_practice','on') %}
|
|
{{ [
|
|
'I hope you also enjoyed band practice this morning! ',
|
|
'I hope the trombone treated you well this morning! ',
|
|
'Band geeks are the best geeks! ',
|
|
'You did not achieve eighth position this morning, did you? ',
|
|
] | random }}
|
|
{% endif %}
|
|
{% elif is_state('input_boolean.kallen_school_cancelled','on') %}
|
|
"I hope you are enjoying your free day off from school, Colin. "
|
|
{% endif %}
|
|
</p>
|
|
<p>
|
|
{% if is_state('sensor.anniversary_tony_s_birthday','0') %}
|
|
Happy Birthday Tony!
|
|
{% endif %}
|
|
{% if is_state('sensor.anniversary_tina_s_birthday','0') %}
|
|
Happy Birthday Tina!
|
|
{% endif %}
|
|
{% if is_state('sensor.anniversary_kallen_s_birthday','0') %}
|
|
Happy Birthday Colin!
|
|
{% endif %}
|
|
{% if is_state('sensor.anniversary_emmalynn_s_birthday','0') %}
|
|
Happy Birthday Emmalynn!
|
|
{% endif %}
|
|
</p>
|
|
|
|
<p>
|
|
{% if states('sensor.weatheralerts_active_alerts') > '0' %}
|
|
"Currently there are weather alerts active. The total number of alerts is {{ states('sensor.weatheralerts_active_alerts') }}. They are as follows. "
|
|
{% if is_state('sensor.weatheralerts_alert_1','on') %}
|
|
"{{ state_attr('sensor.weatheralerts_alert_1','alert_event') }}"
|
|
{% endif %}
|
|
{% if is_state('sensor.weatheralerts_alert_2','on') %}
|
|
"{{ state_attr('sensor.weatheralerts_alert_2','alert_event') }}"
|
|
{% endif %}
|
|
{% if is_state('sensor.weatheralerts_alert_3','on') %}
|
|
"{{ state_attr('sensor.weatheralerts_alert_3','alert_event') }}"
|
|
{% endif %}
|
|
{% if is_state('sensor.weatheralerts_alert_4','on') %}
|
|
"{{ state_attr('sensor.weatheralerts_alert_4','alert_event') }}"
|
|
{% endif %}
|
|
{% if is_state('sensor.weatheralerts_alert_5','on') %}
|
|
"{{ state_attr('sensor.weatheralerts_alert_5','alert_event') }}"
|
|
{% endif %}
|
|
{% endif %}
|
|
</p>
|
|
|
|
<p>
|
|
"The current climate control situation is as follows. "
|
|
{% if is_state('input_boolean.master_bedroom_aircon_installed','on') %}
|
|
"the master bedroom temperature is currently {{ state_attr('climate.master_bedroom_aircon','current_temperature') }} degrees. "
|
|
{% if is_state('climate.master_bedroom_aircon','cool') %}
|
|
"and the master bedroom air conditioner is currently set for cooling to {{ state_attr('climate.master_bedroom_aircon','temperature') }} degrees. "
|
|
{% elif is_state('climate.master_bedroom_aircon','fan_only') %}
|
|
"and the master bedroom air conditioner is currently in fan only mode. "
|
|
{% elif is_state('climate.master_bedroom_aircon','dry') %}
|
|
"and the master bedroom air conditioner is currently moonlighting as a dehumidifier. "
|
|
{% elif is_state('climate.master_bedroom_aircon','off') %}
|
|
"and the master bedroom air conditioner is currently not running. "
|
|
{% elif is_state('climate.master_bedroom_aircon','auto') %}
|
|
"and the master bedroom air conditioner is making its own decisions. Be afraid, be very afraid. "
|
|
{% else %}
|
|
"and the master bedroom air conditioner is currently not speaking to me. Was it something I said? "
|
|
{% endif %}
|
|
{% else %}
|
|
"There is no air conditioner or temperature sensor currently installed in the master bedroom. "
|
|
{% endif %}
|
|
</p>
|
|
|
|
<p>
|
|
{% if is_state('sensor.garbage_collection_large_pickup','1') %}
|
|
'Tomorrow is the monthly unlimited garbage pickup. Make sure to take out all large garbage items tonight, and do not forget the trash can!'
|
|
{% elif is_state('sensor.garbage_collection','1') %}
|
|
{{ [
|
|
'Do not forget to take the trash bin to the curb, tomorrow is trash pickup day.',
|
|
'Make sure to take the trash out. No, I do not mean Tony.',
|
|
'Tomorrow is a big day for the garbage men. Make sure you do not let them down! Take the trash out!'
|
|
] | random }}
|
|
{% endif %}
|
|
|
|
{% set gc = state_attr('sensor.garbage_collection','days') %}
|
|
{% if gc == 7 %}
|
|
{{ [
|
|
'Do not forget to bring the trash can back from the curb.',
|
|
'The trash can will feel lonely if you leave it at the curb all night.'
|
|
] | random }}
|
|
{% elif gc == 6 %}
|
|
{% if is_state('binary_sensor.morning','on') or is_state('binary_sensor.midday','on') %}
|
|
{{ [
|
|
'If you have not already, please remember to bring the garbage can back from the sidewalk.',
|
|
'Just in case you forgot, it is time to bring the garbage can back to the house before it gets lonely.'
|
|
] | random }}
|
|
{% endif %}
|
|
{% endif %}
|
|
</p>
|
|
|
|
<p>
|
|
{% if is_state('light.living_room_lights','on') %}
|
|
{% if is_state('input_boolean.early_night_mode','on') %}
|
|
"Because it is getting dark, I have turned on the lights for you in the living room, dining room, and mud room. This makes for a total of {{ states.sensor.current_lights_on.state }} lights on. "
|
|
{% else %}
|
|
"Due to less than optimal sunlight, I have turned on the lights for you in the living room, dining room, and mud room. This makes for a total of {{ states.sensor.current_lights_on.state }} lights on. "
|
|
{% endif %}
|
|
{% endif %}
|
|
</p>
|
|
|
|
<p>
|
|
{% set tina = states.person.christina_stork.state %}
|
|
{% if tina in ['Bob Evans','BobEvans'] and is_state('input_boolean.work_today','on') %}
|
|
"Tina is at work right now. She will be done at approximately {{ (state_attr('input_datetime.tina_workday_end','timestamp') | int | timestamp_custom('%I:%M %p', False)) }}. "
|
|
{% elif is_state('input_boolean.work_today','on') %}
|
|
"Tina has work today. "
|
|
{% endif %}
|
|
{% if is_state('input_boolean.kallen_school','on') %}
|
|
"Kallen is at school right now. His pickup time will be at {{ (state_attr('input_datetime.school_day_end','timestamp') | int | timestamp_custom('%I:%M %p', False)) }}. "
|
|
{% elif is_state('input_boolean.school_today','on') %}
|
|
"Kallen has school today. "
|
|
{% endif %}
|
|
</p>
|
|
|
|
<p>
|
|
{% if is_state('input_boolean.briefing_extras','on') %}
|
|
"And now we have the following extra information to pass along. {{ states('input_text.briefing_extras') }} "
|
|
{% endif %}
|
|
</p>
|
|
|
|
{%- endmacro -%}
|
|
|
|
{# a macro that removes all newline characters, empty spaces, and returns formatted text #}
|
|
{%- macro cleanup(data) -%}
|
|
{%- for item in data.split("\n") if item | trim != "" -%}
|
|
{{ item | trim }} {% endfor -%}
|
|
{%- endmacro -%}
|
|
|
|
{# a macro to call all macros :) #}
|
|
{%- macro mother_of_all_macros() -%}
|
|
{{ getReport() }}
|
|
{%- endmacro -%}
|
|
|
|
{# Call the macro #}
|
|
{{- cleanup(mother_of_all_macros()) -}} |