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:
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.
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.
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.
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
I was finally able to get bindings to work in my setup (Aurora Dimmer to a couple of Philips Hue bulbs), so thought I would provide a quick write-up.
Binding is reasonably easy to setup using the Z2M UI, but the problem I kept running into was finding the right clusters to bind with that would actually allow the Aurora Dimmer to control the bulbs.
Steps
Pre-check: Determining Endpoints and Clusters
a. Goto Z2M-UI Philips Hue Device and see what clusters it supports and in which endpoint.
For mine, the Endpoint was 11 which has Level Control, OnOff, Touchlink, and other clusters of interest
b. Goto Z2M-UI Aurora Device and see what clusters it supports and in which endpoint.
Endpoint 1 has Level Control, OnOff, Touchlink, and other clusters of interest
c. Have the bulbs near the Aurora Dimmer. My Bulbs are at most 10 feet away
Goto Z2M-UI Aurora Dimmer and goto the Bind Tab.
a. There are an empty set of boxes available for adding a new binding entry (don’t mess with the existing binding with the Coordinator). I set mine as follows:
Source Endpoint =1
Destination = “My Philips Hue 1”
Destination Endpoint = 11
LevelCtrl = ticked (all other clusters unticked)
b.Click on “Bind” button and quickly (within a couple of seconds),
go over to the Aurora Dimmer and tap the switch to wake it up.
It should show in the UI that the binding of LevelCtrl was successful.
Around 20 seconds later you may get a failure indicator regarding Change Reports failed to be setup, but this doesn’t seem to matter.
Only binding the LevelCtrl to the Philips Hue worked for me. Any other combination of clusters to bind would be successful at binding, but left the Aurora Dimmer unable to actually control the Philips Hue (nothing would happen when tapping/dimming). As an FYI, this HA Community Forum user was successful with their IKEA bulbs by binding LevelCtrl, OnOff, and Touchlink clusters with their IKEA Bulbs. So which clusters to bind may vary depending on your situation.
I should also add that I wanted the same Aurora Dimmer to control a second Philips Hue bulb, so I repeated the process above for the second bulb. It may have been possible to put the bulbs in a ZigBee Group and to have done the binding on the Group, but I did not try this.