-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration of new 8ch switch #6545
Conversation
I found na issue with switch multiply switches. Seperate request messages is sending in same time. Device send readback as switches are in expected possitions. But they aren't. I think the workaround is to set delay between request messages. How can I do this? |
Could you provide the debug log when sending multiple commands at once and it doesn't work? Currently we don't support this artificial delay. See https://www.zigbee2mqtt.io/guide/usage/debug.html on how to enable debug logging. |
Note to self; after this merge Koenkk/zigbee2mqtt.io#2348 |
That is debug log, when channel 7 stucked:
And that when I put 100 ms delay in Home Assistant, that's way everything worked:
|
I think we can solve this by creating a new |
Wouldn't this cause all requests to be delayed by the same amount of time? All requests will be sent at the same time, but delayed. |
I don't think so, they should be send sequentially |
src/lib/tuya.ts
Outdated
@@ -440,6 +440,13 @@ export const valueConverter = { | |||
trueFalseEnum0: valueConverterBasic.trueFalse(new Enum(0)), | |||
trueFalseEnum1: valueConverterBasic.trueFalse(new Enum(1)), | |||
onOff: valueConverterBasic.lookup({'ON': true, 'OFF': false}), | |||
onOffWithDelay: { | |||
to: async (value: string) => { | |||
await utils.sleep(200); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put delay here, but that caused that all requests are delayed and send all togheter after 200 ms. It should look like utils.sleep(transitiont * 200)
but I don't know how proper declare transition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean with transitiont
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I will change switch in Z2M for more then one entity at one time, I want to set some number like 0, 1, 2, 3 for each. I will get delay time such 0 * 200 ms, 1 * 200 ms, 2 * 200 ms and so on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you change to: async (value: string) => {
to to: async (value: string, meta) => {
, you can get the message with meta.message
, from that you can count the number of state_
and create the timeout based on that.
That code works for me. I am not sure is it correct to put value clear function to on event function. It works but I don't know is it good way. |
Instead of using the globalStore, did you experiment with using the |
I checked this device once again with default onoff functions. I realived that after update Z2M and Home Assistan there is no problem with freezing channels. That configuration works correct. |
Thanks! |
I would like to add configuration for this new 8ch switch https://www.alibaba.com/product-detail/Tuya-smart-wifi-zigbee-Bluetooth-4CH_1600834099744.html
Look similar like TS0601_switch_8 but this one has different manufacturerName and last two Tuya data points.