Schedule for relay control?

  • Is it possible to set a schedule for the relay expansion? I set up my onion with a usb web cam and a relay to control a light in my chicken coop and would like to schedule the light.

  • @Jason-Hamlett Not sure whether or not I understand you right, but my suggestion would be to set up a command (e.g. shell script etc.) of what you want to run on a scheduled basis. Then use crontab to schedule the running of this command according to your required schedule.

    See and other references therein for documentation on use of crontab and cron files for running scheduled jobs.

  • Thank you for the reply Kit. I have relay one on the expansion connected inline to power and to a light fixture. I can toggle the light on and off via the relay now. I would like to be able to set a schedule for the relay to turn the light on for two hours in the morning and two hours at night. I live in alaska and i need to augment some daylight for the flock. I will look at cron and crontab

  • @Jason-Hamlett Hi, given that you have code to toggle the light on and off, it should be relatively straightforward to set crontab entry/entries to toggle on and off according to your schedule. Let me know if you want any detailed advice on using crontab - I have used it regularly in the past.

Log in to reply

Looks like your connection to Onion Community was lost, please wait while we try to reconnect.