Open Gulpman opened 8 months ago
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 light.your_light
with the specification from the default mapping (https://xaviml.github.io/controllerx/controllers/WXCJKG13LM/#light), and override the button_3_single
action to toggle the plug.
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. thank you for your reply.
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:
# 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
actions:
- button_3_single
merge_mapping: # either use mapping: or merge_mapping:
button_3_single:
service: light.toggle
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: Would it be possible to configure ControllerX so I can tell it to use a switch instead of a light as destination?
So somehow change the line
light: light....
to something like
light: switch...
to allow switches as "lights" to be switched or
switch: switch....
to allow switches as targets? For sure only on, off and toggle could be assigned to those.
Hi @Gulpman ,
Your configuration makes sense to me as well. In fact, the actions
part is not needed if you use mapping
instead of merge_mapping
as you pointed out in the comment:
# 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
Would it be possible to configure ControllerX so I can tell it to use a switch instead of a light as destination?
Yes, you can use a regular SwitchController
instead of WXCJKG13LMLightController
, so:
# 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 WXCJKG13LMLightController
is a Light Controller, so it expects only lights as entity. However, ControllerX support other types of controllers (e.g. Switch, Cover). You can read more about other types here.
Hopes this clarifies the questions you had.
Regards, Xavi M.
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 :)