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

[BUG] Aqara vibration sensor quirk is not working correctly #1296

Closed
sergey-suloev opened this issue Jan 20, 2022 · 27 comments
Closed

[BUG] Aqara vibration sensor quirk is not working correctly #1296

sergey-suloev opened this issue Jan 20, 2022 · 27 comments
Labels
stale Issue is inactivate and might get closed soon support This request is likely unrelated to quirks and more of a support ticket (e.g. network issues)

Comments

@sergey-suloev
Copy link
Contributor

sergey-suloev commented Jan 20, 2022

Aqara vibration sensor claimed to be supported but it is not. See the attached screenshot.

Screenshot from 2022-01-20 15-02-17

@sergey-suloev sergey-suloev changed the title [BUG] Aqara vibration sensor claimed to be supported [BUG] Aqara vibration sensor quirk is not working correctly Jan 20, 2022
@sergey-suloev
Copy link
Contributor Author

sergey-suloev commented Jan 20, 2022

{
  "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=4151, maximum_buffer_size=127, maximum_incoming_transfer_size=100, server_mask=0, maximum_outgoing_transfer_size=100, 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": "0x000a",
      "in_clusters": [
        "0x0000",
        "0x0001",
        "0x0003",
        "0x0019",
        "0x0101",
        "0x0500"
      ],
      "out_clusters": [
        "0x0000",
        "0x0003",
        "0x0004",
        "0x0005",
        "0x0019"
      ]
    },
    "2": {
      "profile_id": 260,
      "device_type": "0x5f02",
      "in_clusters": [
        "0x0003"
      ],
      "out_clusters": [
        "0x0003",
        "0x0004",
        "0x0005",
        "0x0012"
      ]
    }
  },
  "manufacturer": "LUMI",
  "model": "lumi.vibration.aq1",
  "class": "zhaquirks.xiaomi.aqara.vibration_aq1.VibrationAQ1"
}

@MattWestb
Copy link
Contributor

Do you get any zha_event and is the ISA Zone changing status ?
The "class": "zhaquirks.xiaomi.aqara.vibration_aq1.VibrationAQ1" is saying ZHA have loading one quirk for your device = its supported by one quirk (then its not one Zigbee certified device = bad working device).

@sergey-suloev
Copy link
Contributor Author

sergey-suloev commented Jan 20, 2022

@MattWestb I'm not sure I fully understand what you are saying. My device is 100% official and certified. It is well supported by Zigbee2Mqtt. I bought it from an official Xiaomi store.
I have attached a few records from the log, all what I was able to find regarding this sensor.

@sergey-suloev
Copy link
Contributor Author

sergey-suloev commented Jan 20, 2022

Logs
2022-01-20 11:26:25 INFO (MainThread) [zigpy_xbee.zigbee.application] New device joined: NWK 0x4a1c, IEEE 00:15:8d:00:04:83:5e:06
2022-01-20 11:26:25 INFO (MainThread) [zigpy.application] New device 0x4a1c (00:15:8d:00:04:83:5e:06) joined the network
2022-01-20 11:26:25 DEBUG (MainThread) [zigpy.device] [0x4a1c] Scheduling initialization
2022-01-20 11:26:25 DEBUG (MainThread) [zigpy.application] Received frame on uninitialized device <Device model=None manuf=None nwk=0x4A1C ieee=00:15:8d:00:04:83:5e:06 is_initialized=False> from ep 0 to ep 0, cluster 19: b'\x14\x1cJ\x06^\x83\x04\x00\x8d\x15\x00\x80'
2022-01-20 11:26:25 DEBUG (MainThread) [zigpy.zdo] [0x4a1c:zdo] ZDO request ZDOCmd.Device_annce: [0x4A1C, 00:15:8d:00:04:83:5e:06, 128]
2022-01-20 11:26:25 DEBUG (MainThread) [zigpy.util] Tries remaining: 3
2022-01-20 11:26:25 INFO (MainThread) [zigpy.device] [0x4a1c] Requesting 'Node Descriptor'
2022-01-20 11:26:25 DEBUG (MainThread) [zigpy.util] Tries remaining: 2
2022-01-20 11:26:25 DEBUG (MainThread) [zigpy.device] [0x4a1c] Extending timeout for 0x28 request
2022-01-20 11:26:25 DEBUG (MainThread) [zigpy_xbee.zigbee.application] Zigbee request tsn #40: b'281c4a'
2022-01-20 11:26:25 DEBUG (MainThread) [zigpy_xbee.api] Command tx_explicit (00:15:8d:00:04:83:5e:06, 0x4A1C, 0, 0, <ZDOCmd.Node_Desc_req: 0x0002>, 0, 0, 64, b'(\x1cJ')
2022-01-20 11:26:25 DEBUG (MainThread) [zigpy_xbee.uart] Sending: b'\x11K\x00\x15\x8d\x00\x04\x83^\x06J\x1c\x00\x00\x00\x02\x00\x00\x00@(\x1cJ'
2022-01-20 11:26:25 DEBUG (MainThread) [zigpy_xbee.uart] Frame received: b'\x91\x00\x15\x8d\x00\x04\x83^\x06J\x1c\x01\x01\x00\x00\x01\x04\x00\x18\x00\n\x05\x00B\x12lumi.vibration.aq1\x01\x00 \x08'
2022-01-20 11:26:25 DEBUG (MainThread) [zigpy_xbee.api] Frame received: explicit_rx_indicator
2022-01-20 11:26:25 DEBUG (MainThread) [zigpy_xbee.api] _handle_explicit_rx: (00:15:8d:00:04:83:5e:06, 0x4a1c, 1, 0, 0, b'18000a050042126c756d692e766962726174696f6e2e61713101002008')
2022-01-20 11:26:25 DEBUG (MainThread) [zigpy.application] Received frame on uninitialized device <Device model=None manuf=None nwk=0x4A1C ieee=00:15:8d:00:04:83:5e:06 is_initialized=False> from ep 1 to ep 1, cluster 0: b'\x18\x00\n\x05\x00B\x12lumi.vibration.aq1\x01\x00 \x08'
2022-01-20 11:26:25 DEBUG (MainThread) [zigpy.device] [0x4a1c] Received ZCL while uninitialized on endpoint id 1, cluster 0x0000 id, hdr: <ZCLHeader frame_control=<FrameControl frame_type=GLOBAL_COMMAND manufacturer_specific=False is_reply=True disable_default_response=True> manufacturer=None tsn=0 command_id=Command.Report_Attributes>, payload: b'\x05\x00B\x12lumi.vibration.aq1\x01\x00 \x08'
2022-01-20 11:26:25 DEBUG (MainThread) [zigpy.device] [0x4a1c] Uninitialized device command 'Command.Report_Attributes' args: [[Attribute(attrid=5, value=<TypeValue type=CharacterString, value=lumi.vibration.aq1>), Attribute(attrid=1, value=<TypeValue type=uint8_t, value=8>)]]
2022-01-20 11:26:25 DEBUG (MainThread) [zigpy.device] [0x4a1c] Found 'VibrationAQ1' quirk for 'lumi.vibration.aq1' model
2022-01-20 11:26:25 DEBUG (MainThread) [zigpy.device] [0x4a1c] Canceling old initialize call
2022-01-20 11:26:25 DEBUG (MainThread) [zigpy.application] Device is initialized <Device model='lumi.vibration.aq1' manuf='LUMI' nwk=0x4A1C ieee=00:15:8d:00:04:83:5e:06 is_initialized=True>
2022-01-20 11:26:25 DEBUG (MainThread) [zigpy.quirks.registry] Checking quirks for LUMI lumi.vibration.aq1 (00:15:8d:00:04:83:5e:06)
2022-01-20 11:26:25 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.xiaomi.aqara.vibration_aq1.VibrationAQ1'>
2022-01-20 11:26:25 DEBUG (MainThread) [zigpy.quirks.registry] Found custom device replacement for 00:15:8d:00:04:83:5e:06: <class 'zhaquirks.xiaomi.aqara.vibration_aq1.VibrationAQ1'>
2022-01-20 11:26:25 INFO (MainThread) [zigpy.device] [0x4a1c] Was quickly initialized from 'zhaquirks.xiaomi.aqara.vibration_aq1.VibrationAQ1' quirk
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event device_registry_updated[L]: action=create, device_id=cabc8e15b86973f10829a99594f12e1b>
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.gateway] device - 0x4A1C:00:15:8d:00:04:83:5e:06 entering async_device_initialized - is_new_join: True
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.gateway] device - 0x4A1C:00:15:8d:00:04:83:5e:06 has joined the ZHA zigbee network
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x4A1C](lumi.vibration.aq1): started configuration
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x4A1C:ZDO](lumi.vibration.aq1): 'async_configure' stage succeeded
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x4A1C:1:0x0500]: skipping IASZoneChannel configuration
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x4A1C:1:0x0001]: skipping channel configuration
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x4A1C:1:0x0000]: skipping channel configuration
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x4A1C:1:0x0019]: skipping channel configuration
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x4A1C:1:0x0005]: skipping channel configuration
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x4A1C:2:0x0005]: skipping channel configuration
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x4A1C:1:0x0500]: 'async_configure' stage succeeded
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x4A1C:1:0x0001]: 'async_configure' stage succeeded
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x4A1C:1:0x0000]: 'async_configure' stage succeeded
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x4A1C:1:0x0019]: 'async_configure' stage succeeded
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x4A1C:1:0x0005]: 'async_configure' stage succeeded
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x4A1C:2:0x0005]: 'async_configure' stage succeeded
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x4A1C](lumi.vibration.aq1): completed configuration
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x4A1C](lumi.vibration.aq1): stored in registry: ZhaDeviceEntry(name='LUMI lumi.vibration.aq1', ieee='00:15:8d:00:04:83:5e:06', last_seen=1642667185.0141988)
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x4A1C](lumi.vibration.aq1): started initialization
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x4A1C:ZDO](lumi.vibration.aq1): 'async_initialize' stage succeeded
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x4A1C:1:0x0500]: 'async_initialize' stage succeeded
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x4A1C:1:0x0001]: 'async_initialize' stage succeeded
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x4A1C:1:0x0000]: 'async_initialize' stage succeeded
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x4A1C:1:0x0019]: 'async_initialize' stage succeeded
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x4A1C:1:0x0005]: 'async_initialize' stage succeeded
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x4A1C:2:0x0005]: 'async_initialize' stage succeeded
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x4A1C](lumi.vibration.aq1): power source: Battery or Unknown
2022-01-20 11:26:25 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x4A1C](lumi.vibration.aq1): completed initialization

2022-01-20 11:31:54 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=binary_sensor.lumi_lumi_vibration_aq1_065e8304_ias_zone, old_state=<state binary_sensor.lumi_lumi_vibration_aq1_065e8304_ias_zone=off; device_class=vibration, friendly_name=LUMI lumi.vibration.aq1 065e8304 ias_zone @ 2022-01-20T11:26:25.163218+03:00>, new_state=<state binary_sensor.lumi_lumi_vibration_aq1_065e8304_ias_zone=unavailable; restored=True, device_class=vibration, friendly_name=LUMI lumi.vibration.aq1 065e8304 ias_zone, supported_features=0 @ 2022-01-20T11:31:54.400162+03:00>>
2022-01-20 11:31:54 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.lumi_lumi_vibration_aq1_065e8304_power, old_state=<state sensor.lumi_lumi_vibration_aq1_065e8304_power=44; state_class=measurement, battery_voltage=2.94, unit_of_measurement=%, device_class=battery, friendly_name=LUMI lumi.vibration.aq1 065e8304 power @ 2022-01-20T11:26:26.294823+03:00>, new_state=<state sensor.lumi_lumi_vibration_aq1_065e8304_power=unavailable; restored=True, state_class=measurement, device_class=battery, friendly_name=LUMI lumi.vibration.aq1 065e8304 power, supported_features=0, unit_of_measurement=% @ 2022-01-20T11:31:54.409703+03:00>>


2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor 0x00158d0004835e06 battery
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor 0x00158d0004835e06 action
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor 0x00158d0004835e06 strength
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor 0x00158d0004835e06 sensitivity
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor 0x00158d0004835e06 angle_x
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor 0x00158d0004835e06 angle_y
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor 0x00158d0004835e06 angle_z
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor 0x00158d0004835e06 voltage
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor 0x00158d0004835e06 linkquality
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: select 0x00158d0004835e06 sensitivity
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: binary_sensor 0x00158d0004835e06 vibration
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: device_automation 0x00158d0004835e06 action_vibration
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: device_automation 0x00158d0004835e06 action_tilt

2022-01-20 11:36:24 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.0x00158d0004835e06_battery, old_state=None, new_state=<state sensor.0x00158d0004835e06_battery=unavailable; state_class=measurement, unit_of_measurement=%, device_class=battery, friendly_name=Датчик кровати battery @ 2022-01-20T11:36:24.710919+03:00>>
2022-01-20 11:36:24 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.0x00158d0004835e06_action, old_state=None, new_state=<state sensor.0x00158d0004835e06_action=unavailable; icon=mdi:gesture-double-tap, friendly_name=Датчик кровати action @ 2022-01-20T11:36:24.711739+03:00>>
2022-01-20 11:36:24 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.0x00158d0004835e06_strength, old_state=None, new_state=<state sensor.0x00158d0004835e06_strength=unavailable; friendly_name=Датчик кровати strength @ 2022-01-20T11:36:24.787165+03:00>>
2022-01-20 11:36:24 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.0x00158d0004835e06_angle_x, old_state=None, new_state=<state sensor.0x00158d0004835e06_angle_x=unavailable; friendly_name=Датчик кровати angle x @ 2022-01-20T11:36:24.788047+03:00>>
2022-01-20 11:36:24 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.0x00158d0004835e06_angle_y, old_state=None, new_state=<state sensor.0x00158d0004835e06_angle_y=unavailable; friendly_name=Датчик кровати angle y @ 2022-01-20T11:36:24.788603+03:00>>
2022-01-20 11:36:24 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.0x00158d0004835e06_angle_z, old_state=None, new_state=<state sensor.0x00158d0004835e06_angle_z=unavailable; friendly_name=Датчик кровати angle z @ 2022-01-20T11:36:24.789116+03:00>>
2022-01-20 11:36:24 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=select.0x00158d0004835e06_sensitivity, old_state=None, new_state=<state select.0x00158d0004835e06_sensitivity=unavailable; options=['low', 'medium', 'high'], icon=mdi:tune, friendly_name=Датчик кровати sensitivity @ 2022-01-20T11:36:24.961405+03:00>>
2022-01-20 11:36:24 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=binary_sensor.0x00158d0004835e06_vibration, old_state=None, new_state=<state binary_sensor.0x00158d0004835e06_vibration=unavailable; device_class=vibration, friendly_name=Датчик кровати vibration @ 2022-01-20T11:36:24.965337+03:00>>

2022-01-20 11:36:25 DEBUG (MainThread) [zigpy.quirks.registry] Checking quirks for LUMI lumi.vibration.aq1 (00:15:8d:00:04:83:5e:06)
2022-01-20 11:36:25 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.xiaomi.aqara.vibration_aq1.VibrationAQ1'>
2022-01-20 11:36:25 DEBUG (MainThread) [zigpy.quirks.registry] Found custom device replacement for 00:15:8d:00:04:83:5e:06: <class 'zhaquirks.xiaomi.aqara.vibration_aq1.VibrationAQ1'>

2022-01-20 11:36:26 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.lumi_lumi_vibration_aq1_065e8304_power, old_state=None, new_state=<state sensor.lumi_lumi_vibration_aq1_065e8304_power=44; state_class=measurement, battery_voltage=2.94, unit_of_measurement=%, device_class=battery, friendly_name=LUMI lumi.vibration.aq1 065e8304 power @ 2022-01-20T11:36:26.516517+03:00>>

2022-01-20 11:36:26 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=binary_sensor.lumi_lumi_vibration_aq1_065e8304_ias_zone, old_state=None, new_state=<state binary_sensor.lumi_lumi_vibration_aq1_065e8304_ias_zone=off; device_class=vibration, friendly_name=LUMI lumi.vibration.aq1 065e8304 ias_zone @ 2022-01-20T11:36:26.547687+03:00>>

2022-01-20 12:28:24 DEBUG (MainThread) [zigpy_xbee.api] _handle_explicit_rx: (00:15:8d:00:04:83:5e:06, 0x4a1c, 1, 0, 0, b'1c5f11020a01ff422e0121db0b03281b0421a8130521180006240100000000082108030a21000098212800992100009a251800fdffeffc')
2022-01-20 12:28:24 DEBUG (MainThread) [zhaquirks.xiaomi] 00:15:8d:00:04:83:5e:06 - Attribute report. attribute_id: [65281] value: [{'battery_voltage_mV': 3035, 'temperature': 27, 'X-attrib-4': 5032, 'X-attrib-5': 24, 'X-attrib-6': 1, '0xff01-8': 776, 'path': 0, '0xff01-152': 40, '0xff01-153': 0, '0xff01-154': 278107722154008}]

@MattWestb
Copy link
Contributor

Sorry but Aqara (Xiaomi) is not good making Zigbee compliant products but they have doing some . . . But i cant finding the certificate for your device https://csa-iot.org/csa-iot_products/page/2/?p_keywords=Lumi+United&p_type=14&p_certificate.
But its not interesting then your device have being patches for working OK in ZHA.

Then posting code blocks please put ``` on one empty line before and after the code so its not losing its formation.

ZHA have finding:

2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor 0x00158d0004835e06 battery
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor 0x00158d0004835e06 action
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor 0x00158d0004835e06 strength
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor 0x00158d0004835e06 sensitivity
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor 0x00158d0004835e06 angle_x
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor 0x00158d0004835e06 angle_y
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor 0x00158d0004835e06 angle_z
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor 0x00158d0004835e06 voltage
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: sensor 0x00158d0004835e06 linkquality
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: select 0x00158d0004835e06 sensitivity
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: binary_sensor 0x00158d0004835e06 vibration
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: device_automation 0x00158d0004835e06 action_vibration
2022-01-20 11:36:19 INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: device_automation 0x00158d0004835e06 action_tilt

Some of the functions have device automations that you finding on the device card and the + on the side of "Automations".

HA is all about events and if you going to development tools > events > Listen to events and putting in zha_event and clicking start listening you shall getting all events ZHA is getting from your devices like tilt angle and so on.

@sergey-suloev
Copy link
Contributor Author

sergey-suloev commented Jan 20, 2022

@MattWestb It's probably not certified, I have no idea. But you can buy it from any official Xiaomi store.
https://www.zigbee2mqtt.io/devices/DJT11LM.html

https://www.aqara.com/us/vibration_sensor.html

https://www.amazon.com/dp/B07PJT939B

@MattWestb
Copy link
Contributor

Certifying Zigbee devices is costing money and also being member of the alliance so many is not doing it and is putting the Zigbee logo on there products and cont care if the device is working with other system or not.
The latest large is tuya they is one board member but is only certifying products that LIDL and other customer is demanding certificate.

Aqara / Xiaomi was very much problem but then is being better but nearly all ther sensor need quirk for working at all in open systems but the community have learned how they is working and support is normally being fixed but they is doing new versions with changed functions all the time.

Better you is looking if all functions is working OK for your devices then discussing "bad devoices" ;-))

@sergey-suloev
Copy link
Contributor Author

sergey-suloev commented Jan 20, 2022

@MattWestb There is no possibility to handle DROP event. And it is not reporting angles.
Here is what I can see when I click on Automations+

Screenshot from 2022-01-20 19-00-19

@MattWestb
Copy link
Contributor

I think both you need listening to zha_events to see them and if making automations you shall triggering it on the information you is getting as events.
Its not realistic making device automations for all possible 360° so you need doing them self.
You can also using template sensors and making sensors that doing the listening on events and you is getting the value in HA GUI.

@javicalle
Copy link
Collaborator

It seems that there is not a 'direct' way to get the values that you want.
You will need to handle state changes using zha_events. It's not the friendliest way and it's going to force you to struggle with templates and automations, but it's the way to do it.

You can get a lot of information in the HA forums:

I hope this helps you.

@sergey-suloev
Copy link
Contributor Author

@javicalle Thank you for the information. Don't you think though that zha quirk for the device must be improved instead ?

@dmulcahey
Copy link
Collaborator

The angles and the drop event are handled as events. The vibration detection gives you a binary sensor. Drop and the angles are events intentionally. The angles are relative and the drop event is momentary. Having entities for these doesn’t make a ton of sense.

@sergey-suloev
Copy link
Contributor Author

sergey-suloev commented Jan 20, 2022

@dmulcahey I agree about the drop. But for angles Z2M provides sensors which does make sense IMHO. Z2M also provides select.0x00000000_sensitivity which is good.

@Adminiuga
Copy link
Contributor

Adminiuga commented Jan 22, 2022

use zha_events for angles. if really need entities, then update a number entity based on zha_event.
I concur, using entities for angles does not make sense, as those are transient events.

@sergey-suloev
Copy link
Contributor Author

@Adminiuga What is the difference between vibration , tilt, drop and angles ? All are events, in general. Why should only vibration be an entity ?

@schwickster
Copy link
Contributor

I have the same sensor in ZHA and for me it works fine. As in the screenshot I have the same entities. As people are mentioning, for angles, vibrations and axes (coming in the next release) you need to read from ZHA event.

@martin3000
Copy link
Contributor

I have the problem that the vibration events need 25s to arrive in home assistant.

@github-actions
Copy link

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.

@github-actions github-actions bot added the stale Issue is inactivate and might get closed soon label Aug 18, 2022
@SamJongenelen
Copy link

Not stale to me. I would like to also see a more user friendly solution to automate using Aqara devices.
These (uncertified) devices are used a lot by Zigbee HA users I would assume - and not having a nice way to do automations for it (albeit events or sensors).

@github-actions github-actions bot removed the stale Issue is inactivate and might get closed soon label Aug 19, 2022
@terjew
Copy link

terjew commented Aug 28, 2022

I have browsed through the different threads linked here, but I am still a bit confused as to how I can access the orientation from this device. It seems like many of the threads refer to other integrations such as deconz, and thus are not applicable for zha. Is it possible to create a template sensor that updates some numerical values whenever the orientation changes?

@Adminiuga
Copy link
Contributor

Create an automation triggered by zha event and update the multiselect helper accordingly

@terjew
Copy link

terjew commented Aug 28, 2022

For anyone with the same use case, I got it working with the following:

  - trigger:
      - platform: event
        event_type: "zha_event"
        event_data:
          device_id: 9f43c386f952703e241d4b18d0504b03
          command: 'current_orientation'
    sensor:
      - name: "Garage door orientation X"
        state: "{{ trigger.event.data.args.X }}"
        unique_id: bc6fa84a-1346-4103-b144-b6cf95f94fb2
      - name: "Garage door orientation Y"
        state: "{{ trigger.event.data.args.Y }}"
        unique_id: 3be9e412-c52e-4676-9948-b7807eec62ac
      - name: "Garage door orientation Z"
        state: "{{ trigger.event.data.args.Z }}"
        unique_id: 5b8c75bf-55aa-4317-8ab3-18394d83b62a

However, the problem now is that the current_orientation events are only being fired around once per minute, so it is really not very useful after all. I assume this is a problem on the Aqara side?

@SamJongenelen
Copy link

Could that be a sensitivity setting perhaps? IIRC I tested a Vibration sensor in Zigbee2Mqtt and the sensor updated nearly instant

@TheJulianJES TheJulianJES added the support This request is likely unrelated to quirks and more of a support ticket (e.g. network issues) label Jan 5, 2023
@klepper19
Copy link

For anyone with the same use case, I got it working with the following:

  - trigger:
      - platform: event
        event_type: "zha_event"
        event_data:
          device_id: 9f43c386f952703e241d4b18d0504b03
          command: 'current_orientation'
    sensor:
      - name: "Garage door orientation X"
        state: "{{ trigger.event.data.args.X }}"
        unique_id: bc6fa84a-1346-4103-b144-b6cf95f94fb2
      - name: "Garage door orientation Y"
        state: "{{ trigger.event.data.args.Y }}"
        unique_id: 3be9e412-c52e-4676-9948-b7807eec62ac
      - name: "Garage door orientation Z"
        state: "{{ trigger.event.data.args.Z }}"
        unique_id: 5b8c75bf-55aa-4317-8ab3-18394d83b62a

However, the problem now is that the current_orientation events are only being fired around once per minute, so it is really not very useful after all. I assume this is a problem on the Aqara side?

I appreciate you posted this! My vibration sensors show the orientation in my project and the update rate is nearly instant. Using Conbee 2 with Raspberry pi and ZHA. No further settings changed. Might be a newer firmware on the vibration sensor/ZHA/Conbee?

@mox1
Copy link

mox1 commented Apr 6, 2023

So I have this sensor attached to my garage door. I don't care about vibration, I just want Tilt.
Looking through my home assist debug logs, I see a zha firing "Tilt" events, with an angle.

Would it be possible simply expose the current Tilt angle (or last reported angle I guess)? This would really help with creating automatons around it. Please not that my sensor is NOT reporting relative values. It is reporting absolute angle where standing on its edge == 9 degrees and lying flat face down == 180.

Open garage door:
Apr 6 12:31:43 server1 docker-compose[2470]: homeassistant | #033[36m2023-04-06 12:31:43.938 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=00:15:8d:00:07:09:de:ed, unique_id=00:15:8d:00:07:09:de:ed:1:0x0500, device_id=8bf5abeb52b706beefbaf493466b25c1, endpoint_id=1, cluster_id=1280, command=Tilt, args=degrees=104, params=>#033[0m

Close:
Apr 6 12:32:31 server1 docker-compose[2470]: homeassistant | #033[36m2023-04-06 12:32:31.561 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=00:15:8d:00:07:09:de:ed, unique_id=00:15:8d:00:07:09:de:ed:1:0x0500, device_id=8bf5abeb52b706beefbaf493466b25c1, endpoint_id=1, cluster_id=1280, command=Tilt, args=degrees=18, params=>#033[0m
Open:
Apr 6 13:00:01 server1 docker-compose[2470]: homeassistant | #033[36m2023-04-06 13:00:01.366 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=00:15:8d:00:07:09:de:ed, unique_id=00:15:8d:00:07:09:de:ed:1:0x0500, device_id=8bf5abeb52b706beefbaf493466b25c1, endpoint_id=1, cluster_id=1280, command=Tilt, args=degrees=105, params=>#033[0m
Close:
Apr 6 13:00:34 server1 docker-compose[2470]: homeassistant | #033[36m2023-04-06 13:00:34.710 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[L]: device_ieee=00:15:8d:00:07:09:de:ed, unique_id=00:15:8d:00:07:09:de:ed:1:0x0500, device_id=8bf5abeb52b706beefbaf493466b25c1, endpoint_id=1, cluster_id=1280, command=Tilt, args=degrees=18, params=>#033[0m

@mekaneck
Copy link

Would it be possible simply expose the current Tilt angle (or last reported angle I guess)?

It's easier to see & read the events by using the "events" tab in the developer tools and subscribing to zha_event. But there's enough info with what you posted. You can use a template sensor

template:
  - trigger:
      - platform: event
        event_type: "zha_event"
        event_data:
          device_id: 8bf5abeb52b706beefbaf493466b25c1
          command: 'Tilt'
    sensor:
      - name: "Garage Door Tilt"
        state: "{{ trigger.event.data.args.degrees }}"
        unique_id: garage_door_tilt
        attributes:
          time_fired: "{{ trigger.event.time_fired }}"

And if anyone needs the drop sensor, you can use something like this:

template:
  - trigger:
      - platform: event
        event_type: "zha_event"
        event_data:
          device_id: 8bf5abeb52b706beefbaf493466b25c1
          command: 'Drop'
    binary_sensor:
      - name: "Aqara Vibration Sensor Drop Event"
        state: "true"
        unique_id: aqara_vibration_sensor_drop_event
        auto_off: 5
        attributes:
          time_fired: "{{ trigger.event.time_fired }}"

@github-actions
Copy link

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.

@github-actions github-actions bot added the stale Issue is inactivate and might get closed soon label Oct 10, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issue is inactivate and might get closed soon support This request is likely unrelated to quirks and more of a support ticket (e.g. network issues)
Projects
None yet
Development

No branches or pull requests