Bas Nijholt's Home Assistant config files
Using my iOS Light and Dark Mode Themes.
See also my guide for my girlfriend โค๏ธ.
Table of content
Noteworthy (useful) automations
See all my automations and its dependencies down the page!
- Alarm clock that uses the AppDaemon volume ramp and sunrise app โฐ
- Automatic
lovelace.json
tolovelace-ui.yaml
converter for version control ๐ค - Controlling music and lights (hue and brightness) using the Xiaomi Aqara Magic Cube โ
- Controlling the lights using Phillips Hue Dimmers the Xiaomi Aqara Smart Switches ๐
- Automated lights ๐ก
- Presence detection in different rooms based on various binary template sensors
- Robot vacuum automations ๐งน
- Arriving and leaving automations
- Notifications when the dishwasher or washing machine is done
- Time at work ๐ tracking and notifications to go home
- Using HA-Menu to control my speakers on my iMac
- Using home-assistant-macbook-touch-bar to control HA on my MacBook Pro's Touch Bar ๐ป
- Automatically switch Lovelace's theme between backgrounds and light/dark mode
- Sync volume TV โ speakers ๐
- Security notifications when the front door ๐ช has been open for too long or motion is detected when no one is home
My cool AppDaemon apps
- Sunrise emulator app ๐
- Wake up with Spotify app that slowly ramps the volume ๐ข
- Low Battery level notifications ๐
Popular Reddit posts of features in this config
(Sorted from new to old)
- Advanced control from my Apple Watch using single automations: setting lights, vacuum, temperature, sleep mode, and more!
- HA has it before Apple has even finished it, I present: Adaptive_lighting! flux/circadian_lighting fans (haters?) please try the new UI configurable component that stops automatically adjusting your lights when you make a manual change ๐ (and many more new useful features!)
- Creating useful notifications using the new 'variables' and 'wait_for_trigger' features
- Copying YAML from GitHub is easier than ever: my config's README now automatically lists all automations (and entities it uses) with links to the relevant parts in the YAML
- Beautiful iOS dark and light mode inspired themes with easy background switch (that now also change the top header color!) [OC]
- Finally a good use for the touch bar on my Macbook Pro!
- 100% control over my high fi speakers: a bidirectional synchronized equalizer
- COVID-19 forcing me to stay inside? Check out my "quarantine-o-meter" that displays how much time (in %) we've been inside.
- After a lot of love, a much-requested feature (+more!) for my iOS Dark Theme [OC]
- I can now sync the speaker volume using the menu bar of my iMac! [OC]
- I keep seeing my own theme on Reddit, so now it's my turn! [OC]
Ideas?
- Notify us when the window is open and it is raining.
- Add budget keeper using the Bunq API
My devices
Switches ๐ | Units (#) | Price per unit (โฌ) | Price (โฌ) |
---|---|---|---|
TP-Link HS110 | 1 | 35.84 | 35.84 |
Xiaomi Aqara Magic Cube | 1 | 11.08 | 11.08 |
Xiaomi Aqara Single Button | 4 | 14.35 | 57.38 |
Philips Hue Dimmer switch | 2 | 16.61 | 33.22 |
Total | ย | ย | 137.52 |
ย | ย | ย | ย |
Sensors ๐ก | Units (#) | Price per unit (โฌ) | Price (โฌ) |
Xiaomi Aqara Door Sensor | 4 | 8.18 | 32.71 |
Xiaomi Aqara Temperature Sensor | 5 | 9.15 | 45.74 |
Xiaomi Aqara Motion Sensor | 10 | 9.79 | 97.85 |
Xiaomi Aqara Vibration Sensor | 1 | 11.59 | 11.59 |
Xiaomi Mi Flora | 3 | 15.54 | 46.63 |
Total | ย | ย | 234.52 |
ย | ย | ย | ย |
Vacuum ๐งน | Units (#) | Price per unit (โฌ) | Price (โฌ) |
Xiaomi Mi Roborock S5 | 1 | 294.31 | 294.31 |
Total | ย | ย | 294.31 |
ย | ย | ย | ย |
Media player ๐บ๐ | Units (#) | Price per unit (โฌ) | Price (โฌ) |
KEF LS50 Wireless speakers | 1 | nan | nan |
KEF LSX speakers | 1 | nan | nan |
LG OLED 55 C9 | 1 | nan | nan |
ย | ย | ย | ย |
Lights ๐ก | Units (#) | Price per unit (โฌ) | Price (โฌ) |
Philips Hue E27 White and Color | 12 | 22.22 | 266.7 |
Philips Hue E14 White and Color | 2 | 34.88 | 69.77 |
Philips Hue GU10 Ambient White | 5 | 18.54 | 92.7 |
Philips Hue Go | 1 | 57.05 | 57.05 |
Philips Hue LED strip 2m | 2 | 43.2 | 86.39 |
Philips Hue LED strip 1m | 1 | 13.84 | 13.84 |
Total | ย | ย | 586.45 |
ย | ย | ย | ย |
Hubs ๐ | Units (#) | Price per unit (โฌ) | Price (โฌ) |
ConBee II | 1 | 39.95 | 39.95 |
Total | ย | ย | 39.95 |
ย | ย | ย | ย |
Server ๐ฅ | Units (#) | Price per unit (โฌ) | Price (โฌ) |
Intel NUC Kit NUC8i3BEH | 1 | 278.3 | 278.3 |
8 GB Crucial CT8G4SFS824A DDR4 | 2 | 25.52 | 51.04 |
Samsung 970 EVO M.2 500GB | 1 | 94.99 | 94.99 |
Raspberry Pi 4, 4GB RAM (connected to power/gas meter and connected over MQTT to main HA instance) | 1 | 70.9 | 70.9 |
Raspberry Pi 4 FLIRC Case | 1 | 25.85 | 25.85 |
SanDisk Ultra microSDHC Memory Card 32GB | 1 | 6.99 | 6.99 |
Total | ย | ย | 528.07 |
ย | ย | ย | ย |
Device tracker ๐ | Units (#) | Price per unit (โฌ) | Price (โฌ) |
iPhone X with the iOS app | 1 | nan | nan |
iPhone SE2 with the iOS app | 1 | nan | nan |
ย | ย | ย | ย |
Other | Units (#) | Price per unit (โฌ) | Price (โฌ) |
PlayStation Eye Webcam and Microphone array | 1 | 14.95 | 14.95 |
DSMR - Slimme Meter kabel | 1 | 19.95 | 19.95 |
Nodo-Shop โ OpenTherm Gateway (OTGW) with NodeMCU | 1 | 48.81 | 48.81 |
Total | ย | ย | 83.71 |
ย | ย | ย | ย |
Total | โฌ1904.53 |
Supervisor add-ons
I run a Supervised install with the following add-ons:
- Home Assistant Stream Deck version 2023.7.4 by @basnijholt
- Advanced SSH & Web Terminal version 15.0.5 by @hassio-addons
- AppDaemon version 0.13.3 by @hassio-addons
- Glances version 0.19.2 by @hassio-addons
- Grafana version 9.0.3 by @hassio-addons
- InfluxDB version 4.7.0 by @hassio-addons
- Log Viewer version 0.15.1 by @hassio-addons
- Studio Code Server version 5.10.0 by @hassio-addons
- phpMyAdmin version 0.8.7 by @hassio-addons
- Let's Encrypt version 4.12.9 by @home-assistant
- MariaDB version 2.6.1 by @home-assistant
- Mosquitto broker version 6.2.1 by @home-assistant
- Samba share version 10.0.2 by @home-assistant
- VLC version 0.2.0 by @home-assistant
- Home Assistant Google Drive Backup version 0.111.1 by @sabeechen
- Zigbee2MQTT version 1.32.2-1 by @zigbee2mqtt
Automations - Table of Content
- Adaptive lighting ๐๐ (3 automations)
- Alarm clock โฐ (1 automations)
- Apple Watch โ (12 automations)
- Arriving ๐ (1 automations)
- Bike ๐ฒ (2 automations)
- Climate ๐ฅ๐ฅถ (7 automations)
- Control switches ๐ (8 automations)
- Cube โ (2 automations)
- Doorbell ๐ช๐ (1 automations)
- Frontend ๐จโ๐ป (3 automations)
- Leaving ๐ (4 automations)
- Light ๐ก (29 automations)
- Lovelace ๐จโ๐ป (1 automations)
- Mailbox ๐ซ๐ฃ (1 automations)
- Media player ๐๐บ (7 automations)
- Music ๐ต (2 automations)
- Notifications ๐ (2 automations)
- Plant ๐ฑ (3 automations)
- Security ๐ฎ๐จ (6 automations)
- Night mode ๐๐ (5 automations)
- System ๐ฅ (7 automations)
- Test ๐งช (5 automations)
- Utilities ๐งบ๐๐ฝ (3 automations)
- Vacation mode ๐ (2 automations)
- Vacuum ๐งน (6 automations)
- Work ๐ผ (3 automations)
Adaptive lighting ๐๐
Turn on and off switches
which uses:
Reset manual_control after 1 hour
Notify manual_control
Alarm clock โฐ
Wake up with Spotify and light
which uses:
- input_boolean.alarm_clock
- input_boolean.wake_up_light
- input_boolean.wake_up_with_spotify
- input_select.sleep_mode
- sensor.ten_minutes_before_alarm
Apple Watch โ
Play or Pause the TV
Minimal lights bedroom
Fix TV sound
which uses:
Set sleep mode
which uses:
Set lights
which uses:
- script.cozy_lights_bedroom
- script.cozy_lights_living_room
- script.turn_on_lights
- script.white_lights_living_room
Temperature report
Portfolio value
Send vacuum cleaner
which uses:
Movie time
Reset adaptive lighting
which uses:
Set temperature
Where is other person?
Arriving ๐
Switch music from iPhone to speakers if no one is home
which uses:
Bike ๐ฒ
Started charging
which uses:
Stop charging
which uses:
Climate ๐ฅ๐ฅถ
Turn on the heating 30 min before waking up
which uses:
- input_boolean.alarm_clock
- input_boolean.automatic_temperature
- script.set_high_temperature
- sensor.half_hour_before_alarm
Turn on the heating when going home
which uses:
- input_boolean.automatic_temperature
- input_number.temperature_high
- script.set_high_temperature
- binary_sensor.no_one_home
Turn off the heating at 22:00
which uses:
- input_boolean.automatic_temperature
- input_number.temperature_low
- script.set_high_temperature
- script.set_low_temperature
- binary_sensor.no_one_home
Set outside temperature every hour
Warning when heating on and living room door open
which uses:
Set temperature setpoint to 50 ยฐC
Automatically turn off spaceheater when no-one is in the guest room
which uses:
Control switches ๐
Living room Philips Hue dimmer switch
which uses:
- input_select.last_script_living_room
- script.increase_brightness
- script.next_colors
- script.reset_adaptive_lighting
- script.white_lights_living_room
Bedroom Philips Hue dimmer switch
which uses:
- input_select.last_script_bedroom
- script.increase_brightness
- script.next_colors
- script.reset_adaptive_lighting
- script.white_lights_bedroom
Bedroom IKEA dimmer switch
which uses:
- input_boolean.guest_mode
- input_select.last_script_bedroom
- input_select.sleep_mode
- script.increase_brightness
- script.next_colors
- script.turn_off_everything
- script.white_lights_bedroom
Living room Aqara Wireless Mini Switch
which uses:
Bedroom Aqara Wireless Mini Switch
which uses:
- input_select.last_script_bedroom
- input_select.sleep_mode
- script.increase_brightness
- script.next_colors
- script.turn_off_everything
- sensor.ten_minutes_before_alarm
Bathroom Aqara Wireless Mini Switch
Door Aqara Wireless Mini Switch
which uses:
- script.arriving
- script.set_low_temperature
- script.start_spotify
- script.turn_off_everything_non_automatic
- sensor.favorite_playlist_of_nearest_person
Guest room IKEA Switch
Cube โ
Perform operation
which uses:
Rotate the cube
which uses:
Doorbell ๐ช๐
Click the button
Frontend ๐จโ๐ป
Turn on dark mode
which uses:
Turn on light mode
which uses:
Change theme
which uses:
Leaving ๐
Automatically turn off everything
which uses:
- input_boolean.guest_mode
- script.leaving
- binary_sensor.anything_on
- binary_sensor.no_one_home
- binary_sensor.someone_in_the_house_in_last_hour
Ask to turn off everything
which uses:
Turn off everything after notification
which uses:
Downstairs Aqara Wireless Mini Switch
which uses:
Light ๐ก
Turn on living room
which uses:
Turn off living room
which uses:
Toggle dinner area lights
which uses:
- input_boolean.automatic_dinner_area_light
- input_boolean.guest_mode
- input_select.sleep_mode
- binary_sensor.activity_in_dinner_area
Turn off automatic dinner area lights when turning off lights after 18:00
which uses:
Reset automatic dinner area lights at 06:00
which uses:
Turn on kitchen counter if sleep mode is off
which uses:
Turn off kitchen counter
which uses:
Reboot kitchen ceiling Shelly
which uses:
Turn on bathroom
which uses:
Turn off bathroom
which uses:
Turn on hall
which uses:
Turn off hall
which uses:
Automatically turn on the bedroom
which uses:
- input_boolean.automatic_bedroom_lights
- input_boolean.bedroom_lights_automatically_turned_on
- input_select.sleep_mode
- script.turn_on_lights
- binary_sensor.activity_in_master_bedroom
Automatically turn off the bedroom
which uses:
- input_boolean.automatic_bedroom_lights
- input_boolean.bedroom_lights_automatically_turned_on
- binary_sensor.activity_in_master_bedroom
Turn off bedroom lights auto switch
which uses:
Turn on automatic_bedroom_lights switch
which uses:
Turn off bedroom after 2 hours of inactivity
which uses:
Reboot bedroom ceiling Shelly
which uses:
Update input_select when bedroom lights turned off
Set the input_select.last_script_bedroom such that colored lights will be chosen
which uses:
Turn on utility room / garage outside
which uses:
- binary_sensor.activity_in_utility_room
- binary_sensor.activity_outside_front_door
- binary_sensor.activity_outside_garage
Turn off utility room / garage outside
which uses:
- binary_sensor.activity_in_utility_room
- binary_sensor.activity_outside_front_door
- binary_sensor.activity_outside_garage
- binary_sensor.activity_outside_house
Toggle guest room
which uses:
Toggle baby room
which uses:
Turn off guest room (extra check)
In case the other automation failed
which uses:
Turn off baby room (extra check)
In case the other automation failed
which uses:
Turn off bedroom (extra check)
In case the other automation failed
which uses:
- input_boolean.automatic_bedroom_lights
- input_boolean.bedroom_lights_automatically_turned_on
- binary_sensor.activity_in_master_bedroom
Turn off utility room / garage (extra check)
In case the other automation failed
which uses:
- binary_sensor.activity_in_utility_room
- binary_sensor.activity_outside_front_door
- binary_sensor.activity_outside_garage
Update Zigbee2MQTT lights input_select options
which uses:
Update Zigbee2MQTT Lights State
Refresh the state of all Zigbee2MQTT lights
which uses:
Lovelace ๐จโ๐ป
Convert lovelace.json to lovelace-ui.yaml
which uses:
Mailbox ๐ซ๐ฃ
The mailbox was opened
In the UI show the input_boolean.mailbox_full
. It needs to
be manually switched off after getting the mail."
which uses:
Media player ๐๐บ
Turn on Opt when TV is on and Spotify is not playing and not Usb
The speaker is connected via an optical cable to the TV. Whenever the speakers aren't playing Spotify (via WiFi) directly, switch the source of the speakers to "Opt".
Turn off speakers when turning off TV
If speakers off and TV on, turn on the speaker on TV state change
Update Spotify entity when TV is on every 5 seconds
Sync KEF LS50 and TV volume
Automatically turn off TV and Xbox after two hours of inactivity
Turn On Living Room TV with WakeOnLan
Music ๐ต
Start playlist
which uses:
Switch music from iPhone to speakers if coming home
which uses:
Notifications ๐
Marcella arrived at Rotterdam Centraal
Front door has opened
which uses:
Plant ๐ฑ
Problem with Calathea
which uses:
Problem with Monstera
which uses:
Problem with Peace lily
which uses:
Security ๐ฎ๐จ
Motion detected but we are not home
which uses:
Front door has been open for more than 5 minutes
Utility room door has been open for more than 5 minutes
No one is home but high power usage
which uses:
Bathroom door has opened
which uses:
Door to outside open
which uses:
Night mode ๐๐
Automatically turn off when alarm turns off or at 7AM
which uses:
Turn off automatic bedroom lights
which uses:
Set low temperature when sleep mode turns on
which uses:
Go from half to total sleeping mode
When it is half sleeping mode and there is no activity in the house for more than an hour go to total sleeping mode.
which uses:
Set sleeping mode in the living room
Set the living room lights to sleep mode only when no-one is there anymore.
which uses:
System ๐ฅ
Warning about high CPU usage
Warning about high CPU temperature
Warning about high Xbox temperature
Update DNS
Update the DNS at Gandi to point my domain to my Home Assistant instance.
which uses:
Run chores
Run shell and Python scripts in utils folder.
which uses:
MQTT sensors are not updating
Check whether we are receiving messages over MQTT from my other HA instance.
Battery level low
Test ๐งช
Listen to Adaptive Lighting events
Time
Flash lights
Call update_entity after light.turn_on/turn_off
Light Baby Room Loop
Utilities ๐งบ๐๐ฝ
Washing machine or dishwasher started or finished
which uses:
Washing machine notification
which uses:
Dishwasher notification
which uses:
Vacation mode ๐
Auto turn on
which uses:
Auto turn off
which uses:
Vacuum ๐งน
Started cleaning
which uses:
Stopped cleaning
which uses:
Reminder notification
which uses:
Cleanup if nobody is home
which uses:
- input_boolean.cleaned_today
- input_boolean.guest_mode
- input_boolean.vacation_mode
- binary_sensor.vacuum_day
- group.persons
Reset cleaned today
which uses:
Reset to standard mode
Work ๐ผ
Go home notification
which uses:
Reset input_boolean at midnight
which uses: