Adding school year and day trackers to tune audible messages:

This commit is contained in:
Jeffrey Stone 2020-06-07 19:32:41 -04:00
parent 69ff8d77d0
commit 140fb40313
2 changed files with 47 additions and 1 deletions

View File

@ -15,7 +15,7 @@ automation:
action: action:
- service: clean_up_snapshots_service.clean_up - service: clean_up_snapshots_service.clean_up
# Nightly Entity Refresh - For all those sensors that need a little push # Morning Entity Refresh - For all those sensors that need a little push
- id: daily_entity_refresh - id: daily_entity_refresh
alias: Daily Entity Refresh alias: Daily Entity Refresh
initial_state: 'on' initial_state: 'on'
@ -27,4 +27,16 @@ automation:
entity_id: sensor.today_is entity_id: sensor.today_is
- service: homeassistant.update_entity - service: homeassistant.update_entity
entity_id: sensor.holiday entity_id: sensor.holiday
# Nightly Entity Refresh - For all those sensors that need a little push
- id: daily_entity_refresh2
alias: Daily Entity Refresh2
initial_state: 'on'
trigger:
- platform: time
at: '17:00:00'
action:
- service: homeassistant.update_entity
entity_id: sensor.school_tomorrow

View File

@ -10,6 +10,40 @@ input_boolean:
name: Rex Manning audio name: Rex Manning audio
icon: mdi:speaker-wireless icon: mdi:speaker-wireless
input_datetime:
school_first_day:
name: First Day of School
has_date: true
has_time: false
initial: '2020-08-05'
school_last_day:
name: Last Day of School
has_date: true
has_time: false
initial: '2021-05-26'
school_day_start:
name: School Day Start
has_date: false
has_time: true
initial: '07:45:00'
school_day_end:
name: School Day End
has_date: false
has_time: true
initial: '14:45:00'
sensor:
- platform: template
sensors:
school_start_days2go:
value_template: '{{ (((states.input_datetime.school_first_day.attributes.timestamp)-as_timestamp(now())) | int /60/1440) | round(0) }}'
unit_of_measurement: 'Days'
entity_id: input_datetime.school_first_day,sensor.time
school_end_days2go:
value_template: '{{ (((states.input_datetime.school_last_day.attributes.timestamp)-as_timestamp(now())) | int /60/1440) | round(0) }}'
unit_of_measurement: 'Days'
entity_id: input_datetime.school_last_day,sensor.time
automation: automation:
- id: refresh_special_event_sensors - id: refresh_special_event_sensors
alias: Refresh special event sensors alias: Refresh special event sensors