Moes Smart Knob issue with MQTT messages

I’m trying to create an automation using this knob to increase/decrease the color temperature of a Hue light.
I had some success using an action like this, triggered by the color_temperature_step_up event in command mode:

action: light.turn_on
metadata: {}
data:
  kelvin: >
    {% set rotation = states( 'sensor.rotating_smart_knob_action_step_size') | float %}    
    {% set min_temp = 2000 %}   {% set max_temp = 6500 %}   
    {{ min_temp + (max_temp - min_temp) * (rotation /100) }}
target:
  entity_id: light.hue_go_1

However, while testing I noticed that the light indeed increases the color temp when pressing and turning the knob as expected, but right after that, it turns back to a lower color temp. After some investigation, I discovered that the event is sent twice, the first time with the correct values, but the second time with a lower value, and this triggers the automation twice (I see 2 traces), with the second one changing the color temp incorrectly.
Heres the MQTT log for a (suposedly) single press and turn event:

info 2025-02-16 19:01:32z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rotating Smart Knob', payload '{"action":"color_temperature_step_up","action_rate":null,"action_step_size":120,"action_transition_time":0.03,"battery":82,"linkquality":255,"operation_mode":"command","voltage":2900}'
info 2025-02-16 19:01:32z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rotating Smart Knob/action', payload 'color_temperature_step_up'
info 2025-02-16 19:01:32z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rotating Smart Knob', payload '{"action":"color_temperature_step_up","action_rate":null,"action_step_size":18,"action_transition_time":0.01,"battery":82,"linkquality":255,"operation_mode":"command","voltage":2900}'
info 2025-02-16 19:01:32z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Rotating Smart Knob/action', payload 'color_temperature_step_up'

Seems like this a problem with the knob itself, but is it something that can be fixed changing any setting in the MQTT configuration?

Link?

Could you be seeing a “release” event? I am not familiar with this knob, but if I could see the specs it might help.

Post the integration where you define the sensor.

(Welcome to the rabbit hole).

Thanks for your quick answer:
This is the knob: https://moeshouse.com/products/zigbee-round-dimmer-scene-switch?variant=39689628483665

Is this what you mean with “integration where you define the sensor”?

Moes makes some pretty good Z-Wave devices, but I am biased since I have a few Moes wall-dimmers. I don’t have any Moes Zigbee devices, but lots of others.

Did you install the Moes app on your phone and is that why the bulbs color change as expected?

Which Zigbee integration are you using?

No, I didn’t install the Moes app. I’m using Zigbee2MQTT integration in Home Assistant, and since it’s supported in it, I didn’t see the point of using the app. But I can give it a try and see how it works in there.
I hope I can make this work, because I really like the look and feel of this knob, and I was planning to buy a few more to control various lights around the house.

How are you making the sensor entity?

He isn’t. The entity is created by Z2M.

@ASarco search around in the Z2M docs for “debounce”. Playing around with that should fix your issue.

He was talking about capturing the MQTT, so I was wondering if he was using the MQTT Integration. I use ZHA, so I am out of my scope with Z2M.

Well, that seems to work. Setting debounce to 0.3 s causes to receive only one message, so at least the color temp doesn’t change afterwards.
However, the docs says the debounce “combines” messages that happens withing that window of time. How is this combination happening, will it actually sum, or average the values in action_step_size? Or just sends the last one?

Thank you both for your help.

I’m not 100% sure either. Maybe try looking at the Z2M log while reproducing the same actions as your first post and check if the action_step_size is 120, 18, or somewhere in the middle.

There is also a throttle option which only processes the first message (according to docs - didn’t test this myself). If you find it’s not behaving like you want, maybe try that.

1 Like