Schedules script executions relative to Shabbat and Hag in and out times.
start.sh
is executed at Shabbat/Hag start.end.sh
is executed at Shabbat/Hag end.
Jewish Holidays are taken into account.
Times are within close range of chabbad.org
- Download the files to
/home/pi/ShabbatCron/
- Run
pip install -r requirements.txt
It is suggested to use a python virtual environment
sudo ln -s /home/pi/ShabbatCron/shabbat-cron.service /etc/systemd/system/shabbat-cron.service
sudo systemctl enable shabbat-cron.service
The service will automatically start at system boot.
- To manually start:
sudo service shabbat-cron start
- To manually stop:
sudo service shabbat-cron stop
- Adjust your physical location by adding an entry to
settings.ASTRAL_LOCATION_INFO
, and settingsettings.LOCATION
- Adjust the
START_DELTA
andEND_DELTA
variables to controls how many minutes before/after Shabbat/Hag the relay should be activated/deactivated - Adjust the
start.sh
andstop.sh
scripts with your specific logic
/home/pi/ShabbatCron/
is assumed as the projet directory, and /usr/bin/python3
for python.
Adjust shabbat-cron.service
for your specific setup.
- Thanks to Chabad's wonderful site explaining Shabbat end times: Zmanim-Calculations
- Many thanks to Darryl Bond for his fantastic relay driver: github.com/darrylb123/usbrelay
Darryl'susbrelay
is used in the sample bash scripts to turn relays on and off.
USB Relay Driver Installation:sudo apt-get install usbrelay sudo nano /etc/udev/rules.d/50-dct-tech-usb-relay-2.rules SUBSYSTEM=="usb", ATTR{idVendor}=="16c0",ATTR{idProduct}=="05df", MODE="0666" KERNEL=="hidraw*", ATTRS{busnum}=="1", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05df", MODE="0666" #Test sudo usbrelay X0L7N_1=1 sudo usbrelay X0L7N_2=1