The following is a complete breakdown of my Home Assistant Shabbos Mode. It includes 48 light switches, 6 light bulbs, 7 Echos, and a Zwave siren. I have 4 bathrooms which have zwave motion detection light switches (not allowed on shabbos) which get disabled. It uses the Jewish Calendar integration for the automatic turning on and off of this special mode. It will also fire for yom tov (holidays). I put a lot of time and effort in to getting this to be perfect, so I figure, why not share in case someone else needs it.
You will need to have the following items configured before beginning:
Jewish Calendar integration
jewish_calendar:
language: english
diaspora: true
havdalah_minutes_after_sunset: 45
An input select helper named âModeâ, this is the most integral part of my whole Home Assistant operation. There are 3 possible values: Home
, Away
, or Shabbos
. I can preform (or restrict) automations from firing based on this setting. Also you will see that Shabbos Mode activation or deactivation is fired from the changing of this item (in case I want to turn on Shabbos mode manually).
An input select helper named âShabbos_Guestsâ, this helper will have 3 options: âNo Guestsâ, âSleeping Guestsâ, âLunch Guestsâ. I wont go in to this in my write-up below but this will allow you to run scenes at different times based on the selection of this entity (for example: fire the afternoon scene at 1:30p if âNo Guestsâ, otherwise fire it at 3p). Make sure to put an action in your âShabbos Endingâ Automation that will set this entity back to âNo Guestsâ so it resets it for the next week.
Alexa Speaks integration: I have 7 Echos through-out the house, all of which announce the the beginning and ending of Shabbos Mode. The living room Echo will announce the days weather forecast at 10:30am while the mode is active.
I set up a Lovelace tab for Shabbos even though you cant touch it . This is mostly for testing and configuring the various lighting scenes. Itâs also where I can change the Guests select.
I chose to create lighting scenes and then trigger them with automations. I felt this was cleaner and allowed me to test the scenes out easily.
Automations
I use 4 automations for Shabbos mode. It used to be more, but now with the new trigger.id method, I simplified. This first one will change the MODE helper to Shabbos at the proper time ONLY if mode is currently Home, if the house was in away mode (IE no one home), it stops. At the end of shabbos, it will change the Mode select helper back to Home.
alias: Mode Changer - Shabbos
description: Turns Shabbos Mode ON/OFF depending on existing mode
trigger:
- platform: state
entity_id: binary_sensor.jewish_calendar_issur_melacha_in_effect
condition: []
action:
- service: switch.turn_on
target:
entity_id: switch.zwave_siren_current_value
- choose:
- conditions:
- condition: template
value_template: '{{trigger.to_state.state == ''on''}}'
- condition: state
entity_id: input_select.mode
state: Home
sequence:
- service: input_select.select_option
target:
entity_id: input_select.mode
data:
option: Shabbos
- conditions:
- condition: template
value_template: '{{trigger.to_state.state == ''off''}}'
- condition: state
entity_id: input_select.mode
state: Shabbos
sequence:
- service: input_select.select_option
target:
entity_id: input_select.mode
data:
option: Home
default: []
mode: single
Once MODE helper changes to Shabbos, this automation takes care of all the labor. It will ring a bell, send TTS to Alexa, Notify phones, set the first lighting scene, enables the lighting scene automation, and change the bathroom motion light switches to manual. The âShabbos 0 - Deactivationâ does all these actions in a reversing manor.
alias: Shabbos 0 - Activation
description: 'On mode change to shabbos mode, activate the scene and notify'
trigger:
- entity_id: input_select.mode
platform: state
to: Shabbos
condition: []
action:
- data:
node_id: 9
value: 4
value_id: '72057594195329025'
service: zwave.set_node_value
- scene: scene.shabbos_0_sunset
- data:
option: Manual
entity_id: input_select.bathroom_mode
service: input_select.select_option
- data:
message: >-
shabbos mode has been enabled with
{{states('input_select.shabbos_guests')}}, {% if
states('input_select.shabbos_guests') == 'No Guests' %}standard lighting
schedules active{% else %}lighting schedules will be extended{% endif %}
service: script.echo_announcement
- data:
message: Shabbos Mode has been ENABLED
service: notify.notify
mode: single
This automation handles all of the lighting scene changes. It used to be split in to 6 automations, but now using the new trigger.id, I have combined it in to one automation (which I can enable or disable during activation or deactivation!). I can change the time slots simply by changing the triggers but keep the same trigger.id so the actions at the bottom stay the same.
alias: Shabbos Scenes
description: Shabbos Scenes
trigger:
- at: '22:00'
platform: time
id: shabbos_1_evening_house
- at: '00:10'
platform: time
id: shabbos_2_night_house
- at: '09:15'
platform: time
id: shabbos_3_morning_closets
- at: '10:30'
platform: time
id: shabbos_4_morning_house
- at: '14:30'
platform: time
id: shabbos_5_day_house
- event: sunset
offset: '-01:20:00'
platform: sun
id: shabbos_6_sunset_house
condition:
- condition: state
entity_id: input_select.mode
state: Shabbos
action:
- choose:
- conditions:
- condition: trigger
id: shabbos_1_evening_house
sequence:
- scene: scene.shabbos_1_evening
- conditions:
- condition: trigger
id: shabbos_2_night_house
sequence:
- scene: scene.shabbos_2_goodnight
- conditions:
- condition: trigger
id: shabbos_3_morning_closets
sequence:
- scene: scene.shabbos_3_closets
- conditions:
- condition: trigger
id: shabbos_4_morning_house
sequence:
- scene: scene.shabbos_4_morning
- data:
media_content_id: Alexa.Weather.Play
media_content_type: sequence
entity_id: media_player.living_room_echo
service: media_player.play_media
- conditions:
- condition: trigger
id: shabbos_5_day_house
sequence:
- scene: scene.shabbos_5_afternoon
- conditions:
- condition: trigger
id: shabbos_6_sunset_house
sequence:
- scene: scene.shabbos_0_sunset
default: []
- service: input_text.set_value
target:
entity_id: input_text.shabbos_scene
data:
value: '{{trigger.id}}'
mode: single
Lighting Scenes
I have 6 different lighting scenes that are triggered by the Shabbos Lighting automation. Obviously your lighting will be different, so I will not post the scenes. My triggers for these automations are as follows:
- Shabbos 0 - Sunset - This scene is triggered by the activation of Shabbos mode, so there is no need for another automation
- Shabbos 1 - Evening - Automation triggers at 10pm (or 9pm without guests) changing lighting scene
- Shabbos 2 - Night - Automation triggers at 12:15am changing lighting scene
- Shabbos 3 - Morning Closets - Automation triggers at 8am changing lighting scene
- Shabbos 4 - Morning House - Automation triggers at 10:30am (also announce todays weather on Living room echo) changing lighting scene
- Shabbos 5 - Day House - Automation triggers at 3pm (or 2pm without guests) changing lighting scene
- Shabbos 0 - Sunset - This scene gets triggered again one hour before sunset, this is the same scene that was triggered at the activation of Shabbos mode so in case it is a multi-day holiday, this sets the lighting back to the beginning of the loop.
Here is a picture of my lighting scenes (triggered from the automation above). These scenes change up lighting throughout the house making sure to turn off all lights that were turned on in prior scenes.