Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mitch-mcfarlane/ca65c4ccb641f1f5d22567dc91284b62 to your computer and use it in GitHub Desktop.
Save mitch-mcfarlane/ca65c4ccb641f1f5d22567dc91284b62 to your computer and use it in GitHub Desktop.
Blueprint for Lutron Aurora automations in ZHA. Toggles light on each button press
blueprint:
name: ZHA - Lutron Aurora Dimmer Automation Improved
description: 'Control lights with a Lutron Aurora Dimmer Pressing in the dimmer
button will toggle lights regardless of dimmer status. Rotating the dimmer will increase and decrease the light brightness.
Adjust the sensitivity if updates from the dimmer are being sent too quickly. Adds the ability to dim to off and disable the button. (The button is unreliable for most people.) Based on the great work of bjpetit and richlee91!'
domain: automation
input:
remote:
name: Lutron Aurora Dimmer Switch
description: Lutron Aurora Z3-1BRL
selector:
device:
integration: zha
manufacturer: Lutron
model: Z3-1BRL
entity:
domain: sensor
device_class: battery
light:
name: Light(s)
description: The light(s) to control
selector:
target:
entity:
domain: light
sensitivity:
name: Sensitivity
description: Reducing sensitivity will reduce rate of changes being sent to
lights
default: 3
selector:
number:
min: 1.0
max: 3.0
mode: slider
step: 1.0
dim_to_off:
name: Dim to off
description: When on, lights dim to off; when off lights dim to lowest setting
default: true
selector:
boolean:
button:
name: Button enabled
description: When on, the central toggle button is enabled
default: false
selector:
boolean:
source_url: https://gist.github.com/mitch-mcfarlane/ca65c4ccb641f1f5d22567dc91284b62
mode: restart
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input 'remote'
action:
- variables:
sensitivity_input: !input 'sensitivity'
dim_to_off_input: !input 'dim_to_off'
button_input: !input 'button'
selected_light: !input 'light'
dim_adjustment: "{% if dim_to_off_input %}2{% else %}0{% endif %}"
sensitivity: "{% if sensitivity_input == \"3\" %}\n 1\n{% elif sensitivity_input\
\ == \"2\" %}\n 5\n{% else %}\n 15\n{% endif %} \n"
prior_brightness: '{{ brightness | default }}'
command: '{{ trigger.event.data.command }}'
brightness: '{{ ((trigger.event.data.args[0]|int)-dim_adjustment) / (sensitivity|int) * (sensitivity|int)
}}'
presstype: '{{ (trigger.event.data.args[1]|int) }}'
- choose:
- conditions:
- '{{ command == ''move_to_level_with_on_off'' }}'
- '{{ brightness != prior_brightness }}'
- '{{ presstype == 2}}'
sequence:
- service: light.turn_on
target: '{{ selected_light }}'
data:
brightness: '{{ brightness }}'
- conditions:
- '{{ command == ''move_to_level_with_on_off'' }}'
- '{{ brightness != prior_brightness }}'
- '{{ presstype == 7}}'
- '{{ button_input == true }}'
sequence:
- service: light.toggle
target: '{{ selected_light }}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment