My 5 favorite useful smart home automations for Home Assistant
You can use the full power of your smart devices by making them all work together and add automations to get rid of reoccurring tasks. I use open source software (currently Home Assistant) to automate all my devices and built a lot of automations for them overtime. These are my 5 favorite ones – and how you can use them too.
Where possible I will add links to my blueprints (a very simple way to add automations in Home Assistant) or the code for the automations for you. There are also links to the hardware I used throughout the article. They are affiliate links, please use them if you are looking to build a similar setup and want to support this blog.
Automatic lights
I can not stress enough how great automated lights are for me. I get really annoyed when I am somewhere else where I still need to press those boring light switches ;). Nearly all the lights in my apartment are triggered by motion sensors and turn on and off automatically. No intervention at all needed – just the automations.
The setup is described in all detail in my ultimate smart light setup. Basically I have smart Zigbee lightbulbs and small Aqara motion sensors. You can use the same automation with this blueprint in Home Assistant. This also checks the brightness (via the same motion sensors) and only turns the lights on if they are actually needed. After some delay & when no new motion is detected they are automatically turned off again.
Aqara motion sensor
CC2531 USB stick (preflashed or with a debugger) or Conbee II for ZHA/Z2MQTT
I have used ZHA and Zigbee2MQTT to different devices like the Aquara sensors, Hue bulbs and IKEA bulbs all with my Home Assistant controlled Zigbee network.
Changing brightness and color – adaptive lighting automations
Automated lights are a great start but in my smart light setup I have gone one step further. If you know f.lux or adaptive lighting from your PC or smartphone you know what can be done with your whole apartment: lights that change color and brightness to perfectly adapt to their environment. I do not want to get blinded by bright lights in the middle of the night. Instead my lights will fade to a more red tone and get less bright during the night. The next morning they will start turning more blueish white again and fade back to full brightness.
For this you do not need an automation. Instead there is a integration for Home Assistant called adaptive lighting. You can simply install it via the Home Assistant Community Store and configure your devices to your liking. I have two different setups for my Hue and my IKEA bulbs.
Hue white ambience light bulbs
IKEA Tradfri lightbulbs
or great looking Hue filament lights
adaptive_lighting:
- name: "Adaptive hue"
lights:
- light.bulb_bedroom_level_light_color_on_off
min_brightness: 65
max_brightness: 100
min_color_temp: 2000
max_color_temp: 5500
sleep_brightness: 30
take_over_control: true
detect_non_ha_changes: true
- name: "Adaptive default"
lights:
- light.bulb_bath_level_on_off
- light.bulb_hallway_level_on_off
- light.bulb_kitchen_level_on_off
- light.bulb_living_table_1_level_on_off
- light.bulb_living_table_2_level_on_off
- light.bulb_living_table_3_level_on_off
min_brightness: 30
max_brightness: 100
sleep_brightness: 10
take_over_control: true
detect_non_ha_changes: true
If you need more information on this you can also find the details in my ultimate smart light guide.
An automated vacuum clear
An automated vacuum cleaner robot is awesome! If set up properly you can forget most of the cleaning work and just do some hard to reach spots by hand from time to time. I have been using a great price to performance model, the Roborock S50, for quite some time now and it has worked nearly flawlessly.
The Roborock S5 Max is the successor of the Roborock I use
All I had to do was get rid of some initial problems. Adding a small bumper extension to the front of the robot and some small ramps to some high doorsteps fixed those quickly.
You can even integrate it in OpenHab or Home Assistant and control it from there. In this case I prefer to keep the automations very simple though. I just use the Xiaomi Home app to set up a cleaning schedule for the robot. Find some time of the day where you are not home (or not bothered by the noise) and set it to run every day of the week. Just be sure exclude the weekends if you have neighbors.
Water leak alarm – staying safe and dry
There are very few things more annoying (and expensive) then a faulty water line or washing machine flooding your apartment. Maybe I can not fully prevent it but at least I have a good change by getting an alarm on phone the second a sensor right next to my washer and dishwasher detects any water on the floor.
I used a small battery powered Aqara water sensor for this that sits on the floor right next to the machines. The automation is pretty simple: whenever the sensors notes and water I use a service called pushover to send a push message to my phone and create a notification in Home Assistant directly.
alias: Wasser Alarm
description: ''
trigger:
- type: moist
platform: device
device_id: abc123
entity_id: binary_sensor.lumi_lumi_sensor_wleak_aq1_ias_zone
domain: binary_sensor
condition: []
action:
- service: notify.pushover
data:
message: Der Wassersensor in der Küche hat angeschlagen!!
title: Wasser in der Küche!
data:
priority: 1
- service: notify.persistent_notification
data:
message: Der Wassersensor in der Küche hat angeschlagen!!
title: Wasser in der Küche!
mode: single
You can find all the details about the general setup as well as an automation for OpenHab in my post here.
Light switch 2.0
I added a lot of smart switches to my apartment. Not only can they be placed anywhere as they are powered by batteries, they can also be portable. Their greatest feature though is coming from their connection to the smart home system: they are not limited to one action (turning lights on and off), instead they can trigger a whole set of changes even depending on other factors like the time of the day. Even better: they also react to double and long presses.
Aqara single switch
Aqara double switch
Newer H1 version I have not yet used
Beside using them as a standard light switch that can be placed everywhere I also use them for more complex commands. I used to have one right next to my door that will switch off all the lights in the apartment at once and start the robot vacuum whenever I leave the house.
I have another one right now sitting next to my bed that has two different modes: a “get up” mode in the morning that opens my blinds and turns on the ceiling light and some LED lights in the room and a “reading” mode in the evening that closes the blinds, turns off all the lights in the apartment and turns on the reading light next to the bed.
alias: Button bedroom get up
description: ''
trigger:
- platform: event
event_type: zha_event
event_data:
device_ieee: 00:11:22:33:04:fa:66:9c
unique_id: 00:12:34:56:78:99:11:22:3:0x0012
command: left_double
condition:
- condition: state
entity_id: sun.sun
state: above_horizon
action:
- device_id: abc123
domain: cover
entity_id: cover.blinds_bedroom_window_covering
type: set_position
position: 100
- service: light.turn_on
data:
entity_id: light.bulb_bedroom_level_light_color_on_off
transition: 10
brightness_pct: 100
color_temp: 200
mode: single
Again the switches are cheap but powerful Aqara devices that I run via ZHA, that is why the trigger is a zha_event
here. It represents a double click on the left side of the button. It will only trigger during the day, when the sun is above the horizon. Opposed to that there is another automation to close the blinds in the evening. A similar one also control the lights as mentioned above.
alias: Button bedroom go to bed blinds
description: Only close the blinds if the window is closed
trigger:
-
platform: event
event_type: zha_event
event_data:
device_ieee: 00:11:22:33:04:fa:66:9c
unique_id: 00:12:34:56:78:99:11:22:3:0x0012
command: left_double
condition:
- condition: state
entity_id: sun.sun
state: below_horizon
- type: is_not_open
condition: device
device_id: 123adsvasr1123asdfasf1t2
entity_id: binary_sensor.lumi_lumi_sensor_magnet_aq2_06e1be06_on_off
domain: binary_sensor
action:
- device_id: acf09c09740a2aasdr23gq4zu5sdh44g
domain: cover
entity_id: cover.blinds_bedroom_window_covering
type: set_position
position: 0
mode: single