esp32 zigbee onLightChange unwanted results #11495
-
I am using Arduino zigbee library and ZigbeeDimmableLight profile for a simple device which requires level and on/off commands.
I use Hubitat as my Zigbee controller and I send zigbee on / off commands as:
the device id is 0A and the hub sends 00 or 01 commands to the 0x0006 cluster. However, on serial monitor , I see the following output for on and off commads: off: on: So the esp32 zigbee library adds unwanted commands. @P-R-O-C-H-Y , maybe you can comment... thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
Hi @ilker-aktuna, if I get it correctly when setting to OFF you receive those 2 commands: when setting to ON you receive this: Is that correct? |
Beta Was this translation helpful? Give feedback.
-
yes, exactly. |
Beta Was this translation helpful? Give feedback.
-
That's how Zigbee communication works. It's always sending level + state. And as its 2 separate messages its triggering twice the onLightChanged. So you need to check both state and level. If state is 0 keep light off whatever level is. If state is 1, check the level. |
Beta Was this translation helpful? Give feedback.
-
but I see it receives 2 x state and 2x level commands as I wrote above. that is 4 messages and onLightChanged triggers twice |
Beta Was this translation helpful? Give feedback.
-
I am sending only 1 message from the Hubitat controller. |
Beta Was this translation helpful? Give feedback.
This is not issue on the Zigbee library side. I have already explained.
What is does on OFF command - sending separate 2 messages:
What is does on ON command - sending separate 2 messages:
It's 2 separate messages which can be in any order. But I can't tell from the code if its final message or not. So any message have to trigger the onLightChange.
And the
onLightChange
will be triggered with both parameters - state and level.Is that understandable now? :)