zigpy / zha-device-handlers

ZHA device handlers bridge the functionality gap created when manufacturers deviate from the ZCL specification, handling deviations and exceptions by parsing custom messages to and from Zigbee devices.
Apache License 2.0
719 stars 664 forks source link

[Device Support Request] icasa Pulse 8S #503

Closed PaulAntonDeen closed 6 months ago

PaulAntonDeen commented 3 years ago

Is your feature request related to a problem? Please describe. icasa Pulse 8s is not recognized by zha

Describe the solution you'd like Being able to switch lights with the device

Device signature - this can be acquired by removing the device from ZHA and pairing it again from the add devices screen. Be sure to add the entire content of the log panel after pairing the device to a code block below this line.

  "node_descriptor": "NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=4644, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=0)",
  "endpoints": {
    "1": {
      "profile_id": 260,
      "device_type": "0x0001",
      "in_clusters": [
        "0x0000",
        "0x0001",
        "0x0003",
        "0x0b05"
      ],
      "out_clusters": [
        "0x0003",
        "0x0004",
        "0x0005",
        "0x0006",
        "0x0008",
        "0x0019",
        "0x0300",
        "0x1000"
      ]
    }
  },
  "manufacturer": "icasa",
  "model": "ICZB-KPD18S",
  "class": "zigpy.device.Device"
}

Additional context I got working on the quirk by adapting the IKEA 5 button remote but am now stuck:

class IcasaPulse8S(CustomDevice):
    """Custom device representing icasa pulse 8s remote control."""

    signature = {
        # input_clusters=[0, 1, 3, 2821]
        # output_clusters=[3, 4, 5, 6, 8, 25, 768, 4096]>
        MODELS_INFO: [(ices, "ICZB-KPD18S")],
        ENDPOINTS: {
            1: {
                PROFILE_ID: zll.PROFILE_ID,
                DEVICE_TYPE: zll.DeviceType.SCENE_CONTROLLER,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    PowerConfiguration.cluster_id,
                    Identify.cluster_id,
                    DIAGNOSTICS_CLUSTER_ID,
                ],
                OUTPUT_CLUSTERS: [
                    Identify.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    OnOff.cluster_id,
                    LevelControl.cluster_id,
                    Ota.cluster_id,
                #colour control,
                    #Touchlink Commissioning
                ],
            }
        },
    }

    replacement = {
        ENDPOINTS: {
            1: {
                PROFILE_ID: zll.PROFILE_ID,
                DEVICE_TYPE: zll.DeviceType.SCENE_CONTROLLER,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    DoublingPowerConfigurationCluster,
                    Identify.cluster_id,
                    Alarms.cluster_id,
                    DIAGNOSTICS_CLUSTER_ID,
                    LightLinkCluster,
                ],
                OUTPUT_CLUSTERS: [
                    Identify.cluster_id,
                    Groups.cluster_id,
                    ScenesCluster,
                    OnOff.cluster_id,
                    LevelControl.cluster_id,
                    Ota.cluster_id,
                    LightLink.cluster_id,
                ],
            }
        }
    }

I've added the debug log and now get a ton of lines when I press a button:

Short pressing S1 button:

2020-09-25 11:32:32 DEBUG (MainThread) [zigpy_cc.uart] Frame received: <UnpiFrame command_type=CommandType.AREQ subsystem=Subsystem.AF command_id=129 data=b'\x00\x00\x05\x00D\xe4\x01\x01\x00V\x00D\xb8\xd8\x00\x00\x06\x019\x05\x00\x00\x01\x06i\x1c' length=26 fcs=65>
2020-09-25 11:32:32 DEBUG (MainThread) [zigpy_cc.api] <-- AREQ AF incomingMsg tsn: None {'groupid': 0, 'clusterid': 5, 'srcaddr': 0xE444, 'srcendpoint': 1, 'dstendpoint': 1, 'wasbroadcast': 0, 'linkquality': 86, 'securityuse': 0, 'timestamp': 14202948, 'transseqnumber': 0, 'len': 6, 'data': b'\x019\x05\x00\x00\x01'}
2020-09-25 11:32:32 INFO (MainThread) [zigpy_cc.zigbee.application] handle_message incomingMsg
2020-09-25 11:32:32 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0005] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=57 command_id=5>
2020-09-25 11:32:32 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0005] ZCL request 0x0005: [0, 1]
2020-09-25 11:32:32 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0005] No handler for cluster command 5
2020-09-25 11:32:32 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=cc:cc:cc:ff:fe:26:a1:48, unique_id=cc:cc:cc:ff:fe:26:a1:48:1:0x0005, endpoint_id=1, cluster_id=5, command=recall, args=[0, 1]>

Short pressing S2:

2020-09-25 11:42:11 DEBUG (MainThread) [zigpy_cc.uart] Frame received: <UnpiFrame command_type=CommandType.AREQ subsystem=Subsystem.AF command_id=129 data=b'\x00\x00\x05\x00D\xe4\x01\x01\x00\\\x00uY\xf4\x00\x00\x06\x01O\x05\x00\x00\x02\x06i\x1c' length=26 fcs=194>
2020-09-25 11:42:11 DEBUG (MainThread) [zigpy_cc.api] <-- AREQ AF incomingMsg tsn: None {'groupid': 0, 'clusterid': 5, 'srcaddr': 0xE444, 'srcendpoint': 1, 'dstendpoint': 1, 'wasbroadcast': 0, 'linkquality': 92, 'securityuse': 0, 'timestamp': 16013685, 'transseqnumber': 0, 'len': 6, 'data': b'\x01O\x05\x00\x00\x02'}
2020-09-25 11:42:11 INFO (MainThread) [zigpy_cc.zigbee.application] handle_message incomingMsg
2020-09-25 11:42:11 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0005] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=79 command_id=5>
2020-09-25 11:42:11 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0005] ZCL request 0x0005: [0, 2]
2020-09-25 11:42:11 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0005] No handler for cluster command 5
2020-09-25 11:42:11 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=cc:cc:cc:ff:fe:26:a1:48, unique_id=cc:cc:cc:ff:fe:26:a1:48:1:0x0005, endpoint_id=1, cluster_id=5, command=recall, args=[0, 2]>

In AREQ AF incomingMsg the x01 on the end of the data key is button S1, x02 is button S2 etc

This is the off button:

2020-09-25 11:34:23 DEBUG (MainThread) [zigpy_cc.uart] Frame received: <UnpiFrame command_type=CommandType.AREQ subsystem=Subsystem.AF command_id=129 data=b'\x00\x00\x06\x00D\xe4\x01\x01\x00Y\x00\xd4\x00\xde\x00\x00\x03\x01;\x00\x06i\x1c' length=23 fcs=109>
2020-09-25 11:34:23 DEBUG (MainThread) [zigpy_cc.api] <-- AREQ AF incomingMsg tsn: None {'groupid': 0, 'clusterid': 6, 'srcaddr': 0xE444, 'srcendpoint': 1, 'dstendpoint': 1, 'wasbroadcast': 0, 'linkquality': 89, 'securityuse': 0, 'timestamp': 14549204, 'transseqnumber': 0, 'len': 3, 'data': b'\x01;\x00'}
2020-09-25 11:34:23 INFO (MainThread) [zigpy_cc.zigbee.application] handle_message incomingMsg
2020-09-25 11:34:23 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0006] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=59 command_id=0>
2020-09-25 11:34:23 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0006] ZCL request 0x0000: []
2020-09-25 11:34:23 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0006] No handler for cluster command 0
2020-09-25 11:34:23 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=cc:cc:cc:ff:fe:26:a1:48, unique_id=cc:cc:cc:ff:fe:26:a1:48:1:0x0006, endpoint_id=1, cluster_id=6, command=off, args=[]>

and the on button:

2020-09-25 11:35:13 DEBUG (MainThread) [zigpy_cc.uart] Frame received: <UnpiFrame command_type=CommandType.AREQ subsystem=Subsystem.AF command_id=129 data=b'\x00\x00\x06\x00D\xe4\x01\x01\x00Y\x00\xacd\xe0\x00\x00\x03\x01=\x01\x06i\x1c' length=23 fcs=72>
2020-09-25 11:35:13 DEBUG (MainThread) [zigpy_cc.api] <-- AREQ AF incomingMsg tsn: None {'groupid': 0, 'clusterid': 6, 'srcaddr': 0xE444, 'srcendpoint': 1, 'dstendpoint': 1, 'wasbroadcast': 0, 'linkquality': 89, 'securityuse': 0, 'timestamp': 14705836, 'transseqnumber': 0, 'len': 3, 'data': b'\x01=\x01'}
2020-09-25 11:35:13 INFO (MainThread) [zigpy_cc.zigbee.application] handle_message incomingMsg
2020-09-25 11:35:13 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0006] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=61 command_id=1>
2020-09-25 11:35:13 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0006] ZCL request 0x0001: []
2020-09-25 11:35:13 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0006] No handler for cluster command 1
2020-09-25 11:35:13 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=cc:cc:cc:ff:fe:26:a1:48, unique_id=cc:cc:cc:ff:fe:26:a1:48:1:0x0006, endpoint_id=1, cluster_id=6, command=on, args=[]>

Longpress S1 (store scene according to manual):

2020-09-25 11:36:31 DEBUG (MainThread) [zigpy_cc.uart] Frame received: <UnpiFrame command_type=CommandType.AREQ subsystem=Subsystem.AF command_id=129 data=b'\x00\x00\x05\x00D\xe4\x01\x01\x00T\x00\xdc!\xe4\x00\x00\x06\x01?\x04\x00\x00\x01\x06i\x1c' length=26 fcs=121>
2020-09-25 11:36:31 DEBUG (MainThread) [zigpy_cc.api] <-- AREQ AF incomingMsg tsn: None {'groupid': 0, 'clusterid': 5, 'srcaddr': 0xE444, 'srcendpoint': 1, 'dstendpoint': 1, 'wasbroadcast': 0, 'linkquality': 84, 'securityuse': 0, 'timestamp': 14950876, 'transseqnumber': 0, 'len': 6, 'data': b'\x01?\x04\x00\x00\x01'}
2020-09-25 11:36:31 INFO (MainThread) [zigpy_cc.zigbee.application] handle_message incomingMsg
2020-09-25 11:36:31 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0005] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=63 command_id=4>
2020-09-25 11:36:31 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0005] ZCL request 0x0004: [0, 1]
2020-09-25 11:36:31 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0005] No handler for cluster command 4
2020-09-25 11:36:31 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=cc:cc:cc:ff:fe:26:a1:48, unique_id=cc:cc:cc:ff:fe:26:a1:48:1:0x0005, endpoint_id=1, cluster_id=5, command=store, args=[0, 1]>

and Longpress S2:

2020-09-25 11:37:15 DEBUG (MainThread) [zigpy_cc.uart] Frame received: <UnpiFrame command_type=CommandType.AREQ subsystem=Subsystem.AF command_id=129 data=b'\x00\x00\x05\x00D\xe4\x01\x01\x00Y\x00\xd6:\xe6\x00\x00\x06\x01@\x04\x00\x00\x02\x06i\x1c' length=26 fcs=27>
2020-09-25 11:37:15 DEBUG (MainThread) [zigpy_cc.api] <-- AREQ AF incomingMsg tsn: None {'groupid': 0, 'clusterid': 5, 'srcaddr': 0xE444, 'srcendpoint': 1, 'dstendpoint': 1, 'wasbroadcast': 0, 'linkquality': 89, 'securityuse': 0, 'timestamp': 15088342, 'transseqnumber': 0, 'len': 6, 'data': b'\x01@\x04\x00\x00\x02'}
2020-09-25 11:37:15 INFO (MainThread) [zigpy_cc.zigbee.application] handle_message incomingMsg
2020-09-25 11:37:15 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0005] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=64 command_id=4>
2020-09-25 11:37:15 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0005] ZCL request 0x0004: [0, 2]
2020-09-25 11:37:15 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0005] No handler for cluster command 4
2020-09-25 11:37:15 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=cc:cc:cc:ff:fe:26:a1:48, unique_id=cc:cc:cc:ff:fe:26:a1:48:1:0x0005, endpoint_id=1, cluster_id=5, command=store, args=[0, 2]>

Longpress off:

2020-09-25 11:39:44 DEBUG (MainThread) [zigpy_cc.uart] Frame received: <UnpiFrame command_type=CommandType.AREQ subsystem=Subsystem.AF command_id=129 data=b'\x00\x00\x08\x00D\xe4\x01\x01\x00Y\x00<O\xed\x00\x00\x05\x01L\x05\x012\x06i\x1c' length=25 fcs=190>
2020-09-25 11:39:44 DEBUG (MainThread) [zigpy_cc.api] <-- AREQ AF incomingMsg tsn: None {'groupid': 0, 'clusterid': 8, 'srcaddr': 0xE444, 'srcendpoint': 1, 'dstendpoint': 1, 'wasbroadcast': 0, 'linkquality': 89, 'securityuse': 0, 'timestamp': 15552316, 'transseqnumber': 0, 'len': 5, 'data': b'\x01L\x05\x012'}
2020-09-25 11:39:44 INFO (MainThread) [zigpy_cc.zigbee.application] handle_message incomingMsg
2020-09-25 11:39:44 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0008] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=76 command_id=5>
2020-09-25 11:39:44 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0008] ZCL request 0x0005: [1, 50]
2020-09-25 11:39:44 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0008] No handler for cluster command 5
2020-09-25 11:39:44 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=cc:cc:cc:ff:fe:26:a1:48, unique_id=cc:cc:cc:ff:fe:26:a1:48:1:0x0008, endpoint_id=1, cluster_id=8, command=move_with_on_off, args=[1, 50]>

and on release:

2020-09-25 11:39:49 DEBUG (MainThread) [zigpy_cc.uart] Frame received: <UnpiFrame command_type=CommandType.AREQ subsystem=Subsystem.AF command_id=129 data=b'\x00\x00\x08\x00D\xe4\x01\x01\x00V\x00\xa7\x90\xed\x00\x00\x03\x01M\x07\x06i\x1c' length=23 fcs=205>
2020-09-25 11:39:49 DEBUG (MainThread) [zigpy_cc.api] <-- AREQ AF incomingMsg tsn: None {'groupid': 0, 'clusterid': 8, 'srcaddr': 0xE444, 'srcendpoint': 1, 'dstendpoint': 1, 'wasbroadcast': 0, 'linkquality': 86, 'securityuse': 0, 'timestamp': 15569063, 'transseqnumber': 0, 'len': 3, 'data': b'\x01M\x07'}
2020-09-25 11:39:49 INFO (MainThread) [zigpy_cc.zigbee.application] handle_message incomingMsg
2020-09-25 11:39:49 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0008] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=77 command_id=7>
2020-09-25 11:39:49 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0008] ZCL request 0x0007: []
2020-09-25 11:39:49 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0008] No handler for cluster command 7
2020-09-25 11:39:49 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=cc:cc:cc:ff:fe:26:a1:48, unique_id=cc:cc:cc:ff:fe:26:a1:48:1:0x0008, endpoint_id=1, cluster_id=8, command=stop, args=[]>

Longpress on:

2020-09-25 11:38:44 DEBUG (MainThread) [zigpy_cc.uart] Frame received: <UnpiFrame command_type=CommandType.AREQ subsystem=Subsystem.AF command_id=129 data=b'\x00\x00\x08\x00D\xe4\x01\x01\x00Q\x00\x7fr\xea\x00\x00\x05\x01I\x05\x002\x06i\x1c' length=25 fcs=203>
2020-09-25 11:38:44 DEBUG (MainThread) [zigpy_cc.api] <-- AREQ AF incomingMsg tsn: None {'groupid': 0, 'clusterid': 8, 'srcaddr': 0xE444, 'srcendpoint': 1, 'dstendpoint': 1, 'wasbroadcast': 0, 'linkquality': 81, 'securityuse': 0, 'timestamp': 15364735, 'transseqnumber': 0, 'len': 5, 'data': b'\x01I\x05\x002'}
2020-09-25 11:38:44 INFO (MainThread) [zigpy_cc.zigbee.application] handle_message incomingMsg
2020-09-25 11:38:44 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0008] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=73 command_id=5>
2020-09-25 11:38:44 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0008] ZCL request 0x0005: [0, 50]
2020-09-25 11:38:44 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0008] No handler for cluster command 5
2020-09-25 11:38:44 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=cc:cc:cc:ff:fe:26:a1:48, unique_id=cc:cc:cc:ff:fe:26:a1:48:1:0x0008, endpoint_id=1, cluster_id=8, command=move_with_on_off, args=[0, 50]>

and on release:

2020-09-25 11:38:49 DEBUG (MainThread) [zigpy_cc.uart] Frame received: <UnpiFrame command_type=CommandType.AREQ subsystem=Subsystem.AF command_id=129 data=b'\x00\x00\x08\x00D\xe4\x01\x01\x00T\x00c\xb6\xea\x00\x00\x03\x01J\x07\x06i\x1c' length=23 fcs=45>
2020-09-25 11:38:49 DEBUG (MainThread) [zigpy_cc.api] <-- AREQ AF incomingMsg tsn: None {'groupid': 0, 'clusterid': 8, 'srcaddr': 0xE444, 'srcendpoint': 1, 'dstendpoint': 1, 'wasbroadcast': 0, 'linkquality': 84, 'securityuse': 0, 'timestamp': 15382115, 'transseqnumber': 0, 'len': 3, 'data': b'\x01J\x07'}
2020-09-25 11:38:49 INFO (MainThread) [zigpy_cc.zigbee.application] handle_message incomingMsg
2020-09-25 11:38:49 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0008] ZCL deserialize: <ZCLHeader frame_control=<FrameControl frame_type=CLUSTER_COMMAND manufacturer_specific=False is_reply=False disable_default_response=False> manufacturer=None tsn=74 command_id=7>
2020-09-25 11:38:49 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0008] ZCL request 0x0007: []
2020-09-25 11:38:49 DEBUG (MainThread) [zigpy.zcl] [0xe444:1:0x0008] No handler for cluster command 7
2020-09-25 11:38:49 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=cc:cc:cc:ff:fe:26:a1:48, unique_id=cc:cc:cc:ff:fe:26:a1:48:1:0x0008, endpoint_id=1, cluster_id=8, command=stop, args=[]>
Adminiuga commented 3 years ago

You already can use it in automation using zha_event differentiating by cluster_id, command and args. For the device_actions to be supported, you would need to map those combinations of cluster_id, command and args into device action and adding it to quirk class

dmulcahey commented 3 years ago

A brief description of how device triggers work is here: https://github.com/zigpy/zha-device-handlers/blob/dev/CONTRIBUTING.md#how-device_automation_triggers-work

Try to implement them using other quirks as a guide. Is this all you are stuck on?

PaulAntonDeen commented 3 years ago

@Adminiuga While it is great that I can make it work by hacking the automations together within HA, I think it would be much nicer if we can get this thing implemented well so that the whole community can benefit. So making the quirk should be better right?

@dmulcahey I have not had the time to try these solutions yet. I was following https://github.com/zigpy/zha-device-handlers/blob/dev/CONTRIBUTING.md so I know I have to write a replacement and some subroutines, but what to write in that section is beyond me.

PaulAntonDeen commented 3 years ago

I got what I need by using the zha_event, thanks for the tip. It is still worth pursuing the quirk I think.

Bascht74 commented 3 years ago

@PaulAntonDeen

Hi Paul,

I started working on the blueprint:

blueprint:
  name: icasa PULSE 8S keypad (ZHA)
  description: 'Control anything using icasa Pulse 8S keypad'
  domain: automation
  input:
    icasa_remote:
      name: Keypad
      description: Keypad to use
      selector:
        device:
          integration: zha
          manufacturer: icasa
          model: ICZB-KPD18S
    button_on:
      name: On Button
      description: Action to run on press on On button
      default: []
      selector:
        action: {}
    button_off:
      name: Off Button
      description: Action to run on press on Off button
      default: []
      selector:
        action: {}
    button_1:
      name: Button S1
      description: Action to run on Button S1
      default: []
      selector:
        action: {}
    button_2:
      name: Button S2
      description: Action to run on Button S2
      default: []
      selector:
        action: {}
    button_3:
      name: Button S3
      description: Action to run on Button S3
      default: []
      selector:
        action: {}
    button_4:
      name: Button S4
      description: Action to run on Button S4
      default: []
      selector:
        action: {}
    button_5:
      name: Button S5
      description: Action to run on Button S5
      default: []
      selector:
        action: {}
    button_6:
      name: Button S6
      description: Action to run on Button S6
      default: []
      selector:
        action: {}
  source_url: https://community.home-assistant.io/t/...
mode: restart
max_exceeded: silent
trigger:
- platform: event
  event_type: zha_event
  event_data:
    device_id: !input icasa_remote

action:
- choose:
  - conditions:
    - condition: template
      value_template: '{%if trigger.event.data.command == "off"%}true{%else%}false{%endif%}'
    sequence: !input 'button_off'
  - conditions:
    - condition: template
      value_template: '{%if trigger.event.data.command == "on"%}true{%else%}false{%endif%}'
    sequence: !input 'button_on'
  - conditions:
    - condition: template
      value_template: '{%if trigger.event.data.command == "recall" and trigger.event.data.args == [0,1]%}true{%else%}false{%endif%}'
    sequence: !input 'button_1'
  - conditions:
    - condition: template
      value_template: '{%if trigger.event.data.command == "recall" and trigger.event.data.args == [0,2]%}true{%else%}false{%endif%}'
    sequence: !input 'button_2'
  - conditions:
    - condition: template
      value_template: '{%if trigger.event.data.command == "recall" and trigger.event.data.args == [0,3]%}true{%else%}false{%endif%}'
    sequence: !input 'button_3'
  - conditions:
    - condition: template
      value_template: '{%if trigger.event.data.command == "recall" and trigger.event.data.args == [0,4]%}true{%else%}false{%endif%}'
    sequence: !input 'button_4'
  - conditions:
    - condition: template
      value_template: '{%if trigger.event.data.command == "recall" and trigger.event.data.args == [0,5]%}true{%else%}false{%endif%}'
    sequence: !input 'button_5'
  - conditions:
    - condition: template
      value_template: '{%if trigger.event.data.command == "recall" and trigger.event.data.args == [0,6]%}true{%else%}false{%endif%}'
    sequence: !input 'button_6'
Hedda commented 3 years ago

FYI, if it helps there is a relative PR with button mappings that deCONZ use for iCasa Pulse 2, Pulse 4S and Pulse 8S here:

https://github.com/dresden-elektronik/deconz-rest-plugin/pull/4160

github-actions[bot] commented 2 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Bascht74 commented 2 years ago

It would be still nice if the device is available in ZHA natively. Any chance?

Hedda commented 2 years ago

It would be still nice if the device is available in ZHA natively. Any chance?

There is a draft pull request here from @Emrvb that you could try -> https://github.com/zigpy/zha-device-handlers/pull/1039

github-actions[bot] commented 2 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Hedda commented 1 year ago

Should probably be re-open and not closed until at least open PR is merged? That PR is still waiting for review -> https://github.com/zigpy/zha-device-handlers/pull/1039

github-actions[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Hedda commented 1 year ago

Should probably be left open at least until PR https://github.com/zigpy/zha-device-handlers/pull/1039 is closed?

github-actions[bot] commented 6 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.