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
[NEW DEVICE] Legrand double wall switch #98
Comments
🎉 |
Well, if you want to control 2 lights, you will need to use CustomLightController. ControllerX configuration aims to bind N controllers to N lights (everything with everything). If you want 1 button to control 1 light and another button to control another light, then you will need the CustomLightController as I mentioned. However, ControllerX should give a default behaviour to the controller acting to one light. What I normally do with other controllers like this is:
I can add this to your code if you want, I just need to make sure that endpoint 1 is the left button and endpoint 2 is the right one. Is this true? Thank you, |
Yep, feel free to add this to the PR :)
Yes it is!
Do you have any existing example of how I could configure it to manage two lights? :) |
Hi @Crocmagnon I just added both devices and the documentation to your branch. I will proceed with the merge request then. Regarding the configuration for two light, it will look like the following: example_app_light1:
module: controllerx
class: CustomLightController
controller: <controller id>
integration: <your integration>
light: light.light1
mapping:
1_on: on
1_off: off
1_move_up: hold_brightness_up
1_move_down: hold_brightness_down
1_stop: release
example_app_light2:
module: controllerx
class: CustomLightController
controller: <controller id>
integration: <your integration>
light: light.light2
mapping:
2_on: on
2_off: off
2_move_up: hold_brightness_up
2_move_down: hold_brightness_down
2_stop: release Basically, we map one config with the events from the left button ( Let me know if you need any help :) Cheers, |
HI @Crocmagnon, The integration for these 2 controllers is now in ControllerX v3.3.0. However, I just realised that the configuration I sent you earlier it will not work since the ZHA parse is done to the device level and we are not specifying the device, but the |
Yes, that’s what I thought when I took a glance at it. An option to override the mapping of any controller class would solve this and may other use cases: we could add classes to support special device features such as my switch with two endpoints but the user could have the final say over the commands mapping? EDIT: we would need to document the possible values for the keys and values of the mapping dictionary |
Hi @Crocmagnon, You are right. Now the CustomLightController is another class and this could be solved if we could override the mapping with the same Device Controller Class. The possible key-value mapping values are already accessible in the Custom Controllers documentation and the specific device page. I will let you know about the changes as soon as I get to it. In the meantime, I will leave this issue open to solve this problem. Thanks, |
…llers Now the mapping attribute can be used in any Controller type, so no need of CustomLightController for example, use LightController instead. We can also now use the mapping attribute for device controllers like E1810Controller or MFKZQ01LMLightController for example. related to #98
Hi @Crocmagnon, A beta version of the ControllerX v3.4.0 has been released. Now, all the In your case, you will need to specify the Legrand device because the ZHA parsed has been specified for this controller, so configuration should be: example_app_light1:
module: controllerx
class: Legrand600088LightController
controller: <controller id>
integration: <your integration>
light: light.light1
mapping:
1_on: on
1_off: off
1_move_up: hold_brightness_up
1_move_down: hold_brightness_down
1_stop: release
example_app_light2:
module: controllerx
class: Legrand600088LightController
controller: <controller id>
integration: <your integration>
light: light.light2
mapping:
2_on: on
2_off: off
2_move_up: hold_brightness_up
2_move_down: hold_brightness_down
2_stop: release Please, let me know if this works for you if you try. Thank you :) |
That looks great! Unfortunately I don't have time to test it right now but I will as soon as possible 😀 |
…llers Now the mapping attribute can be used in any Controller type, so no need of CustomLightController for example, use LightController instead. We can also now use the mapping attribute for device controllers like E1810Controller or MFKZQ01LMLightController for example. related to #98
Changes have been shipped to ControllerX v3.4.0. |
It works like a charm! 🎉❤️ I just had to quote the "on"/"off" values from the config you previously posted but otherwise it works great, thank you very much! 🚀 For the sake of completeness, here's a sample config: example_app_light1:
module: controllerx
class: Legrand600088LightController
controller: <controller id>
integration: zha
light: <light>
mapping:
1_on: "on"
1_off: "off"
1_move_up: hold_brightness_up
1_move_down: hold_brightness_down
1_stop: release
example_app_light2:
module: controllerx
class: Legrand600088LightController
controller: <controller id>
integration: zha
light: <light>
mapping:
2_on: "on"
2_off: "off"
2_move_up: hold_brightness_up
2_move_down: hold_brightness_down
2_stop: release |
New Device Support
Device Information
Side note: I have a zha implementation ready for the simple wall switch - 6 000 83, but I'm not sure how to handle the two endpoints in the double switch. Each endpoint (vertical pair of buttons) should be able to control a different light.
Implementation
Integrations
Integration: zha
Actions
There are four buttons. The switch recognizes both short and long presses.
Top left short press
Bottom left short press
Top right short press
Bottom right short press
The long press are the same but with
"command": "move"
,"args": [0, 255]
for the bottom buttons and"args": [1, 255]
for the top buttons.The text was updated successfully, but these errors were encountered: