controllerx icon indicating copy to clipboard operation
controllerx copied to clipboard

[FEATURE REQUEST] Add E2004ASwitchController

Open simonckenyon opened this issue 2 years ago • 2 comments

Feature Request

Add E2004SwitchController so that the device can be used as a simple on/off switch

Describe the solution / feature you'd like

I added the following code to controllerx/cx_devices/ikea.py

class E2004SwitchController(SwitchController):
    def get_z2m_actions_mapping(self) -> DefaultActionsMapping:
        return {"on": Switch.ON, "off": Switch.OFF}

    def get_deconz_actions_mapping(self) -> DefaultActionsMapping:
        return {1002: Switch.ON, 2002: Switch.OFF}

    def get_zha_actions_mapping(self) -> DefaultActionsMapping:
        return {"on": Switch.ON, "off": Switch.OFF}

Describe alternatives you've considered

I could not see another way to do this.

Additional context

I have a device to hand and I just wanted to be able to turn a group of chrsitmas lights on or off.

simonckenyon avatar Dec 11 '22 16:12 simonckenyon

Hi @simonckenyon ,

Could you please share a link from Zigbee2MQTT for the support of this device (or any other link)? I only saw this device as E2004 on Google: https://www.ikea.com/us/en/manuals/vappeby-bluetooth-speaker-lamp-outdoor-blue__AA-2307027-1-2.pdf However, this device works with bluetooth, not Zigbee. Maybe did you mean E2002?

If you meant the E2002, you could temporarily do the following as an alternative solution:

example_app:
  module: controllerx
  class: SwitchController
  integration: z2m
  controller: sensor.my_controller_action
  switch: switch.my_entity_id
  mapping:
    "on": "on"
    "off": "off"

Regards, Xavi M.

xaviml avatar Dec 31 '22 11:12 xaviml

Hi @simonckenyon ,

Could you please share a link from Zigbee2MQTT for the support of this device (or any other link)? I only saw this device as E2004 on Google: https://www.ikea.com/us/en/manuals/vappeby-bluetooth-speaker-lamp-outdoor-blue__AA-2307027-1-2.pdf However, this device works with bluetooth, not Zigbee. Maybe did you mean E2002?

If you meant the E2002, you could temporarily do the following as an alternative solution:

example_app:
  module: controllerx
  class: SwitchController
  integration: z2m
  controller: sensor.my_controller_action
  switch: switch.my_entity_id
  mapping:
    "on": "on"
    "off": "off"

Regards, Xavi M.

As a side note regarding the E2002 and the E1810 is there a physical reason the E2002 "on" and E1810 "toggle" buttons do not have hold actions? I would like to be able to hold these buttons, if possible.

inertia666 avatar Feb 07 '23 07:02 inertia666