Feel free to use whatever you find here for your own Home Assistant or other home automation.
Includes automations for the following use cases:
- ⚡ smart lights:
- Changing color temperature automatically based on time of day and of year 🐍
- Turning lights on and off based on motion 🐫
- Multi-stage wake-up light sequence, interruptable 🐫
- Turning lights off while away from home 🐫
- Putting lights in vacation mode, prompted when an appropriate calendar event is detected 📆 🐫
- other:
I use the following components to implement this
- 1 Raspberry Pi 4B 4GB with Home Assistant OS
- 1 WD Green 2.5" SATA SSD 120GB, connected with a Startech USB 3.0 to SATA 2.5" adapter
- ⚡ Phoscon ConBee 2 Zigbee USB gateway
- ⚡ Zigbee devices:
- 10 IKEA Trådfri lights (not RGB, but white spectrum 2200 K to 4000 K)
- 6 IKEA Trådfri remotes with 5 buttons each
- 1 IKEA Trådfri wireless control outlet
- 1 IKEA TrådFri on/off remote
- 1 IKEA TrådFri motion sensor
- ⚡ deconz for Zigbee connection to smart lights, switch and buttons
- Telegram bot for 2-way communication, not limited to the local network
- 📱 The Home Assistant app for other notifications
- 📆 Google for the Calendar
- Standard HA YAML (rhymes with 🐫) still has many of my automations, but I intend to move the bigger ones to one of the other platforms:
-
Node-Red for flow-based automation
- Contains all functions of all ⚡ buttons
- 🐍 AppDaemon for more programmatic automation using Python
- Contains complex time logic
- and the programmatic update notification logic
- ⚡ The deconz instance for the Zigbee network
- Some utility add-ons:
- VS Code in front-end in browser
- Samba share for easy access to the machine file from Windows pc
Node-Red is a simple yet powerful flow-based automation framework, but sharing what you're doing with it on Github can be difficult, because the json format is not human-readable.
So I decided to take some screenshots of my flows, and show a bit of code.
I do 3 things with buttons: "normal" buttons that control lights, a button to set reminders next to the washing machine, and bedroom-specific things like turning off all lights in the evening, or interrupting the wake-up lights sequence in the morning.
Especially interesting to share in this, is the first node on the left. It contains the code I have pasted here and decouples the specific codes of the buttons from the logic of my automations.
This flow toggles and monitors an input_boolean
in HA to indicate whether the wake-up lights sequence is, and should be, in progress.
The total duration is set in another input in HA, and divided by the number of transitions of ⚡ bulbs to set the transition per bulb. At the end, a switch is used to turn on a very bright white light.
To get started with Home Assistant, and for the documentation, visit: https://www.home-assistant.io/getting-started/
To see how other people have been using Home Assistant, have a look at the forums: https://community.home-assistant.io/