Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 105753

Binary Sensor from School Calendar

$
0
0

I have a calendar, calendar.town_schools, in Home Assistant. Every event on the calendar is an all day event lasting one or more days. For the purposes of this sensor, I only care about events with the titles:

  • No School
  • Last Day of School
  • First Day of School

I want a school_day binary sensor with the following logic:

  • If it’s a weekend then the sensor is off
  • If there’s a “No School” event, the sensor is off
  • If the current date is > Last Day of School this year and < First Day of School this year, the sensor is off (for summer vacation)
  • Otherwise, the sensor is on.

The calendar, which I import from the school district, does not explicitly list summer vacation days or weekends as having “No School” and I’d very much like to avoid explicitly adding that.

I see examples of how to handle "if today has this specific event, turn the sensor on`, but can’t figure out how to handle the detection of summer vacation.

Any pointers?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 105753

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>