Smart Home:
Making your House Shomer Shabbat

Yaakov used an open-source smart home hub called Home Assistant to control home lights for Shabbat and Yom Tov without having to worry about resetting any timer various time changes. This tutorial is a step by step solution to turn your house into a Shomer Shabbat one!

What you’ll need:

  • Raspberry Pi 3B or later

A Raspberry Pi is a computer about the size of a credit card. As of writing this, the latest and greatest is the Raspberry Pi 4. The board itself is $35 US but beyond that, you need at least a compatible power cable, a microSD card, and a way to write to the microSD card via a computer. Here is a kit on Amazon that comes with everything you need.

  • Smart Home compatible switches and plugs

You’ll need a smart plug or smart switch to physically control the lights. While there are smart bulbs too, I’ve found that using these are more complicated and not necessary for just trying to switch lights on and off for Shabbat. You can find a popular smart plug on Amazon here. The same company also makes a smart switch here. Mind that depending on the wiring of your lights, you may need a three-way smart switch like this. Overall I recommend ones that work with the Tuya or Smartlife app but any switch that’s compatible with HASSIO integrations should work.

  • A computer to write to the microSD card and access the Raspberry Pi
  • Ethernet Cable or Wi-fi with an internet connection so the Raspberry Pi can talk to the plugs and switches. Ethernet connection is recommended.

Step 1: Installing HASSIO

First thing you’ll want to do is get Home Assistant up and running on your Raspberry Pi using the HASSIO image. Home Assistant already has a very good tutorial on this here and here, so I’ll refer you there 🙂 Once you have HASSIO running via http://hassio.local:8123/ or http://[IPaddressofrasberrypi]:8123 you can move on to Step 2!

Step 2: Smart Plug and Switch Configuration

The next thing you’ll want to do is register your smart plugs and switches so that on their respective apps. This is different for each type of smart plug or switch so follow their specific instructions to configure the smart plug with the Wi-Fi and app. After configuration, you typically can turn on and off the light with the app as well as set timers and schedules. However, this is rather limiting and does not sync with a Jewish calendar. That’s why we need HASSIO!

Step 3: Update and Add HASSIO Configurator

Next, you need to configure HASSIO. After logging into HASSIO you should see menu bar similar to this. (You won’t see “Configurator” but don’t worry we’re going to add it soon!) First thing you’ll want to do is click on Hass.io and check if there are any updates. If so, go ahead and update the system, this can take up to 10 minutes so be patient and don’t close the window until at least the update has finished. Next, you’ll want to click on the “Add-On Store” as below. Then click on the “Configurator” Add-On and Install it. Also, you’ll want to select the option to “Show in sidebar.”

Step 4: Configure HASSIO

Next, click on the “Configurator” from the menu and you should be greeted by a screen like below. Click on the folder icon and select “configuration.yaml” from the list to edit. After the “config:” line adds the code to the right making sure to keep all the correct indents. (Set “diaspora” to “False” if you live in Israel.) Also, you’ll need to add your smart lights or switches to the configuration.yaml file that you connected to the Wi-Fi before. This is slightly different depending on what system you got, so search for your system in the HASSIO integrations for details on your specific setup. Here is the page if you went with Tuya or Smartlife switches. After, you’ll need to restart HASSIO for the settings to take effect. Click on “Configuration” -> “Server Control” then “Restart”. Again, this will probably take about a minute so be patient!
jewish_calendar:
  language: english
  diaspora: True

Step 5: Rename Switches (Optional)

While technically optional, this step will make your life a lot easier when making automatons in the next step. After restarting HASSIO, you should see something similar to below in your “Overview”. If you click on any of the switch names you should get a pop-up window. Click the gear, the Entity ID will likely be “switch.” followed by a long string of characters. Rename the content after the period with anything you’d like as long as there are no spaces. Repeat this for each of your switches.

Step 6: Automations

Congrats! You’ve finished with what is probably the hardest part. Now comes the fun part, setting up Automations for your switches based on the new “Issur Melacha in Effect” switch. You’ll want to head over to “Configuration” -> “Automation.” Here you can click the plus icon on the lower right to add a new automation. As an example, we’ll set one up the start of Shabbat or Yom Tov. Under “Triggers” you’ll need to select “binary_sensor.jewish_calendar_issur_melacha_in_effect” and From: “off” To: “on”.  Then you’ll want to go to Actions and select “Call service” for your action type and select “homeassistant.turn_on”. For service data, you’ll need to specially format this similar to the right, however, instead of the example switches, you’ll put your own names from Step 5. The spacing is important here so make sure to follow it closely. 
entity_id:
  - switch.livingroom
  - switch.bathroom
  - switch.kitchen
  - switch.closet
  - switch.diningroom
  - switch.nightlight

Step 7: Enjoy!

That’s it! Hope this tutorial was useful. If you have any questions or other tutorials you’d like to see feel free to contact me.