Skip to content

RPi Relay control python script based on sunset/sunrise times

License

Notifications You must be signed in to change notification settings

sc0rp1t/Relay_control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Relay_control

RPi Relay control python script based on sunset/sunrise times.
Based on ephem python package provided by pyephem - more info https://pypi.org/project/pyephem/
and gpiozero python package - more info https://pypi.org/project/gpiozero/

Script uses few python packages:

  • gpiozero -- can be installed via ' pip install gpiozero' (or pip3 dependent on system configuration)
  • ephem -- can be installed via ' pip install ephem ' (or pip3)

After placing the script into permanent location e.g. home folder -

  • place relay_control.service into /lib/systemd/system/relay_control.service and edit 'ExecStart=' to point to correct location

To enable the service deamon to run:

  • reload systemctrl deamon ' sudo systemctl daemon-reload '
  • enable it to start at boot ' sudo systemctl enable relay_control.service '
  • and start it ' sudo systemctl start relay_control.service '

To check the status of the service run ' sudo systemctl status relay_control.service ' You can also manually start, stop and restart the service via systemctl

About

RPi Relay control python script based on sunset/sunrise times

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages