This example uses the Jewish Sabbaths & Holidays integration by rt400, which provides a variety of sensors including:
sensor.hebcal_is_shabbat
β returns'True'
if it's currently Shabbat, otherwise'False'
sensor.hebcal_is_yomtov
β returns'No Info'
if it's not Yom Tov, otherwise a string with the holiday name
If you want to drive automations based on either Shabbat or Yom Tov, you can create a combined binary sensor using a template sensor.
We define a binary_sensor.is_shabbat_or_yomtov
which returns on
if:
sensor.hebcal_is_shabbat
is'True'
ORsensor.hebcal_is_yomtov
is anything other than'No Info'
Add this under your binary_sensor:
section:
- platform: template
sensors:
is_shabbat_or_yomtov:
friendly_name: "Is it Shabbat or Yom Tov"
value_template: >-
{{ is_state('sensor.hebcal_is_shabbat', 'True') or not is_state('sensor.hebcal_is_yomtov', 'No Info') }}
icon_template: >-
{% if is_state('sensor.hebcal_is_shabbat', 'True') or not is_state('sensor.hebcal_is_yomtov', 'No Info') %}
mdi:candle
{% else %}
mdi:calendar-remove
{% endif %}
This is useful for:
- Controlling lighting automations on holy days
- Muting notifications
- Displaying a clear Shabbat/Yom Tov status indicator on dashboards
- Integration: rt400/Jewish-Sabbaths-Holidays on GitHub