-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
[QUESTION] How to toggle a switch (plug)? #892
Comments
Hi @Gulpman, Sorry for the late reply. I am assuming you have already another config which hooks the same controller to a light (which you said it works well). Then, within the same config, you can hook an control what to do with the action you want. For example: wz-opple6-door-to-wz-light-highboard:
module: controllerx
class: WXCJKG13LMLightController
integration: z2m
controller: sensor.wz_switch_eingang_aqara6gang_action
light: light.your_light # This is the light you have hooked up with the controller with brightness and temperature
merge_mapping: # either use mapping: or merge_mapping:
button_3_single:
service: switch.toggle
entity_id: switch.nn_tuyaplugorange01 What this configuration will do is to control Let me know if this is what you were looking for or not. In case of not working, could you please share the logs when you press the button, so I can see what happens? Thanks! |
Hi @xaviml. In the meantime I managed to get what I want to work by using the blue print "Aqara Opple switch 3 bands via zigbee2mqtt" and assign the single click events there. However I do prefer to handle all the actions for one switch at one place, so I tried it out. Your proposed change worked. :) Thank you very much for the explaination. Now button 3 is switching the plug where a lamp on the highboard is connected to. However, as I prefer to have a single configuration for each [SWITCH] <-> [LIGHT] combination I tried to modify my initial configuration from the question to meet what I want to achieve and this as well worked. So here is the working configuration for that:
This is for sure only working if you use a helper within Home Assistant which changes the type of a switch to a light. So the last question I have: So somehow change the line
to something like
to allow switches as "lights" to be switched or
to allow switches as targets? |
Hi @Gulpman , Your configuration makes sense to me as well. In fact, the # Aquara Opple 6-gang im Wohnzimmer an das Standlicht neben dem High Board
wz-opple6-door-to-wz-light-highboard:
module: controllerx
class: WXCJKG13LMLightController
integration: z2m
controller: sensor.wz_switch_eingang_aqara6gang_action
light: light.nn_tuyaplugorange01
mapping:
button_3_single:
service: light.toggle
Yes, you can use a regular # Aquara Opple 6-gang im Wohnzimmer an das Standlicht neben dem High Board
wz-opple6-door-to-wz-light-highboard:
module: controllerx
class: SwitchController
integration: z2m
controller: sensor.wz_switch_eingang_aqara6gang_action
switch: switch.nn_tuyaplugorange01
mapping:
button_3_single:
service: light.toggle Note that Hopes this clarifies the questions you had. Regards, |
Question
I am trying to accomplish something - I thought - very simple but am struggling with my understanding of configuring ControllerX.
My use case
In our living room I want to install an Aquara Opple 6-gang switch (WXCJKG13LM). I want to assign button 3 single press to toggle a plug where a lamp is attached to.
I managed to control the main light with the Aquara Opple 6-gang , e.g. putting actions and merge_mappings to the appropriate buttons for switching, dimming and changing color tempaerature flawlessly.
However, I'm stuck in how to tell ControlX to toggle the plug with one button. :)
At first I created a helper in Home Assistant to change the type of the plug from plug to light. But it seems that this is not detected as light as can bee seen from the following screenshot:
I tried to use the plug as light. ... but that didn't work (see config below).
I didn't find an example for what I am trying to accomplish - though I think this should be a very common use case?
I think it is just a tiny thing I'm missing but I do not get clear, how to do it in the documentation.
Can someone tell me how the right syntax would be?
Thank you very much in advance.
Additional information
AppDaemon app configuration
Logs
I didn't add all different logs, just the one from the config posted above - I think I understand why the error message there is - I just don't know how to fix it in the config :)
The text was updated successfully, but these errors were encountered: