[Hobby] Morning alarm with Apache Airflow DAG
My first Airflow DAG
2 min readSep 8, 2021
Following Directed Acyclic Graph(DAG) is built to wake me up gracefully
- First node in the following DAG blinks two of my bedroom Philips Hue lights. At the very end, the node leaves the lights in a dim state.
- Second node sleeps for about 30 seconds(configurable) so that light stays dim and this routine isn’t all that annoying :)
- Next two nodes essentially repeat the first two steps. This gives me enough time to wake up.
- The last node sets maximum brightness and exits the DAG workflow.
Note: For this process to be effective, please do not have any voice assistant in your bedroom. You may turn off the lights and this routine won’t be effective anymore :)
Technical Details
- Programmed Phillips Hue API endpoints to change states of the bedroom lights.
- It is quite easy to plugin python functions into Airflow DAG. Kindly refer the following code snippet to get a feel of ease of integration.
Future plans: Add node to the DAG to have preferred wake up tone. Currently the schedule executes daily but would want it to run only on Weekdays.