Giter Site home page Giter Site logo

nadavk / shabbatcron Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 21 KB

Schedules script executions relative to Shabbat and Jewish Holiday start and end times.

License: GNU Affero General Public License v3.0

Shell 0.72% Python 99.28%
jewish jewish-holidays scheduled-tasks scheduler-service scheduler

shabbatcron's Introduction

ShabbatCron

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

Installation

Project

  1. Download the files to /home/pi/ShabbatCron/
  2. Run pip install -r requirements.txt

It is suggested to use a python virtual environment

Service

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

Settings

  1. Adjust your physical location by adding an entry to settings.ASTRAL_LOCATION_INFO, and setting settings.LOCATION
  2. Adjust the START_DELTA and END_DELTA variables to controls how many minutes before/after Shabbat/Hag the relay should be activated/deactivated
  3. Adjust the start.sh and stop.sh scripts with your specific logic

Note

/home/pi/ShabbatCron/ is assumed as the projet directory, and /usr/bin/python3 for python.
Adjust shabbat-cron.service for your specific setup.

Acknowledgments

  • 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's usbrelay 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
    

shabbatcron's People

Contributors

nadavk avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.