The first problem I face is: if there are ~2 seconds interval between button toggle, the lights won’t respond. As if I have to wait for 10 seconds between presses to get the lights to toggle on/off.
If there a way to buffer the toggle events so I don’t have to press repeatedly to toggle the lights?
So I decided to use a blueprint, but the blueprint doesn’t list the MOES smart knob:
So I can’t really utilize the blueprint, and trying to set automation manually, I can’t get the lights to toggle quickly nor can I find all the options to utilize the knob rotation functions.
Im using this automation. Idea is invented by someone else on our forum, however can not find it when I search. Sorry, I can not give credit to the right person.
However, it works quite well. Remember the device need a name with no spaces, otherwise it will not tirgger, and the knob need to be in command mode, done in Z2M interface.
The below is including my commands, for inspiration.
Thanks. I’m still trying to learn how to write automation. It’s very difficult.
however, even after I renamed the devices with no spaces, they don’t appear in the Remote: Devices blueprint drop down menu
Thank you for the detailed explanation.
For option 2-5, I cannot use it in this way because the light is a Yeelight (Xiaomi) and it’s not using an MQTT service.
oh, I wasn’t aware there was a difference between ZHA and Z2M.
I use a Zigbee dongle v.3 connected to the server that runs HA.
And I use the MQTT broker addon, as well as an ESP32 BT proxy.
Hi Gil,
Below I have tried to change my automation to use HA command “light.on” instead of the MQTT version. I works, however is not optimal in any way. Might be able to optimise it further using templates, however not sure. My version will give some flash up/down when turning the knob continually. It works perfectly if done very slowly (however, who is ever doing that:-))
So, my best suggestion is the MQTT commands version.
ZHA default’s entity trigger for the Moes Smart Knob shows these triggers (rotation filtered):
“right” device_rotated_slow
“left” device_rotated_slow
“right” device_rotated_fast ← never triggered
“left” device_rotated_fast ← never triggered
Device rotated “Right” ← never triggered
Device rotated “Left” ← never triggered
Only the slow ones are triggered, so I falled back on using a manual trigger.
Here is how I managed the dimming with a zha event, and this automation works perfectly fine for me:
alias: Room 1 - Dimmer step
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: d0ecf2fed74hd47hb069b49ad8
condition:
- condition: template
value_template: "{{ trigger.event.data.command == 'step' }}"
# ^ This captures any rotation event ^
action:
- service: light.turn_on
# ^ This service allows to set an exact brightness
data:
brightness_step_pct: >
{{ (1 if trigger.event.data.params.step_mode == 0 else -1) *
trigger.event.data.params.step_size }}
# ^ This increases/decreases the brightness
# in function of the exact amount rotated
transition: 0.1
target:
entity_id: light.room_1
mode: single
Replace d0ecf2fed74hd47hb069b49ad8 by the real device_id of your dimmer.
Of course one can still multiply trigger.event.data.params.step_size by any factor to get the desired brightness modifier, but I found the returned amount quite satisfying.
For more details you can listen to the zha_event in Developper tools > Events > Listen to events > “zha_event”. Here is an example of what is returned:
event_type: zha_event
data:
# [...]
device_id: d0ecf2fed74hd47hb069b49ad8 # <- Your device
endpoint_id: 1
cluster_id: 8
command: step # <- The step command
args:
- 0
- 13
- 1
params:
step_mode: 0 # <- 0 for right, 1 for left
step_size: 13 # <- Amount rotated (seems to be the degree angle)
transition_time: 1
options_mask: null
options_override: null
# [...]
It is not a event type. The knob have 2 modes of operation. The command mode and the event mode. For the above automations to work it needs to be in command mode. It’s done in the Z2M interface.