Merge branch 'welcome-home'

This commit is contained in:
2022-09-01 02:15:04 -04:00
2 changed files with 32 additions and 4 deletions

View File

@ -11,6 +11,9 @@ input_boolean:
work_today:
name: Work Today
icon: mdi:briefcase
school_today_extended:
name: School Today Extended
icon: mdi:bus-school
input_datetime:
school_first_day:
@ -182,7 +185,9 @@ automation:
data:
time: "15:19:00"
- service: input_boolean.turn_on
entity_id: input_boolean.school_today
entity_id: input_boolean.school_today
- service: input_boolean.turn_on
entity_id: input_boolean.school_today_extended
- service: script.turn_on
entity_id: script.school_in_session
@ -221,9 +226,23 @@ automation:
trigger:
- platform: time
at: input_datetime.school_day_end
id: day_end
- platform: time
at: 00:00
id: midnight
action:
- service: input_boolean.turn_off
entity_id: input_boolean.school_today
- if:
- condition: trigger
id: day_end
then:
- service: input_boolean.turn_off
entity_id: input_boolean.school_today
- if:
- condition: trigger
id: midnight
then:
- service: input_boolean.turn_off
entity_id: input_boolean.school_today_extended
- id: a6eeb075-d21b-436c-983f-39188ee9b016
alias: Work Reset

View File

@ -21,6 +21,15 @@
{% 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 Kallen as well, I hope you had a great day at school!
{% endif %}
</p>
<p>
As you are no doubt aware, the weather outside is {{ state_attr('weather.iron_nerd_weather_station','temperature') | round }} degrees
{% if is_state('weather.iron_nerd_weather_station','rainy') %}
@ -87,7 +96,7 @@
<p>
{% if is_state('person.christina_stork','Bob Evans') and is_state('input_boolean.work_today','on') %}
<s>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)) }}</s>
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 %}