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: school_end_days2go:
value_template: '{{ (((states.input_datetime.school_last_day.attributes.timestamp)-as_timestamp(now())) | int /60/1440) | round(0) }}' value_template: '{{ (((states.input_datetime.school_last_day.attributes.timestamp)-as_timestamp(now())) | int /60/1440) | round(0) }}'
unit_of_measurement: 'Days' 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: automation:
- id: refresh_special_event_sensors - id: refresh_special_event_sensors

View File

@ -0,0 +1,25 @@
{
"MENU": {
"static": {
"3/2": "Quesadillas",
"3/3": "Pizza",
"3/4": "Taco Burger",
"3/11": "Burger",
"3/12": "Pizza",
"3/18": "Pizza",
"3/19": "Mac and Cheese",
"3/23": "Quesadilla",
"3/24": "Pizza",
"3/25": "Taco Burger",
"4/1": "Burger",
"4/2": "Pizza",
"4/13": "Quesadilla",
"4/14": "Pizza",
"4/15": "Taco Burger",
"4/22": "Burger",
"4/23": "Pizza",
"4/29": "Pizza",
"4/30": "Mac and Cheese"
}
}
}