Groovy which is based on Java has the same considerations on processing,
If future code will need multi conditions an if/else statement would be the approach to go, but if you’re only trying to evaluate one condition (something =? X) the switch statement is faster processing wise as the JVM loads the values of the ‘cases’ into a table and iterates through them without doing for example a mathematical comparison (‘is 2+2 = 4 ?’).
Interesting that the zbjoin that @b16b doesn’t have more than one endpoint, which means if its a 3-gang switch, the buttons are inside the same EF00 command structure (or non consecutive endpoint numbers).
Thank you for your clarifications.
That’s an interesting insight, even though I believe the difference wouldn’t be noticeable for cloud environment.
Tuya implements proprietary protocol on top of 0xEF00 cluster. From what I understand
all messages are sent to destination EP =1
the format of the message is as follows: DPID 1 byte type 1 byte
0x02 uint32 (big endian)
0x03 string (N bytes)
0x04 enum 1 byte
0x05 bitmap 1/2/4 bytes len 2 bytes (in big endian, 01FF would mean 511 dec) value 1/2/4/N
DPID is basically a kind of proprietary endpoint inside Tuya cluster.
Please take it with a grain of salt, I’m new to this stuff
hub recognise the switch as a thing a must change it from ide
main relay parent open and turn off when every gang is turn offand turn on if is at least one is turn on
but does not follow the gang 2
also as switch does not turn on or off, still loading when tap it
maybe the reason that does not work as parent switch is the gang 2
Regarding zigbee join, this is what needed as a text, not image. I already added a fingerprint from this post and if that doesn’t work I probably have typo somewhere. Therefore, please post it as s text, so it could be copy&pasted.
Regarding the second issue, please provide logs as a text, not image.