Skip to content
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 switch controller to additional controllers #161

Closed
TheModin opened this issue Oct 25, 2020 · 3 comments
Closed

Add switch controller to additional controllers #161

TheModin opened this issue Oct 25, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@TheModin
Copy link

Would it be possible to add switch controller to e.g WXKG02LMLightController?
I would love to be able to control Trådfri outlets with the Aqara switch.

@TheModin TheModin added the enhancement New feature or request label Oct 25, 2020
@xaviml
Copy link
Owner

xaviml commented Oct 25, 2020

Hi @TheModin,

No problem. I will add a SwitchController to this device. In the meantime, you can use SwitchController class. Something like:

  example_app:
    module: controllerx
    class: SwitchController
    controller: sensor.your_controller_action
    integration: z2m
    switch: switch.your_switch
    mapping:
      single_left: "on"
      single_right: "off"

In mapping, you can define the behaviour you desire. You can see the actions you can define in the mapping in here, and in here you will find the actions your controller fire depending on your integration.

Regards,
Xavi M.

xaviml added a commit that referenced this issue Oct 31, 2020
@TheModin
Copy link
Author

TheModin commented Nov 5, 2020

Thanks @xaviml
Tried your suggestion and it worked like a charm.

Cheers
Martin

@xaviml
Copy link
Owner

xaviml commented Nov 28, 2020

Switch Controller to this device has been added in ControllerX v4.2.0.

@xaviml xaviml closed this as completed Nov 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants