{"id":26232555,"url":"https://github.com/bulletmark/wcscheduler","last_synced_at":"2025-07-06T04:41:08.537Z","repository":{"id":137097972,"uuid":"163719551","full_name":"bulletmark/wcscheduler","owner":"bulletmark","description":"Schedule Watts Clever Switches","archived":false,"fork":false,"pushed_at":"2025-01-28T00:28:07.000Z","size":71,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T14:20:54.163Z","etag":null,"topics":["ifttt","ifttt-webhooks","python","raspberry-pi","switch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bulletmark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-01-01T07:09:34.000Z","updated_at":"2025-01-28T00:28:11.000Z","dependencies_parsed_at":"2023-09-05T02:46:10.513Z","dependency_job_id":"a5858da9-c2d1-4ee0-8ca8-4bd3381fc04e","html_url":"https://github.com/bulletmark/wcscheduler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bulletmark%2Fwcscheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bulletmark%2Fwcscheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bulletmark%2Fwcscheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bulletmark%2Fwcscheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bulletmark","download_url":"https://codeload.github.com/bulletmark/wcscheduler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250222169,"owners_count":21394829,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ifttt","ifttt-webhooks","python","raspberry-pi","switch"],"created_at":"2025-03-13T00:37:29.794Z","updated_at":"2025-04-22T10:41:57.975Z","avatar_url":"https://github.com/bulletmark.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## WCSCHEDULER - Schedule Watts Clever Switches\n\nThis is a Raspberry Pi program to switch one or more Watts Clever RF\nswitches to turn mains powered devices on or off at specified times and\ndays of week. It uses my Python module\n[`wcccontrol`](https://github.com/bulletmark/wccontrol) which controls\nWatts Clever switches via an RF transmitter. It also runs a small\ninternal webserver to receive webhooks commands from the internet, e.g.\nfrom [IFTTT](https://ifttt.com/) using Google Assistant (V2 since Sep\n2022), to remotely switch the devices.\n\nThe latest version of this document and code is available at\nhttps://github.com/bulletmark/wcscheduler.\n\n## Installation\n\nRequires Python 3.6 or later. Does not work with Python 2.\n\n```bash\ngit clone https://github.com/bulletmark/wcscheduler.git\ncd wcscheduler\npython3 -m venv .venv\n.venv/bin/pip install -r requirements.txt\n```\n\nThe above will install\n[`wccontrol`](https://github.com/bulletmark/wccontrol/) in your local `.venv/`\ndir but you then need to follow the instructions to [make the GPIO\naccessible](https://github.com/bulletmark/wccontrol#make-gpio-device-accessible) and then to [program the switches](https://github.com/bulletmark/wccontrol#groups-and-addresses).\n\nBe sure to set up the `gpio` group and `udev` rules etc as described and\nalso program the switch groups and addresses. Run `.venv/bin/wccontrol`\nfrom within your `wcscheduler` dir to program the switches.\n\n## Configuration\n\nCopy the sample\n[`wcscheduler.conf`](https://github.com/bulletmark/wcscheduler/blob/master/wcscheduler.conf)\nconfiguration file to `~/.config/wcscheduler.conf` and then edit the\nsample settings in that target file to your requirements. You can add\nmultiple on/off times for multiple devices as described by the comments in\nthat file.\n\n```sh\ncp wcscheduler.conf ~/.config/\nvim ~/.config/wcscheduler.conf\n```\n\n### Setting times based on Sunrise and/or Sunset\n\nYou can set absolute on and off times, or you can set times based on\n[sunrise and sunset](https://sunrise-sunset.org/) events, with a +/-\ndelay, for a location. A location is specified as a latitude and\nlongitude pair of coordinates. See the instructions in the [sample\nconfiguration\nfile](https://github.com/bulletmark/wcscheduler/blob/master/wcscheduler.conf).\nSunrise and Sunset times are fetched from the free [Sunrise Sunset\nAPI](https://sunrise-sunset.org/api).\n\n## systemd Configuration for Auto Start etc\n\nCopy the included\n[`wcscheduler.service`](https://github.com/bulletmark/wcscheduler/blob/master/wcscheduler.service)\nto `/etc/systemd/systemd/` and edit the `#TEMPLATE#` values within that\ntarget file:\n\n```sh\nsudo cp wcscheduler.service /etc/systemd/systemd/\nsudoedit /etc/systemd/systemd/wcscheduler.service\n```\n\nThen:\n\n```sh\nsudo systemctl enable wcscheduler\nsudo systemctl start wcscheduler\n```\n\nIf you change the configuration then restart with:\n\n```sh\nsudo systemctl restart wcscheduler\n```\n\nTo see status and logs:\n\n```sh\nsystemctl status wcscheduler\njournalctl -u wcscheduler\n```\n\n## IFTTT Webhook Configuration\n\nYou can set up an [IFTTT](https://ifttt.com/) webhook applet e.g. which\ncan be trigged by Google Assistant (V2) to switch your devices remotely by\nvoice command from your phone or from a Google home device. Configure a\n[IFTTT](https://ifttt.com/) webhook POST JSON command with _webhook_ and\n_action_ keys in the body as a minimum. You can also include the\n_created_ key which can be used to time contrain the message (see the\ncomments about `webdelay` in\n[`wcscheduler.conf`](https://github.com/bulletmark/wcscheduler/blob/master/wcscheduler.conf)).\nThe _webhook_ key must match the `webhook` name you configure in the\ncorresponding `outputs` section of your `~/.config/wcscheduler.conf`.\nE.g.:\n\n```json\n{\n  \"webhook\": \"webhook_name\"\n  \"action\": \"{{SceneName}}\",\n  \"created\": \"{{ActivatedAt}}\",\n}\n```\n\nAs required for Google Assistant V2 integration with IFTTT, if you want\nto switch a light on and off then you will need 2 web hooks, one for\nGoogle Assistant scene \"Activate Lights On\" and another for scene\n\"Activate Lights Off\". Both will be configured with the same JSON post\ndata and the _SceneName_ will convey the desired action by containing\none of the words `on`, `enable`, `set`, `true`, or `yes` to activate the\nfunction (any case), and not one of those words to de-activate the\nfunction.\n\nBe sure to specify `webport` in `~/.config/wcscheduler.conf` for the\nport for the web server to listen on and receive JSON POST messages. If\n`webport` is not set, or there are no `webhook` values set for any\n`outputs`, then the internal web server will not be started. A typical\nhome user will need to forward the port from their internet router to\nthe Raspberry Pi running this application.\n\n## Command Line Usage\n\nType `wcscheduler -h` to view the following usage summary:\n\n```\nusage: wcscheduler [-h] [-c CONFIG] [-C]\n\nProgram to schedule control of Watts Clever switches.\n\noptions:\n  -h, --help            show this help message and exit\n  -c CONFIG, --config CONFIG\n                        alternative configuration file\n  -C, --no-cache        do not use sunset/rise API cache\n```\n\n## License\n\nCopyright (C) 2019 Mark Blakeney. This program is distributed under the\nterms of the GNU General Public License.\nThis program is free software: you can redistribute it and/or modify it\nunder the terms of the GNU General Public License as published by the\nFree Software Foundation, either version 3 of the License, or any later\nversion.\nThis program is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General\nPublic License at \u003chttps://www.gnu.org/licenses/\u003e for more details.\n\n\u003c!-- vim: se ai syn=markdown: --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbulletmark%2Fwcscheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbulletmark%2Fwcscheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbulletmark%2Fwcscheduler/lists"}