Lutron Aurora Dimmer Z3-1BRL Blueprint Assistance

I could use some help with the Lutron Aurora Dimmer Z3-1BRL that I recently picked up and have been fighting with ever since.

Hardware:

  • SONOFF ZBDongle-E Zigbee 3.0 USB gateway (fully updated) via ZHA
  • Lutron Aurora Dimmer (I do not have a Hue Hub to update it)
  • Globe Electric WiFi RGBWW Smart light

I originally found bjpetit’s blueprint for the dimmer, which ‘mostly’ worked. I could use the dimmer to turn on the light and set the brightness. Unfortunately the light could not be turned off or even have the brightness set below 2%. Receiving input from the toggle button rarely happened. After a bit more digging I found richlee91’s blueprint but ultimately had similar results.

I found a ZHA custom quirk for the dimmer by BRCook. This has dramatically improved the toggle/push button response, but the blueprints found previously began generating errors regarding args indexing whenever the button was pressed. This is due to the quirk changing some things in the resulting json. Dug around the net some more and found nschwermann’s post with an “adaptive” blueprint, which sadly had mixed results like the previous.

With that out of the way, I do “sort of” have the dimmer working after modifying the last blueprint to work with the quirk for the push/toggle button. Of course there are some issues, otherwise I wouldn’t be asking for help haha!

Anyways, the first issue was seen with all of the previous attempts to make this dimmer work. And that issue is with the brightness randomly going dimmer or brighter WHILE you are spinning the dimmer to adjust the brightness.

The second issue is also with the brightness adjustment, and to put it simply, the transition between brightness levels is not smooth. While this is not a deal breaker it would be nice to fix.

The third issue, (and last so far), is with the push/toggle button. While it is more consistent, it does randomly trigger multiple times with a single press or doesn’t trigger at all.

Based on everything I’ve done so far to get to this point, I believe these issues could be resolved by adjusting the blueprint (posted below). That is where I am hoping to get some assistance.

blueprint:
  name: ZHA - Lutron Aurora Dimmer - Test
  description: 'Control lights with a Lutron Aurora Dimmer
    Pressing in the dimmer button will toggle between turning lights on
    to full brightness, and turning the lights off.
    Rotating the dimmer will increase and decrease the light brightness.
    
    Adjust the sensitivity if updates from the dimmer are being sent too quickly
    
    Heavily based on works of bjpetit, richlee91 and nschwermann'
  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
mode: restart
max_exceeded: silent
trigger:
- platform: event
  event_type: zha_event
  event_data:
    device_id: !input 'remote'
action:
- variables:
    sensitivity_input: !input 'sensitivity'
    selected_light: !input 'light'
    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) / (sensitivity|int) * (sensitivity|int) }}'
- choose:
  - conditions:
    - '{{ command == ''move_to_level_with_on_off'' }}'
    #- '{{ brightness != prior_brightness }}'
    sequence:
    - service: light.turn_on
      target: '{{ selected_light }}'
      data:
        brightness: '{{ (trigger.event.data.args[0]|int) / (sensitivity|int) * (sensitivity|int) }}'
  - conditions:
    - '{{ command == ''aurora_toggle'' }}'
    sequence:
    - service: light.toggle
      target: '{{ selected_light }}'
    - service: system_log.write
      data:
        message: "{{ expand(selected_light) }}"
        level: info

TL;DR
I’m a complete newbie to blueprints as well as working with ZigBee devices/events and could use some constructive critique on the blueprint I’m using.

Side Note: I haven’t posted or logged in enough to post more than 2 links, so I’ve only included what I feel are the 2 more relavent links.

Oh, and for some reason the bit at the end;

    - service: system_log.write
      data:
        message: "{{ expand(selected_light) }}"
        level: info

doesn’t seem to output to any of the log files.

Since I wasn’t sure what firmware version the Aurora Dimmer was running I picked up a used Hue Hub for pretty cheap. Confirmed it is on 3.8 | 1144-0, though I’m not sure the last part is needed. At the moment it is attempting to update and I will see if it makes any improvements.

Part of the dimming smoothness was a result of a setting on the light itself.
To put it bluntly, the light being controlled was flashed over to Tasmota, and I had not changed the DimmerStep value. It was still set to 10, out of a range of 1-50, and setting this to 1 has improved the dimming a little bit. Its not perfect, but it’ll do for now.

I still haven’t figured out how to stop the issue of it registering multiple presses or sometimes not registering at all. I thought about seeing if I could add software debouncing to the template but the dimmer (or HomeAssistant or even ZHA) doesn’t register a “last_changed” state. Even disabling the zha quirk for it doesn’t reveal a “last_changed” state.