I figured some people might be interested in using this Sefirat Ha’omer reminder automation I put together.
I’m using Google TTS for English-language announcements, and optionally, you can add a Hebrew TTS service to have it recite the Omer in Hebrew.
First, make sure you have TTS service(s) set up in your configuration.yaml:
# Text to speech
tts:
- platform: google_translate
service_name: google_say
- platform: reversotts
language: 'he-IL-Asaf-Hebrew'
For Hebrew TTS, I am using the ReversoTTS component which can be installed easily via HACS.
You will also need to have the Jewish Calendar integration set up in your configuration.yaml:
# Jewish Calendar
jewish_calendar:
Next you want to create an automation:
alias: Sefirat HaOmer (English and Hebrew)
description: ''
trigger:
- platform: sun
event: sunset
offset: '00:44:00'
condition:
- condition: numeric_state
entity_id: sensor.jewish_calendar_day_of_the_omer
above: '1'
below: '50'
action:
- service: media_player.volume_set
data:
volume_level: 0.5
target:
entity_id: media_player.<YOUR_MEDIA_DEVICE>
- service: tts.google_say
data:
entity_id: media_player.<YOUR_MEDIA_DEVICE>
message: >
{% set weeksct = states('sensor.jewish_calendar_day_of_the_omer') | int
// 7 %} {% set daysct = states('sensor.jewish_calendar_day_of_the_omer') |
int % 7 %} {%- macro suffix(d) %} {%- set sfx = {1:'st',2:'nd',3:'rd'}
%} {{- 'th' if 11 <= d <= 13 else sfx.get(d%10, 'th') }} {%- endmacro %}
{% set date = states('sensor.jewish_calendar_day_of_the_omer') |
timestamp_custom('%d') |int %} Today is the {{ date }}{{ suffix(date) }}
day of the Omer which is {{ weeksct }} {% if weeksct == 1 %} week {%
elif weeksct > 1 %} weeks {% endif %}{% if daysct == 1 %} and {{ daysct }}
day. {% elif daysct >1 %}and {{ daysct }} days.{% endif %}
mode: single
To have it counted in Hebrew, substitute this service and message in the automation above:
service: tts.reversotts_say
data:
entity_id: media_player.<YOUR_MEDIA_DEVICE>
message: >
{% set OmerDays = states('sensor.jewish_calendar_day_of_the_omer') | int %}
{% set weeksct = OmerDays | int // 7 %} {% set daysct = OmerDays | int % 7
%} {% set Base10Ones = OmerDays | int % 10 %} {% set Base10Tens = OmerDays
|int - Base10Ones %} הַיּוֹם {% if OmerDays < 21 %} {{ OmerDays }} {%
elif OmerDays > 20 %} {{ Base10Ones }} וְ- {{ Base10Tens }} {% endif %}
יָמִים לָעֹֽמֶר {% if weeksct < 2 %} שֶׁהֵם שָׁבוּעַ אֶחָד {% elif weeksct >
1 %} שֶׁהֵם {{ weeksct }} שָׁבוּעוֹת {% endif %} {% if daysct == 1 %}
וְיוֹם אֶחָד {% elif daysct >1 %} וְ- {{ daysct }} יָמִים{% endif %}
Notes:
- This automation triggers 44 minutes after sunset. I have tried multiple times to have it trigger using “jewish_calendar_t_set_hakochavim” but it’s not working for me- does anyone know what I’m doing wrong?
- platform: template
value_template: |-
trigger:
- platform: template
value_template: "{{ as_timestamp(states('sensor.jewish_calendar_t_set_hakochavim'))|timestamp_custom('%H:%M', true) == states('sensor.time') }}"
- The Hebrew TTS follows the Sephardic schema:
Today is the nth day of the Omer, [which is x week(s)] [and y day(s)].
One issue it has is that Hebrew TTS services don’t have a way to specify a gender to use for the number, day or week counts (e.g. חמש or חמישה)
If anyone would like to help refine the Hebrew TTS verbiage, please comment below!