Skip to content

Instantly share code, notes, and snippets.

@esteele
Created September 11, 2018 14:17
Show Gist options
  • Save esteele/6d5a714a1c3ce3d2c88599a811d214c0 to your computer and use it in GitHub Desktop.
Save esteele/6d5a714a1c3ce3d2c88599a811d214c0 to your computer and use it in GitHub Desktop.
binary_sensor:
- platform: template
sensors:
is_school_day_today:
entity_id:
- calendar.is_school_day1
- calendar.is_school_day2
- calendar.is_school_day3
- calendar.is_school_day4
- calendar.is_school_day5
- calendar.is_school_day6
value_template: >-
{% if is_state("calendar.is_school_day1", "on") or
is_state("calendar.is_school_day2", "on") or
is_state("calendar.is_school_day3", "on") or
is_state("calendar.is_school_day4", "on") or
is_state("calendar.is_school_day5", "on") or
is_state("calendar.is_school_day6", "on")
-%}
on
{%- else -%}
off
{%- endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment