This template binary sensor provides a binary condition for the isYomtiv sensor in the Jewish Sabbath Holidays Home Assistant plugin which reports either No Info
(false) or the Yom Tov name (true).
To simplify using this sensor in automations, this template sensor converts it to a binary based on simple logic interpretation.
Template binary sensor for Yomtov detection in Home Assistant using sensor.hebcal_is_yomtov
from rt400/Jewish-Sabbaths-Holidays
# Binary Sensor: Is it Yomtov?
#
# This binary sensor is designed for Home Assistant and uses the output of
# the Jewish calendar sensor `sensor.hebcal_is_yomtov`, provided by:
# https://github.com/rt400/Jewish-Sabbaths-Holidays
#
# The original sensor provides a text value indicating the name of the holiday
# if it is Yomtov (e.g. "Shavuot", "Sukkot") or "No Info" otherwise.
#
# This template converts that into a proper boolean (binary) sensor, useful
# for automations, dashboards, etc.
- platform: template
sensors:
is_yomtov_binary:
friendly_name: "Is Yomtov?"
value_template: >-
{{ not is_state('sensor.hebcal_is_yomtov', 'No Info') }}
icon_template: >-
{% if not is_state('sensor.hebcal_is_yomtov', 'No Info') %}
mdi:candle
{% else %}
mdi:calendar-remove
{% endif %}