Use a Hue Dimmer Switch to Open and Close Blinds and Curtains via a Home Assistant Automation
The problem with a lot of automated curtain and blind controllers is that once you fit them you are no longer able to open or close them with their traditional methods. The last thing you want is a visitor or guest breaking your smart curtains by tugging on them!
To make my house a bit more Guest Friendly I paired a Hue Dimmer Switch to Home Assistant and use the Brighter and Dimmer buttons to open and close the blinds. If I press the On/Off button it will stop the blinds where they are at that moment.
To make this automation work you need:
A working Home Assistant installation
A Hue Dimmer Switch paired with Home Assistant via Zigbee
Some automated curtain or blind controllers set up in Home Assistant as Cover entities
Trigger
This automation has three triggers, one for each of the button presses. Each trigger has its own Trigger ID so that the Action knows what to do based on the button that was pressed.
The three buttons are the up, down and on buttons. I match the Trigger ID to be the same as the button press name.
Trigger ID | Corresponding Button on Hue Switch |
up_press | Increase Brightness button |
down_press | Decrease Brightness button |
on_press | Power button on the top of the switch |
Action
This automation uses a Choose action to do different actions depending on which button was pressed. The action knows what button is pressed based on the Trigger ID we set in the Trigger.
The first Option uses the Trigger Condition to check if the Trigger ID was up_press. This signifies that the Up (or Increase Brightness) button was pressed.
If that is the case, it will call the cover.open_cover service to open the Bedroom Blind.
There are two more options that work similarly for the down_press and on_press Trigger IDs, but they call the cover.close_cover and cover.stop_cover services respectively.
Full automation in YAML
Please note that the devices IDs are specific to my installation, you will need to choose the correct device from the dropdown list in your environment.
alias: 'Blind: Bedroom Hue Dimmer Switch'
description: ''
trigger:
- platform: device
domain: mqtt
device_id: 1ac403fe6d3ac05f9fed41d86c3278e5
type: action
subtype: up_press
discovery_id: 0x0017880109a5a8ee action_up_press
id: up_press
- platform: device
domain: mqtt
device_id: 1ac403fe6d3ac05f9fed41d86c3278e5
type: action
subtype: down_press
discovery_id: 0x0017880109a5a8ee action_down_press
id: down_press
- platform: device
domain: mqtt
device_id: 1ac403fe6d3ac05f9fed41d86c3278e5
type: action
subtype: on_press
discovery_id: 0x0017880109a5a8ee action_on_press
id: on_press
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: up_press
sequence:
- service: cover.open_cover
target:
entity_id: cover.bedroom_blind_motor
- conditions:
- condition: trigger
id: down_press
sequence:
- service: cover.close_cover
target:
entity_id: cover.bedroom_blind_motor
- conditions:
- condition: trigger
id: on_press
sequence:
- service: cover.stop_cover
target:
entity_id: cover.bedroom_blind_motor
default: []
mode: single