zha-device-handlers: [BUG] SmartThings Button sends same command 3 times

Describe the bug I have several SmartThings Buttons M/N IM6001-BTP01 that have always worked flawlessly in ST and Home Assistant. Firmware version is 0x00000014. A while back they started repeating the same command 3 times. I checked the output of zha_event and confirmed it

Event 2 fired 7:36:

event_type: zha_event
data:
  device_ieee: 28:6d:97:00:01:04:1e:de
  unique_id: 28:6d:97:00:01:04:1e:de:1:0x0500
  device_id: f59f3b82102504ee70ab649e4300fde9
  endpoint_id: 1
  cluster_id: 1280
  command: button_single
  args:
    press_type: single
    command_id: 0
    args:
      - 1
      - 0
      - 0
      - 0
  params: {}
origin: LOCAL
time_fired: "2022-11-10T13:36:04.166296+00:00"
context:
  id: 01GHGW2EJ6R7HEWYYDDQPQW7B8
  parent_id: null
  user_id: null

Event 1 fired 7:36:

event_type: zha_event
data:
  device_ieee: 28:6d:97:00:01:04:1e:de
  unique_id: 28:6d:97:00:01:04:1e:de:1:0x0500
  device_id: f59f3b82102504ee70ab649e4300fde9
  endpoint_id: 1
  cluster_id: 1280
  command: button_single
  args:
    press_type: single
    command_id: 0
    args:
      - 1
      - 0
      - 0
      - 0
  params: {}
origin: LOCAL
time_fired: "2022-11-10T13:36:01.806008+00:00"
context:
  id: 01GHGW2C8ECN2VY6SNNKB53263
  parent_id: null
  user_id: null

Event 0 fired 7:36:

event_type: zha_event
data:
  device_ieee: 28:6d:97:00:01:04:1e:de
  unique_id: 28:6d:97:00:01:04:1e:de:1:0x0500
  device_id: f59f3b82102504ee70ab649e4300fde9
  endpoint_id: 1
  cluster_id: 1280
  command: button_single
  args:
    press_type: single
    command_id: 0
    args:
      - 1
      - 0
      - 0
      - 0
  params: {}
origin: LOCAL
time_fired: "2022-11-10T13:36:00.020955+00:00"
context:
  id: 01GHGW2AGM97XJKBS0WT4A7ZZM
  parent_id: null
  user_id: null

The same thing happens when I double press or hold. As I mentioned above I have multiple of these buttons around the house that were working perfectly fine in HA and they all started having the issue at the same time so I am guessing it has to do with the driver (Quirk: zhaquirks.samjin.button.SamjinButton) for this device.

To Reproduce Steps to reproduce the behavior:

  1. Just press the button while watching the zha_event output

Expected behavior Command should be output just once.

Screenshots n/a

Device signature
{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4673, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": 260,
      "device_type": "0x0402",
      "in_clusters": [
        "0x0000",
        "0x0001",
        "0x0003",
        "0x0020",
        "0x0402",
        "0x0500",
        "0x0b05"
      ],
      "out_clusters": [
        "0x0003",
        "0x0019"
      ]
    }
  },
  "manufacturer": "Samjin",
  "model": "button",
  "class": "zhaquirks.samjin.button.SamjinButton"
}
Diagnostic information
{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2022.11.2",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.10.7",
    "docker": true,
    "arch": "x86_64",
    "timezone": "America/Chicago",
    "os_name": "Linux",
    "os_version": "5.15.74",
    "supervisor": "2022.10.2",
    "host_os": "Home Assistant OS 9.3",
    "docker_version": "20.10.18",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "favicon": {
      "version": "10.4",
      "requirements": []
    },
    "spotcast": {
      "version": "v3.6.30",
      "requirements": [
        "spotify_token==1.0.0"
      ]
    },
    "garbage_collection": {
      "version": "4.8.3",
      "requirements": [
        "python-dateutil>=2.8.2"
      ]
    },
    "zha_toolkit": {
      "version": "v0.8.23",
      "requirements": [
        "packaging>=20.8"
      ]
    },
    "auto_backup": {
      "version": "1.3.0",
      "requirements": []
    },
    "victorsmartkill": {
      "version": "2022.7.1",
      "requirements": [
        "victor-smart-kill==1.1.0"
      ]
    },
    "nws_alerts": {
      "version": "2.5",
      "requirements": []
    },
    "alexa_media": {
      "version": "4.3.2",
      "requirements": [
        "alexapy==1.26.4",
        "packaging>=20.3",
        "wrapt>=1.12.1"
      ]
    },
    "navien_water_heater": {
      "version": "0.0.7",
      "requirements": []
    },
    "keymaster": {
      "version": "v0.0.82",
      "requirements": []
    },
    "nest_protect": {
      "version": "0.3.8",
      "requirements": []
    },
    "browser_mod": {
      "version": "2.1.2",
      "requirements": []
    },
    "watchman": {
      "version": "0.5.1",
      "requirements": [
        "prettytable==3.0.0"
      ]
    },
    "webrtc": {
      "version": "v2.3.1",
      "requirements": []
    },
    "nodered": {
      "version": "1.1.2",
      "requirements": []
    },
    "hacs": {
      "version": "1.28.3",
      "requirements": [
        "aiogithubapi>=22.2.4"
      ]
    }
  },
  "integration_manifest": {
    "domain": "zha",
    "name": "Zigbee Home Automation",
    "config_flow": true,
    "documentation": "https://www.home-assistant.io/integrations/zha",
    "requirements": [
      "bellows==0.34.2",
      "pyserial==3.5",
      "pyserial-asyncio==0.6",
      "zha-quirks==0.0.85",
      "zigpy-deconz==0.19.0",
      "zigpy==0.51.5",
      "zigpy-xbee==0.16.2",
      "zigpy-zigate==0.10.3",
      "zigpy-znp==0.9.1"
    ],
    "usb": [
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*2652*",
        "known_devices": [
          "slae.sh cc2652rb stick"
        ]
      },
      {
        "vid": "1A86",
        "pid": "55D4",
        "description": "*sonoff*plus*",
        "known_devices": [
          "sonoff zigbee dongle plus v2"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*sonoff*plus*",
        "known_devices": [
          "sonoff zigbee dongle plus"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*tubeszb*",
        "known_devices": [
          "TubesZB Coordinator"
        ]
      },
      {
        "vid": "1A86",
        "pid": "7523",
        "description": "*tubeszb*",
        "known_devices": [
          "TubesZB Coordinator"
        ]
      },
      {
        "vid": "1A86",
        "pid": "7523",
        "description": "*zigstar*",
        "known_devices": [
          "ZigStar Coordinators"
        ]
      },
      {
        "vid": "1CF1",
        "pid": "0030",
        "description": "*conbee*",
        "known_devices": [
          "Conbee II"
        ]
      },
      {
        "vid": "10C4",
        "pid": "8A2A",
        "description": "*zigbee*",
        "known_devices": [
          "Nortek HUSBZB-1"
        ]
      },
      {
        "vid": "0403",
        "pid": "6015",
        "description": "*zigate*",
        "known_devices": [
          "ZiGate+"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*zigate*",
        "known_devices": [
          "ZiGate"
        ]
      },
      {
        "vid": "10C4",
        "pid": "8B34",
        "description": "*bv 2010/10*",
        "known_devices": [
          "Bitron Video AV2010/10"
        ]
      }
    ],
    "codeowners": [
      "@dmulcahey",
      "@adminiuga",
      "@puddly"
    ],
    "zeroconf": [
      {
        "type": "_esphomelib._tcp.local.",
        "name": "tube*"
      },
      {
        "type": "_zigate-zigbee-gateway._tcp.local.",
        "name": "*zigate*"
      },
      {
        "type": "_zigstar_gw._tcp.local.",
        "name": "*zigstar*"
      }
    ],
    "dependencies": [
      "file_upload"
    ],
    "after_dependencies": [
      "onboarding",
      "usb",
      "zeroconf"
    ],
    "iot_class": "local_polling",
    "loggers": [
      "aiosqlite",
      "bellows",
      "crccheck",
      "pure_pcapy3",
      "zhaquirks",
      "zigpy",
      "zigpy_deconz",
      "zigpy_xbee",
      "zigpy_zigate",
      "zigpy_znp"
    ],
    "is_built_in": true
  },
  "data": {
    "ieee": "**REDACTED**",
    "nwk": 25971,
    "manufacturer": "Samjin",
    "model": "button",
    "name": "Samjin button",
    "quirk_applied": true,
    "quirk_class": "zhaquirks.samjin.button.SamjinButton",
    "manufacturer_code": 4673,
    "power_source": "Battery or Unknown",
    "lqi": 61,
    "rssi": null,
    "last_seen": "2022-11-10T07:46:53",
    "available": true,
    "device_type": "EndDevice",
    "signature": {
      "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4673, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
      "endpoints": {
        "1": {
          "profile_id": 260,
          "device_type": "0x0402",
          "in_clusters": [
            "0x0000",
            "0x0001",
            "0x0003",
            "0x0020",
            "0x0402",
            "0x0500",
            "0x0b05"
          ],
          "out_clusters": [
            "0x0003",
            "0x0019"
          ]
        }
      }
    },
    "active_coordinator": false,
    "entities": [
      {
        "entity_id": "binary_sensor.guest_bedroom_bedside_button",
        "name": "Samjin button"
      },
      {
        "entity_id": "button.guest_bedroom_bedside_button_identify",
        "name": "Samjin button"
      },
      {
        "entity_id": "sensor.guest_bedroom_bedside_button_battery",
        "name": "Samjin button"
      },
      {
        "entity_id": "sensor.guest_bedroom_bedside_button_temperature",
        "name": "Samjin button"
      }
    ],
    "neighbors": [],
    "endpoint_names": [
      {
        "name": "IAS_ZONE"
      }
    ],
    "user_given_name": "Guest Bedroom Bedside Button",
    "device_reg_id": "f59f3b82102504ee70ab649e4300fde9",
    "area_id": "remotes",
    "cluster_details": {
      "1": {
        "device_type": {
          "name": "IAS_ZONE",
          "id": 1026
        },
        "profile_id": 260,
        "in_clusters": {
          "0x0000": {
            "endpoint_attribute": "basic",
            "attributes": {
              "0x0004": {
                "attribute_name": "manufacturer",
                "value": "Samjin"
              },
              "0x0005": {
                "attribute_name": "model",
                "value": "button"
              }
            },
            "unsupported_attributes": {}
          },
          "0x0001": {
            "endpoint_attribute": "power",
            "attributes": {
              "0x0020": {
                "attribute_name": "battery_voltage",
                "value": 27
              },
              "0x0021": {
                "attribute_name": "battery_percentage_remaining",
                "value": 193
              }
            },
            "unsupported_attributes": {
              "0x0031": {
                "attribute_name": "battery_size"
              },
              "0x0033": {
                "attribute_name": "battery_quantity"
              }
            }
          },
          "0x0003": {
            "endpoint_attribute": "identify",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0020": {
            "endpoint_attribute": "poll_control",
            "attributes": {
              "0x0000": {
                "attribute_name": "checkin_interval",
                "value": 13200
              }
            },
            "unsupported_attributes": {}
          },
          "0x0402": {
            "endpoint_attribute": "temperature",
            "attributes": {
              "0x0000": {
                "attribute_name": "measured_value",
                "value": 2698
              }
            },
            "unsupported_attributes": {}
          },
          "0x0500": {
            "endpoint_attribute": "ias_zone",
            "attributes": {
              "0x0000": {
                "attribute_name": "zone_state",
                "value": 1
              },
              "0x0001": {
                "attribute_name": "zone_type",
                "value": 32768
              },
              "0x0002": {
                "attribute_name": "zone_status",
                "value": 0
              },
              "0x0010": {
                "attribute_name": "cie_addr",
                "value": "00:12:4b:00:24:c3:15:9f"
              }
            },
            "unsupported_attributes": {}
          },
          "0x0b05": {
            "endpoint_attribute": "diagnostic",
            "attributes": {},
            "unsupported_attributes": {}
          }
        },
        "out_clusters": {
          "0x0003": {
            "endpoint_attribute": "identify",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0019": {
            "endpoint_attribute": "ota",
            "attributes": {},
            "unsupported_attributes": {}
          }
        }
      }
    }
  }
}
Additional logs
Paste any additional debug logs here.
Don't remove the extra line breaks outside the ``` marks.

Additional context Add any other context about the problem here.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 15 (3 by maintainers)

Most upvoted comments

Mine used to work flawlessly and then started having issues after some HA upgrade. Now I know that a single press to turn my LIFX light off will result in off, on, off. I just got used to it…

Started seeing this about a month back. Didn’t happen before. I have a Aeotec Samjij Button with a TI chip. Other zigbee devices work normally.

@puddly Have you had a chance to look into this? Even with the latest release the issue is still present.