~ 2 min read
How to setup Shabbat candle time announcement with Home Assistant Automation

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:
- Blog post on Setting up Shabbat Automation
- Shabbos mode discussion on Home Assistant Community
- Various automation examples from this blog post on Yom Tov and Shabbos Automation
Pre-requisites:
- You have Home Assistant installed and running.
- You have the
Jewish Sabbaths Holidays
integration installed and configured in Home Assistant: https://github.com/rt400/Jewish-Sabbaths-Holidays
The Shabbat Candle Time Announcement Home Assistant Automation
Here’s the full automation setup in Home Assistant:
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: