Skip to content

Instantly share code, notes, and snippets.

@tedivm
Created October 16, 2023 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tedivm/cc48e5b57f2bbc2ce1adbf5db20e86b5 to your computer and use it in GitHub Desktop.
Save tedivm/cc48e5b57f2bbc2ce1adbf5db20e86b5 to your computer and use it in GitHub Desktop.
Home Assistant Dimmer Switch Blueprint
blueprint:
domain: automation
name: Rob's Dimmer Blueprint
description: Dimmer Controls
input:
controller_entity:
name: Philips Hue v2 Smart Dimmer Switch and Remote
description: The action sensor of the dimmer to use for the automation.
selector:
entity:
domain: sensor
area:
name: Areas
description: Lights in these zones will be controlled.
selector:
area:
multiple: true
hue_action:
name: Hue Action
description: Action to run when hitting the Hue button.
default: []
selector:
action:
trigger:
- platform: event
event_type: state_changed
event_data:
entity_id: !input controller_entity
condition: []
action:
- variables:
trigger: "{{ trigger.event.data.new_state.state }}"
- choose:
- conditions:
- condition: template
value_template: "{{ trigger == 'on_press' }}"
sequence:
- service: light.toggle
target:
area_id: !input area
- conditions:
- condition: template
value_template: "{{ trigger == 'up_press' }}"
sequence:
- service: light.turn_on
data:
brightness_step_pct: 5
target:
area_id: !input area
- conditions:
- condition: template
value_template: "{{ trigger == 'down_press' }}"
sequence:
- service: light.turn_on
data:
brightness_step_pct: -5
target:
area_id: !input area
- conditions:
- condition: template
value_template: "{{ trigger == 'off_press' }}"
sequence: !input hue_action
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment