home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
74.01k stars 31.05k forks source link

ZHA phantom event #126985

Open froggy974 opened 2 months ago

froggy974 commented 2 months ago

The problem

Hi, i have an issue on ZHA with a Legrand Double gangs remote switch

when I hit the button , it send a first event, then , 10 second later it send the same event ( without any physical action), kind of "phantom" event which is anoying when this action is used for toggle light

does anyone experiment the same issue with this device ?

event_type: zha_event
data:
  device_ieee: 00:04:74:00:00:c9:29:a6
  unique_id: 00:04:74:00:00:c9:29:a6:1:0x0006
  device_id: 220efc189b3ce8a9048bf37a1f3a14d6
  endpoint_id: 1
  cluster_id: 6
  command: "on"
  args: []
  params: {}
origin: LOCAL
time_fired: "2024-09-28T08:44:36.608682+00:00"
context:
  id: 01J8VWV8W047SKKW0DES7CBQDH
  parent_id: null
  user_id: null
event_type: zha_event
data:
  device_ieee: 00:04:74:00:00:c9:29:a6
  unique_id: 00:04:74:00:00:c9:29:a6:1:0x0006
  device_id: 220efc189b3ce8a9048bf37a1f3a14d6
  endpoint_id: 1
  cluster_id: 6
  command: "on"
  args: []
  params: {}
origin: LOCAL
time_fired: "2024-09-28T08:44:47.924292+00:00"

context:
  id: 01J8VWVKXM0CNP60J5TR86YHSH
  parent_id: null
  user_id: null

What version of Home Assistant Core has the issue?

core-2024.9.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

ZHA

Link to integration documentation on our website

https://www.home-assistant.io/integrations/zha/

Diagnostics information

zha- Legrand Double gangs remote switch-diagnostic.json

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 month ago

Hey there @dmulcahey, @adminiuga, @puddly, @thejulianjes, mind taking a look at this issue as it has been labeled with an integration (zha) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `zha` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign zha` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


zha documentation zha source (message by IssueLinks)

puddly commented 1 month ago

Please enable ZHA debug logging, press the button, and then disable it 30s later to download a log.

froggy974 commented 1 month ago

thanks for your support here is the debug when i captured random events

error_log-2.log

dmulcahey commented 1 month ago

thanks for your support here is the debug when i captured random events

error_log-2.log

Search the log for "emitting event zha_event" and you will see directly above it each time:

2024-10-04 08:26:53.594 DEBUG (MainThread) [bellows.ezsp.protocol] Received command incomingMessageHandler: {'type': <EmberIncomingMessageType.INCOMING_UNICAST: 0>, 'apsFrame': EmberApsFrame(profileId=260, clusterId=6, sourceEndpoint=2, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_RETRY|APS_OPTION_ENABLE_ROUTE_DISCOVERY: 320>, groupId=0, sequence=103), 'lastHopLqi': 172, 'lastHopRssi': -57, 'sender': 0x8014, 'bindingIndex': 255, 'addressIndex': 12, 'messageContents': b'\x11\x03\x01'}
2024-10-04 08:26:53.595 DEBUG (MainThread) [bellows.ezsp.protocol] Frame contains trailing data: b'\x04'
2024-10-04 08:26:53.599 DEBUG (MainThread) [bellows.zigbee.application] Received incomingMessageHandler frame with [<EmberIncomingMessageType.INCOMING_UNICAST: 0>, EmberApsFrame(profileId=260, clusterId=6, sourceEndpoint=2, destinationEndpoint=1, options=<EmberApsOption.APS_OPTION_RETRY|APS_OPTION_ENABLE_ROUTE_DISCOVERY: 320>, groupId=0, sequence=103), 172, -57, 0x8014, 255, 12, b'\x11\x03\x01']
2024-10-04 08:26:53.600 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(timestamp=datetime.datetime(2024, 10, 4, 6, 26, 53, 600400, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x8014), src_ep=2, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=103, profile_id=260, cluster_id=6, data=Serialized[b'\x11\x03\x01'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=172, rssi=-57)
2024-10-04 08:26:53.606 DEBUG (MainThread) [zigpy.zcl] [0x8014:2:0x0006] Received ZCL frame: b'\x11\x03\x01'
2024-10-04 08:26:53.607 DEBUG (MainThread) [zigpy.zcl] [0x8014:2:0x0006] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl<0x11>(frame_type=<FrameType.CLUSTER_COMMAND: 1>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 0>, disable_default_response=1, reserved=0, *is_cluster=True, *is_general=False), tsn=3, command_id=1, *direction=<Direction.Client_to_Server: 0>)
2024-10-04 08:26:53.608 DEBUG (MainThread) [zigpy.zcl] [0x8014:2:0x0006] Decoded ZCL frame: OnOff:on()
2024-10-04 08:26:53.609 DEBUG (MainThread) [zigpy.zcl] [0x8014:2:0x0006] Received command 0x01 (TSN 3): on()
2024-10-04 08:26:53.610 DEBUG (MainThread) [zigpy.zcl] [0x8014:2:0x0006] No explicit handler for cluster command 0x01: on()
2024-10-04 08:26:53.610 DEBUG (MainThread) [zha] Emitting event zha_event with data ZHAEvent(device_ieee=00:04:74:00:00:c9:29:a6, unique_id='00:04:74:00:00:c9:29:a6', data={'unique_id': '00:04:74:00:00:c9:29:a6:2:0x0006', 'endpoint_id': 2, 'cluster_id': 6, 'command': 'on', 'args': [], 'params': {}}, event_type='zha_event', event='zha_event') (1 listeners)

the device is sending the messages... There is nothing we can do to prevent this.

puddly commented 1 month ago

Can you upload diagnostics for the entire ZHA integration? I've found that some devices re-send data if they are in a spot with RF interference and never receive a reply from the coordinator.

froggy974 commented 1 month ago

Can you upload diagnostics for the entire ZHA integration? I've found that some devices re-send data if they are in a spot with RF interference and never receive a reply from the coordinator.

here is the ZHA integration diagnostic config_entry-zha-1e0d99d4da9c51d65ec9f318abc85210 (15).json