~ 2 min read

How to setup Shabbat candle time announcement with Home Assistant Automation

share this story on
Fun and useful automation for Shabbat observant families to announce the candle lighting time using Home Assistant.

For Shabbat observant families, the time for lighting the candles is an important ritual. It should be done very close in time to when Shabbat enters. I already have a Home Assistant integration that shows up Shabbat times so it can help automate this process, ensuring that an announcement is made at the right time every week. Here’s how to set it up.

To build this integration I relied on the following helpful resources:

Pre-requisites:

The Shabbat Candle Time Announcement Home Assistant Automation

Here’s the full automation setup in Home Assistant:

home assistant shabbat candle time announcement automation

The code involved is the following. First, we setup the trigger:

{{ (as_timestamp(strptime(states('sensor.hebcal_shabbat_entry'), '%H:%M')) - as_timestamp(now()) | int) <= 300 and (as_timestamp(strptime(states('sensor.hebcal_shabbat_entry'), '%H:%M')) - as_timestamp(now()) | int) > 0 }}

Notice that it requires you actually have setup and integrated the Jewish Sabbaths Holidays integration which provides the sensor.hebcal_shabbat_entry sensor (you need to define it in your configuration.yaml file). If it’s called something else or you defined it somehow different, adjust the above YAMl template for the trigger accordingly.

Next, the condition:

{{ now().weekday() == 4 }}

This condition checks that today is Friday, which is when Shabbat starts.

Finally, the action to announce the candle lighting time. Here is the YAML version of the action that you see in the screenshot above:

action: tts.speak
data:
  cache: true
  message: >-
    Dear residents of the Tal family. Shabbat about to start. Shabbat about to
    start. Shabbat about to start. Shabbat Shalom Lekuuulam.
  media_player_entity_id: media_player.living_room_tv
target:
  entity_id: tts.google_translate_en_com

More Home Assistant

You might find these other Home Assistant related articles useful too: