Zigbee2MQTT Lutron Aurora Dimmer Control

I got it to work, I found that my MQTT payload was VERY different than everyone’ else.

I just moved over to Z2M last week and set up a few automations with this blueprint and with a few Luron Auroras. The last 2 nights two of them have been triggered around 3 AM without me touching the device but when i Look in my log it shows the automation being triggered. I haven’t touched either dimmer in over 48 hours. Anyone run into this? I’ve disabled the automatons as it turned my bedroom lights to 100% at 3 AM and woke me up 2 nights in a row smh.

I had to set the devices to legacy inside Z2M settings

The bluepriint installed just fine but thus far I have not been able to get it to work. I have deleted and re-added the auroras a couple of times to Z2M but no go. I have turned the legacy setting on/off to see if that is the issue but it has not helped. I see the most recent post was last Novemeber so perhaps something has changed in HA (would love to hear from someone who currently has this running). Not a big deal for me, but my wife, who will likely never go anywhere near HA, asked how she can turn the bedroom lights on 100% when she needs light to do something. So, to keep her happy trying to get this to work. Any help would be appreciated.

I was able to set this up and it was running fine but then my system had to reboot and since that reboot the blueprint won’t work, is there any way to fix this?

I seemed to need to reboot my Zigbee2Mqtt instance after adding the legacy: false setting.

It wasn’t entirely clear above how to add it. There doesn’t seem to be a UI for it. Wherever you have Zigbee2Mqtt installed, you should have a configuration.yaml file. Edit that and under each dimmer instance, add legacy: false. Then restart the Docker container.

nano ~/data/zigbee2mqtt/configuration.yaml

devices:
  '0xffff000fe7fc88b5':
    friendly_name: Main-Bedroom/Aurora-Dimmer
    legacy: false

docker container restart $(docker container ls | grep koenkk/zigbee2mqtt | awk '{print $1}')

Then the blueprint worked for me. Thank you very much.

I wanted to share my experience…I’m running HA 2023.12 and Zigbee2MQTT AddOn 1.34 with legacy set to false for this dimmer).

After some work, I got the Blueprint to work as is without any changes. But what I found was that the HA dimmer sensors provided by z2m via mqtt discovery did not work with this Blueprint. I had to create a new MQTT sensor to get this Blueprint to work.

-----Some Details ------

For the “action” sensor created by z2m, when pushing the button on the Aurora device (named “Fireplace Dimmer”), the event on the event does not have attributes “action_level”, nor “action_transition_time” that are needed for the Blueprint:

event_type: state_changed
data:
  entity_id: sensor.fireplace_dimmer_action
  old_state:
    entity_id: sensor.fireplace_dimmer_action
    state: ""
    attributes:
      icon: mdi:gesture-double-tap
      friendly_name: Fireplace Dimmer Action
    last_changed: "2023-12-16T23:14:17.278622+00:00"
    last_updated: "2023-12-16T23:14:17.278622+00:00"
    context:
      id: 01HHTEHDHY868MNY8CQ9RWJQZ7
      parent_id: null
      user_id: null
  new_state:
    entity_id: sensor.fireplace_dimmer_action
    state: brightness_move_to_level
    attributes:
      icon: mdi:gesture-double-tap
      friendly_name: Fireplace Dimmer Action
    last_changed: "2023-12-16T23:15:09.993142+00:00"
    last_updated: "2023-12-16T23:15:09.993142+00:00"```

Looking at the z2m MQTT discovery that creates the “action” sensor the config only specifies “state” but there are no “attributes” such as “action”, “action_level”, nor “action_transition_time” that are defined:

availability:
  - topic: zigbee2mqtt/bridge/state
    value_template: '{{ value_json.state }}'
device:
  identifiers:
    - zigbee2mqtt_0xffff000fe7fee53b
  manufacturer: Lutron
  model: Aurora smart bulb dimmer (Z3-1BRL)
  name: Fireplace Dimmer
  sw_version: '3.8'
enabled_by_default: true
icon: mdi:gesture-double-tap
name: Action
object_id: fireplace_dimmer_action
origin:
  name: Zigbee2MQTT
  sw_version: 1.34.0
  support_url: https://www.zigbee2mqtt.io
state_topic: zigbee2mqtt/Fireplace Dimmer
unique_id: 0xffff000fe7fee53b_action_zigbee2mqtt
value_template: '{{ value_json.action }}'
platform: mqtt

which explains why the necessary attributes on the event bus are missing.

The way I was able to get this to work was to create a new MQTT sensor that makes use of the topic and its payload that z2m sends out. Here is an example of the topic and payload that z2m sends out:

zigbee2mqtt/Fireplace Dimmer {"action":"brightness_move_to_level","action_group":64821,"action_level":0,"action_transition_time":0.07,"brightness":null,"linkquality":116,"update":{"installed_version":3080,"latest_version":3080,"state":"idle"},"update_available":null}

Here is the config for the mqtt sensor I created:

  sensor:                                               
    - name: "Fireplace Dimmer"                                           
      unique_id: "195866949"
      state_topic: "zigbee2mqtt/Fireplace Dimmer"  
      value_template: "{{ value_json.action }}"
      json_attributes_topic: "zigbee2mqtt/Fireplace Dimmer"
      json_attributes_template: "{{ value_json | tojson }}"

The attributes created by {{ value_json | tojson }} are dynamic and come and go or change on each receipt of the z2m mqtt payload but allows “action_level” and “transition"time” to show up.

With this new sensor, the event bus now has the necessary attributes that work with the Blueprint:

event_type: state_changed
data:
  entity_id: sensor.fireplace_dimmer
  old_state:
    entity_id: sensor.fireplace_dimmer
    state: ""
    attributes:
      action: ""
      brightness: null
      linkquality: 47
      update:
        installed_version: 3080
        latest_version: 3080
        state: idle
      update_available: null
      friendly_name: Fireplace Dimmer
    last_changed: "2023-12-16T23:14:17.278535+00:00"
    last_updated: "2023-12-16T23:14:17.278535+00:00"
    context:
      id: 01HHTEHDHY6JE2JFSF0VN87PQV
      parent_id: null
      user_id: null
  new_state:
    entity_id: sensor.fireplace_dimmer
    state: brightness_move_to_level
    attributes:
      action: brightness_move_to_level
      action_group: 64821
      action_level: 255
      action_transition_time: 0.07
      brightness: null
      linkquality: 40
      update:
        installed_version: 3080
        latest_version: 3080
        state: idle
      update_available: null
      friendly_name: Fireplace Dimmer
    last_changed: "2023-12-16T23:15:09.992502+00:00"
    last_updated: "2023-12-16T23:15:09.992502+00:00"

Anyway, I don’t know if this is a problem for others, but that was what happened in my case.

1 Like

First, thank you for sharing this. I was just beating my head against the wall trying to get off of using only binding (I know the value for redundancy but for a variety of reasons I prefer to use HA)

Second, just for anyone else who can be an idiot like me, when it comes to adding the sensor it goes under “mqtt:” not under template or sensors or whatever else. I don’t have any other custom MQTT devices so it threw me off for a bit trying to find where it went. Also from what I know, unique_id can be whatever as long as it’s unique.

Here’s an example of a complete setup in your HA config file:

mqtt:
  - sensor:
    - name: "Dining Room Switch K MQTT"                                           
      unique_id: "1958669490006"
      state_topic: "zigbee2mqtt/Dining Room Switch K"  
      value_template: "{{ value_json.action }}"
      json_attributes_topic: "zigbee2mqtt/Dining Room Switch K"
      json_attributes_template: "{{ value_json | tojson }}"

Hi,

I’m a bit of a newb to this, but I’m getting the following error in relation to this automation:

Logger: homeassistant.components.automation.zigbee2mqtt_lutron_aurora_dimmer_control
Source: components/automation/__init__.py:669
integration: Automation (documentation, issues)
First occurred: 3:43:07 AM (1 occurrences)
Last logged: 3:43:07 AM

Error rendering variables: UndefinedError: 'dict object' has no attribute 'to_state'

And the following warning as well:

Logger: homeassistant.helpers.template
Source: helpers/template.py:2613
First occurred: 3:42:50 AM (37 occurrences)
Last logged: 3:45:48 AM

Template variable warning: 'homeassistant.helpers.template.Wrapper object' has no attribute 'action' when rendering '{{ attrs["action"] }}'
Template variable warning: 'homeassistant.helpers.template.Wrapper object' has no attribute 'action_level' when rendering '{{ attrs["action_level"] }}'
Template variable warning: 'homeassistant.helpers.template.Wrapper object' has no attribute 'action_transition_time' when rendering '{{ attrs["action_transition_time"] }}'
Template variable error: 'dict object' has no attribute 'to_state' when rendering '{{ trigger.to_state.attributes }}'

Any idea how to fix? I added the entry to my config similar as to how Robert did it in the message above mine.

This works…

1.) Import blueprint from drinfernoo

2.) Make a new sensor referencing wmaker’s post. You can either make a separate yaml or include it directly in your configuration.yaml. Use the file editor add-on to make your life easier.

# Custom Additions:
# You can uncomment the line below and optionally place the sensor below
# inside of sensor.yaml - it's up to you!
#sensor: !include sensor.yaml

mqtt:
  sensor:
    - name: "Switch_Lutron-Aurora-1"
      unique_id: "0xffff000fe7fb806b"
      state_topic: "zigbee2mqtt/Switch_Lutron-Aurora-1"
      value_template: "{{ value_json.action }}"
      json_attributes_topic: "zigbee2mqtt/Switch_Lutron-Aurora-1"
      json_attributes_template: "{{ value_json | tojson }}"

3.) When you create the automation from the blueprint use the new sensor you just created (name above) and NOT the action or brightness entities.

4.) Voila! Click for on/off. Turn to dim. Only minor caveat, the dimming isn’t very graceful. But it works!

I think I was able to fix the stuttery dimming by adding a transition to setting the brightness of the light. Using the 0.02 transition timing (that the aurora uses) wasn’t great, but using something like 0.2 is much more appealing. It’s a bit laggy, but you can tune that time to balance between smoothness and laginess.

This no longer seems to be working in Z2M 2.0.0 even with the custom sensor from wmaker’s post.

I ended up binding my dimmers to the lights and light groups in Z2M. Seems to be more responsive that way too.

Yeah I haven’t gotten around to fixing this with the new 2.0.0 upgrade.
In the meantime, can you provide a writeup of how you did the binding?

I’m having my people flip on legacy until I fix mine so everything still works as before. I’m going to use the event entity method If I can make it work. I won’t use devices if I can help it. FYI.

How did you do this?
I tried something per page 5 of the Advanced Install Guide of Aurora, and while controlling the light on and off works perfectly, the brightness value of the light and the dimmer - at least per z2m - are not in sync.

Chances are this works best if the dimmers and lights are the same mfgr. Not all combinations will bind well.

However Lutron, who makes this Aurora dimmer, does not make any smart bulb… so “the same manufacturer” would not be possible.

Then if you are lucky it will work, if not it won’t.
Mine have never worked.

I’ve been playing around with the event entity, (one has to first enable Z2M’s Home Assistant experimental event entities).

I haven’t been able to get a trigger to fire. I’m kinda thinking there is a bug.

The event entity lists the possible event types and the only one is:

brightness

Yet when I push the Aurora button, I get an error log saying

WARNING (MainThread) [homeassistant.components.mqtt.event] Invalid event type brightness_move_to_level for event.
fireplace_dimmer_action received on topic zigbee2mqtt/Fireplace Dimmer, payload {"event_type":"brightness_move_to_level"}

So I think Z2M is telling HA via autodiscovery that only brightness is supported, yet Z2M is instead sending brightness_move_to_level

Actual triggers are straight forward. Brightness, don’t know. Look in

Open your Home Assistant instance and show your event developer tools.

for that event and see what is available in the data. It’s probably something there.