Adding school lunch sensor

This commit is contained in:
Jeffrey Stone
2021-03-06 10:10:07 -05:00
parent 4a163af0ea
commit eebbd238a5
2 changed files with 33 additions and 0 deletions

View File

@@ -106,6 +106,14 @@ sensor:
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'
- platform: rest
resource: https://raw.githubusercontent.com/thejeffreystone/home-assistant-configuration/master/config/packages/json_data/school_lunch.json
name: School Lunch
scan_interval: 14400
value_template: >
{% set today = now().month ~ '/' ~ now().day %}
{% set lunch = value_json.MENU.static[ today ] %}
{{ lunch }}
automation:
- id: refresh_special_event_sensors