-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add ZHA support for TuYaERS10TZBVKAA #625
Comments
Hi @saint2016 , Thank you for opening this issue and for the detailed explanation of this controller. ZHA is one of the hardest integrations since the events are not as clear as Z2M and deCONZ, so it is normal you are facing this issue. Before proceding further, I have 2 questions:
As done for other controllers with ZHA integration, I can code the rules of this arguments, but first I would like to know the answer to those 2 question, so I have a better idea on how to progress. I would love your input once I have integrated this controller, so I would appreciate if you could test it. Regards, |
Hi @xaviml, Thanks for your reply. Yes it does look complex. I thought of adding an option to bring to 25% dimming (you have 0.5 in the original code) and enable that after 3 turns, and bring to 50% in 2 turns, and 75% with one turn but catching 3 or 2 turns is also not so functional. So I'll leave it to the expert :) Here are the two events:
And no, as you guessed there is no event fired when I stop. Very happy to test it out whenever you are ready. |
Hi @saint2016 , I have created the following PR to add ZHA support for the TuYA knob: #661. Would you mind downloading the code and test the integration? You can follow one of those 2 options specified in this section from contributing file: https://github.com/xaviml/controllerx/blob/main/CONTRIBUTING.md#run-code-with-appdaemon. Let me know if you have any troubles or you need any help for it. Regards, |
Hi @saint2016 , To make it easy for you to test, I released ControllerX v4.25.0a0, which you can download from HACS (marking "show beta versions") from the "Redownload" option. Regards, |
hi, thanks for the update and pushing the version. Toggle worked, step functions didn't (neither brightness nor color). To be clear, I don't mean it didn't work smoothly, I mean it didn't work at all. I listened to the zha_event and they were firing OK. Brightness worked 1 time randomly (it was when I had turned the bulb off, then did a step on the knob & probably an unknown thing, and then turned the bulb again) but I couldn't repeat the behavior. |
Thank you @saint2016 for the feedback. I am currently working on it since I saw there is a bug in the code. I will let you know again, so you can try it out. Are you okay I release another version or you can test it locally with the "CONTRIBUTING" guidelines? Thanks! |
Very happy to test again, HACS re-download worked like a charm so it would be great if we could do it that way. |
Hi @saint2016 , I just released ControllerX v4.25.0b1 with the latest changes. Would you mind trying again? If it does not work, or works not as expected, could you please provide the AppDaemon logs related to the problem? Regards, |
This worked, thanks for making it happen! There was just a behavioral issue: turning the knob to the left increased the brightness and turning it to the right decreased the brightness. Standard dimmer behavior on analog dimmers is the opposite: turning the knob to the right should increase brightness and to the left decrease it. I'd assume people would expect that behavior (I for one certainly did expect things to be that way). I also checked the appdaemon logs, all seem clear. So if you can fix the above this is all good to go. |
Hi @saint2016 , Sorry, I inverted the direction. I thought that 0 was down and 1 was up for brightness (the same for color temp). I will invert this and merge the PR. Did you find any other problems? Could you try the following scenarios (with the current version v4.25.0b1) with brightness and color temp?
*These cases are not working now, but they will be fixed. Feel free to add more use cases and double check edge cases. I will be happy to help out in what I can to fix anything else you find. Regards, |
Great, no other problems I could see. On your scenarios:
|
Could you show the AppDaemon logs when the light is at minimum brightness and then you dim the light down? Theoretically, the brightness should stay at 1, and not show 0. If the light turns off with brightness 1, could you try following configuration: tuya_app:
module: controllerx
class: TuYaERS10TZBVKAALightController
integration: zha
controller: 00:11:22:33:44:55:66:77:88
light: light.livingroom_lamp
min_brightness: 2 # Add this attribute The I have also merged the PR, and released ControllerX v4.25.0b2. You can now try in there the latest changes. Regards, |
OK, tried v4.25.0b2 and all good. On the minimum brightness, somehow the bulb still went off with the below log entry so I used your min_brightness and it prevented the bulb from going dark. This is a working solution. -- 2023-01-03 15:34:51.240418 INFO controller_knob: 🎮 Button event triggered:
the bulb went off at this point, somehow brightness of 1 is completely off So overall things look good with the updates and this controller. Thanks again for implementing, please let me know if I can help further. |
Thank you @saint2016 for your active testing. There is nothing else I need from you :) I will be closing the issue once I release v4.25.0. Regards, |
This device is now available on ControllerX v4.25.0. This issue can be now closed. If any bugs are found related to this issue, please open a new one. |
In ZHA only |
New Device Support
Device Information
Integrations
Integration: [ Choose from
z2m | deconz | zha
]zha
Actions
button_xyz_press
: Sent when button xyz is pressedbutton_xyz_hold
: Sent when button xyz is heldNotes
The ZHA integration is different than the Z2M one. I captured the commands above and suggested some actions but they're very hacky. The reason is that the commands are sent with accompanying args (which controllerx apparently can capture - impressive). However, they don't work well with dimming. For example:
step_0_13_1 is a one step turn towards the right. step_0_25_1 is 2 steps turn towards the right, 3 steps turn increases 25 to 37, and so forth. All patterns are the same. Click and turn converts into the step_color_temp command.
In general there are 5 extra arguments, the first 3 change and the last 2 only exist in step_color_temp + were always the same:
4 & 5) only in step_color_temp and always 153 & 500. I don't know what they are for.
It's the first time I'm customizing controllerx so I thought of these mappings above but obviously this mapping is very limited. If I turn the knob to the right 5 times in one go it doesn't result in anything with these mappings for example, controllerx might be taking care of this through some smart mapping but I couldn't find it.
The text was updated successfully, but these errors were encountered: