So our school district has finally made a shared calendar for all the school holidays. Previously I had put in the no school day manually, but just labeled them “No School” so it was easy to parse for templates/automations. The shared calendar states the holiday and then follows it with “Schools Closed”. If I can use just the shared calendar I can clean up the family calendar just a little bit.
I currently use this as my School/No School sensor where “No School” is an all day event created manually.
{% if is_state('sensor.date_dayoftheweek', 'Sunday') %}
No School
{% elif is_state('sensor.date_dayoftheweek', 'Saturday') %}
No School
{% elif is_state_attr('calendar.camp','message', 'No School')%}
No School
{% else %}
School
{% endif %}
I would like to use the shared calendar, but do not know how to omit some text/parse out just the phrase. The shard calendar looks something like this, the “Schools Closed” is always at the end of the holiday name though.
calendar.park_ave_pta
message: Labor Day - Schools Closed
Anybody have an idea?
Thank you!!