A conditional execution system and scheduler. Pretty much a self-hosted IFTTT. There is (currently) no UI.
pipx install git+https://github.com/mikeshultz/dowhen.git
useradd dowhen
sudo -u dowhen bash
pipx install git+https://github.com/mikeshultz/dowhen.git
You may also want to configure a daemon. You can use the service file in this repo as a template.
# Service file location may be different depending on distro
curl -s https://raw.githubusercontent.com/mikeshultz/dowhen/master/ops/systemd/dowhen.service | sudo tee /usr/lib/systemd/system/dowhen-test.service
Create a configuration file at $HOME/.config/dowhen/dowhen.yaml with your
triggers. An example config file is
dowhen.yaml.example. Each trigger describes when to
fire and what to do when it fires.
For instance, to turn on a WeMo switch on sunrise:
---
triggers:
- when:
name: openweathermap.sunrise
args:
zip: 59801
do:
# Turn on plant lights
- name: wemo.on
args:
mac: "30:23:DE:AD:BE:EF"
Then you can run the daemon:
dowhen daemon
"When" modules act as triggers. They will signal when a condition is met. For instance, it will indicate the current time, or certain weather conditions have occurred.
The datetime When module will trigger on times and dates.
- daily
- hourly
- minutely
- time(time_string)
The openweathermap When module triggers on weather-based data.
- sunrise(zip)
- sunset(zip)
"Do" modules perform actions. For example, the Wemo Do module would do things like turn on and off Wemo switches.
The wemo Do module performs actions on Belkin Wemo devices.
- on(mac)
- off(mac)
- toggle(mac)