Making use of Lutron Aurora using MQTT payload to control light group

I’m currently using a Lutron Aurora zigbee dial. It can either rotate left, rotate right, or be clicked. I’m using Zigbee2MQTT, and trying to use the dial to smoothly adjust a Zigbee light group I’ve defined in Z2M. But here are the issues:

1.) The Lutron Aurora’s MQTT payload does not make it clear which action was being taken. Every action is labeled as brightness_move_to_level, whether it’s a dial turn or button press. There are two additional values that can be looked at: action_level and action_transition_time (there is another value called brightness that does not ever change for some reason). Luckily the action_transition_time value helps differentiate between action types: it’s 0.07 for a button press and 0.02 for a dial turn.

2.) The action_level describes the brightness target on a scale from 0 to 255. However, this value is an absolute reference. I.e. If I reach an action_level of 128 with the dial, then use the app to set the light’s brightness to 200, then turn the dial to the right, the dial will send an action_level value of something like 135, because it was still referencing the value of 128 it held previously. This means I have no idea if the dial was moved to the left or to the right based solely on a single MQTT message (aside from corner cases where the value is 2 (minimum for turning left) or 255 (maximum for turning right)).

So what am I trying to do?

I’d like an automation that:

  • Toggles the light if the button is pressed (let’s make it easy and assume we’ll always set the brightness to 255 if it toggles on)
  • Adjusts the brightness up by a standard amount if the dial is turned to the right
  • Adjust the brightness down by a standard amount if the dial is turned to the left

On a single MQTT message, there are four possibilities.

  1. action_transition_time == 0.07 ===> button pressed
  2. action_transition_time == 0.02 and action_move_to_level == 2 ===> dial turned left
  3. action_transition_time == 0.02 and action_move_to_level == 255 ===> dial turned right
  4. action_transition_time == 0.02 and action_move_to_level ~= 2 or 255 ===> dial turned in unknown direction

In case 4, I assume I’ll need to compare the current action_move_to_level value to a previous value to determine the direction. This is where I need help.

I’ve looked over mqtt sensors, trigger variables, value templates, and mqtt triggers, but I’m not finding a good example to get me started. The closest I’ve come up with so far is creating an mqtt sensor that updates based on the mqtt message, and an automation adjusts the light based on a state change of that mqtt sensor. I’m assuming this is not optimal because it results in VERY slow response times.

Any guidance would be greatly appreciated!

Below is the raw MQTT for button presses and dial turns:

# Clicking button (action level 255, transition 0.07)

Info 2023-08-21 14:08:26MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron', payload '{"action":"brightness_move_to_level","action_group":47454,"action_level":255,"action_transition_time":0.07,"brightness":132,"linkquality":120,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Info 2023-08-21 14:08:26MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron', payload '{"action":"","brightness":132,"linkquality":120,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Info 2023-08-21 14:08:26MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron/action', payload 'brightness_move_to_level'

# Click button (action level 0, transition 0.07)

Info 2023-08-21 14:08:28MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron', payload '{"action":"brightness_move_to_level","action_group":47454,"action_level":0,"action_transition_time":0.07,"brightness":132,"linkquality":116,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Info 2023-08-21 14:08:28MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron', payload '{"action":"","brightness":132,"linkquality":116,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Info 2023-08-21 14:08:28MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron/action', payload 'brightness_move_to_level'

# Turn  knob to the left multiple times (action level stays at 2, transition 0.02)


Info 2023-08-21 14:08:30MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron', payload '{"action":"brightness_move_to_level","action_group":47454,"action_level":2,"action_transition_time":0.02,"brightness":132,"linkquality":116,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Info 2023-08-21 14:08:30MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron', payload '{"action":"","brightness":132,"linkquality":116,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Info 2023-08-21 14:08:30MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron/action', payload 'brightness_move_to_level'
Info 2023-08-21 14:08:31MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron', payload '{"action":"brightness_move_to_level","action_level":2,"action_transition_time":0.02,"brightness":132,"linkquality":116,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Info 2023-08-21 14:08:31MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron', payload '{"action":"","brightness":132,"linkquality":116,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Info 2023-08-21 14:08:31MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron/action', payload 'brightness_move_to_level'
Info 2023-08-21 14:08:31MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron', payload '{"action":"brightness_move_to_level","action_level":2,"action_transition_time":0.02,"brightness":132,"linkquality":116,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Info 2023-08-21 14:08:31MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron', payload '{"action":"","brightness":132,"linkquality":116,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Info 2023-08-21 14:08:31MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron/action', payload 'brightness_move_to_level'
Info 2023-08-21 14:08:31MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron', payload '{"action":"brightness_move_to_level","action_level":2,"action_transition_time":0.02,"brightness":132,"linkquality":116,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Info 2023-08-21 14:08:31MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron', payload '{"action":"","brightness":132,"linkquality":116,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Info 2023-08-21 14:08:31MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron/action', payload 'brightness_move_to_level'

# Turn knob to the right multiple times (action level incrementally moves up, transition 0.02)

Info 2023-08-21 14:08:32MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron', payload '{"action":"brightness_move_to_level","action_level":15,"action_transition_time":0.02,"brightness":132,"linkquality":116,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Info 2023-08-21 14:08:32MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron', payload '{"action":"","brightness":132,"linkquality":116,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Info 2023-08-21 14:08:32MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron/action', payload 'brightness_move_to_level'
Info 2023-08-21 14:08:32MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron', payload '{"action":"brightness_move_to_level","action_level":66,"action_transition_time":0.02,"brightness":132,"linkquality":116,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Info 2023-08-21 14:08:32MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron', payload '{"action":"","brightness":132,"linkquality":116,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Info 2023-08-21 14:08:32MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron/action', payload 'brightness_move_to_level'
Info 2023-08-21 14:08:33MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron', payload '{"action":"brightness_move_to_level","action_level":73,"action_transition_time":0.02,"brightness":132,"linkquality":116,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Info 2023-08-21 14:08:33MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron', payload '{"action":"","brightness":132,"linkquality":116,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Info 2023-08-21 14:08:33MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron/action', payload 'brightness_move_to_level'
Info 2023-08-21 14:08:33MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron', payload '{"action":"brightness_move_to_level","action_level":110,"action_transition_time":0.02,"brightness":132,"linkquality":112,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Info 2023-08-21 14:08:33MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron', payload '{"action":"","brightness":132,"linkquality":112,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Info 2023-08-21 14:08:33MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron/action', payload 'brightness_move_to_level'

# Turn knob to the left once (action level decreases, transition 0.02)

Info 2023-08-21 14:08:34MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron', payload '{"action":"brightness_move_to_level","action_level":81,"action_transition_time":0.02,"brightness":132,"linkquality":116,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Info 2023-08-21 14:08:34MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron', payload '{"action":"","brightness":132,"linkquality":116,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null}'
Info 2023-08-21 14:08:34MQTT publish: topic 'zigbee2mqtt/Craft Room Lutron/action', payload 'brightness_move_to_level'
1 Like

Just in case anyone comes across this - I ended up not using an automation for the Lutron Aurora and instead bound the dial to each individual light in my light group (trying to bind to the light group itself failed).

I absolutely don’t recommend these dials if you plan on using them for more customized actions. They seem to only work well in the Hue walled garden.

1 Like

Your breakdown really help me. I wanted to get this working with an IKEA dimmable bulb, but you’re right, currently all of the actions are not exposed and its impossible to make it work.

This knob has been the first Zigbee device I bought that didn’t “just work” right out of the box. But the promise of the unique form factor of the device motivated me to keep trying.

I ended up not using the action entity exposed by Z2M, as you say it is always only brightness_move_to_level, which is useless by itself.

I think this mapping should be corrected, maybe in Z2M or somewhere else, but in the meantime I got it (mostly) working by just making up a couple straight MQTT trigger automations.

I did almost all of this in the UI (Settings → Automations → Create Automation), but some of the template stuff I had to ‘Edit in YAML’.

First, the easy part, the on/off switch:

  1. Add Trigger → MQTT

    1. topic: zigbee2mqtt/<IEEE_address (or however you named it in Z2M; check logs to see)>

    2. payload: (leave blank!)

  2. Add Condition → Template

    1. Value template: {{ trigger.payload_json.action_transition_time == 0.07 }}
  3. Add Action → Call service

    1. Service: light.toggle

    2. Targets: (whatever you want)

I chose ‘toggle’ as the device seems to keep its own state, which I do not think can be modified.

Now, on to the dimming part:

  1. Add Trigger → MQTT

    1. (same as above)
  2. Add Condition → Template

    1. Value template: {{ trigger.payload_json.action_transition_time == 0.02 }}
  3. Add Action → Call service

    1. Service: light.turn_on

    2. Targets: (whatever you want)

    3. Brightness: (pick any number)

    4. Here is where you have to ‘Edit in YAML’, because you are now going to replace the ‘brightness’ value you set above with the following: "{{ trigger.payload_json.action_level }}"

Now, this works, but the problem (as OP realized) is that this device keeps its own state, which is separate from what HA might know. So if you turn the knob to brightness 127 (50%), and then some automation (or UI slider in HA) sets it to 25%, and then you turn the knob up, it will jump from the 25% up to something above 50% (where its own internal state is), like 60-70% maybe. Perhaps this can be made less harsh with a longer transition time, or some clever programming, but that will be a project for another day.

Although I haven’t tried this yet (and I will), I agree that this is probably the better way.

In the meantime as an FYI, I’ve got the following Blueprint to work

So what I ended up doing was to create an ‘Input number’ for the brightness level of this particular light fixture, with a value range of 0-255.

Now, I typically turn on lights (usually via motion) at certain brightness levels depending on ‘Time of Day’ (e.g., 25% at night, 50% in morning, etc.).

So what I do now is to set this ‘input number’ to the ‘default’ value for that ‘Time of Day’ when entering that period. And then I modified the automation when you turn the knob to update this value. Finally, the value is used to turn on the the light at the specified brightness.

This way, you can turn the knob up and down and the value is retained, and will come on at that (newly set) level the next time the motion is triggered. And then it goes back to the default at next ‘Time of Day’ change.

Now, if you change the brightness sliders a lot in the UI, that’s not going to work as well. But we don’t do that, so this works well enough for our needs. I guess you could make the new slider visible, and hide the real one, and modify it indirectly if you needed to. But as I said, I didn’t bother because we don’t ever use it in that way.

I did try this, couldn’t get it to work (in Z2M). Curious to know if you do.

Before doing what I posted above, I had tried both drinferno (non-legacy, OP in your linked post) and docternick (legacy) blueprints, and could not get either of those to work.

But I see you’ve gone above and beyond that, and shared your working solution. Thanks for that! :beers: I’ll study it in detail some other time when I’m not so tired. :slight_smile:

I finally got around to trying to bind the Aurora Dimmer to a target. Although I got Z2M to say the bindings for a few set of clusters was successful (including genLevel), the dimmer never did control the lights. As targets, I tried it on a Zigbee Group consisting of 2xPhilips Hue bulbs (same model/type) and then on one of the bulbs individually. The bulbs are running firmware dated Aug 2023, so one would expect the bulbs to support bindings, but who knows if they really do.

Can i ask, the Aurora dimmer you’re referring to in this post is it the wired into the mains dimmer or the battery operated dimmer? (Aurora AU-A1ZBR1GW)

AFAIK, ‘Lutron Aurora’ is only a battery operated device. At least that was what I was referring to, can’t speak for others of course. I was not even aware there exists a mains powered version(?).