tuya/tuya-home-assistant

Water Leak Sensor. Detected, but state does not update and automations don't trigger.

Open

#512 ouverte le 30 sept. 2021

Voir sur GitHub
 (1 commentaire) (0 réactions) (0 assignés) (206 forks)github user discovery
enhancementhelp wanted

Métriques du dépôt

Stars
 (960 stars)
Métriques de merge PR
 (Métriques PR en attente)

Description

Device normal info

  • NEO
  • Unknown Device is recognized. Water leak sensors and battery levels are recognized, but they don't change when the alarm is triggered. Tuya app triggers notification immediately. I've tried setting an automation using trigger type: Device, State and Numeric state. The issue is that the state of the sensor is always Dry for HomeAssistant and does not update. I can see state changes in the logs, however.

https://i.ibb.co/nnYywfs/Screenshot-20210930-173952.png

Device info (please complete the following information, which can be found in log): like this:

{
"active_time": 1626437386,
"biz_type": 0,
"category": "sj",
"create_time": 1625579619,
"icon": "smart/icon/1528364839bqwi2byfbhv_0.png",
"id": "84445000807d3a00bb62",
"ip": "***",
"lat": "***",
"local_key": "***",
"lon": "***",
"name": "SensorAguaTerraza",
"online": true,
"owner_id": "33667113",
"product_id": "SmFKLTOcGHbPQvmh",
"product_name": "Water sensor",
"status": [
{
"code": "watersensor_state",
"value": "2"
},
{
"code": "battery_state",
"value": "high"
}
],
"sub": false,
"time_zone": "+01:00",
"uid": "***",
"update_time": 1633013576,
"uuid": "84445000807d3xxxxxxx"
},

Sensor changes state when triggered, but the state change never reaches HA and hence automation is not triggered.

2021-09-30 17:26:46 DEBUG (Thread-4) [tuya iot] mq _on_device_report-> [{'101': True, 'code': 'watersensor_state', 't': '1633015606', 'value': '1'}]
2021-09-30 17:26:46 DEBUG (Thread-4) [custom_components.tuya_v2] _update--><custom_components.tuya_v2._init_tuya_sdk.<locals>.DeviceListener object at 0x7f01117d27f0>;->>{'watersensor_state': '1', 'battery_state': 'middle'}
2021-09-30 17:26:46 DEBUG (Thread-4) [custom_components.tuya_v2] _update--><custom_components.tuya_v2._init_tuya_sdk.<locals>.DeviceListener object at 0x7f01117d27f0>;->>{'watersensor_state': '1', 'battery_state': 'middle'}
2021-09-30 17:26:53 DEBUG (Thread-4) [tuya iot] _on_log: Received PUBLISH (d0, q0, r0, m0), 'cloud/token/in/7xxxxxxxxxx7f53689ed96b42', ... (372 bytes)
2021-09-30 17:26:53 DEBUG (Thread-4) [tuya iot] payload-> b'{"data":"ARvxxxxxxxxxbuKDpN/S91iyhuAihvDFIwxxxxxxxxxxxxxxxHhUGM3t79XEiob7aPtHD3ml9PjbOtlnmOgvv7ThTvqyZpZIUYmdZniclo3ohBkzElpErr+Z3XZyKoeEAuunbb89Z1O5yeFxxxxxxxxxxxxxxxxxxxxxpGERKC9HaamTsyxxxxxxxxxxxxxJSmQ==","protocol":4,"pv":"2.0","sign":"d9xxxxxxxxxxxxxxbbd6a77be0","t":1633015613}'
2021-09-30 17:26:53 DEBUG (Thread-4) [tuya iot] on_message: {'data': {'dataId': 'e4e3a47e-126f-49f7-868e-3bcaea85eea7', 'devId': '844450008xxxxx', 'productKey': 'SmFKxxxxx', 'status': [{'102': '0x00', 'code': 'battery_state', 't': '1633015613', 'value': 'high'}]}, 'protocol': 4, 'pv': '2.0', 'sign': 'd9bcabf878b8ed8690073dbbd6a77be0', 't': 1633015613}
2021-09-30 17:26:53 DEBUG (Thread-4) [tuya iot] mq receive-> {'data': {'dataId': 'e4e3a47e-126f-49f7-868e-3bcaea85eea7', 'devId': '8444500080xxxxx', 'productKey': 'SmFKxxxxxxvmh', 'status': [{'102': '0x00', 'code': 'battery_state', 't': '1633015613', 'value': 'high'}]}, 'protocol': 4, 'pv': '2.0', 'sign': 'd9bcabf878b8ed8690073dbbd6a77be0', 't': 1633015613}
2021-09-30 17:26:53 DEBUG (Thread-4) [tuya iot] mq _on_device_report-> [{'102': '0x00', 'code': 'battery_state', 't': '1633015613', 'value': 'high'}]
2021-09-30 17:26:53 DEBUG (Thread-4) [custom_components.tuya_v2] _update--><custom_components.tuya_v2._init_tuya_sdk.<locals>.DeviceListener object at 0x7f01117d27f0>;->>{'watersensor_state': '1', 'battery_state': 'high'}
2021-09-30 17:26:53 DEBUG (Thread-4) [custom_components.tuya_v2] _update--><custom_components.tuya_v2._init_tuya_sdk.<locals>.DeviceListener object at 0x7f01117d27f0>;->>{'watersensor_state': '1', 'battery_state': 'high'}
2021-09-30 17:26:53 DEBUG (Thread-4) [tuya iot] _on_log: Received PUBLISH (d0, q0, r0, m0), 'cloud/token/in/721b9a9c795e8c58c07f53689ed96b42', ... (372 bytes)
2021-09-30 17:26:53 DEBUG (Thread-4) [tuya iot] payload-> b'{"data":"RjvJrTFuOBz+brh5e4/FhD5qIpLO0OaDoYfu80fDEKvq9Q7R+ADR4ce4+QldVWeGxCSbirnBovsSb48MWrFhoS8zo0HbXknQPlPiz6YcGNz2MaE+LBQIIHhUGMxxxxxxxxxxxxxxxxxxxxxxxxx/vBarJ7DbYKALwSf5Z4wP8snMaEqMz0e2amTsyJxT5ruKhxnRIIJSmQ==","protocol":4,"pv":"2.0","sign":"07c1bc3a416d2f4c71e0d04a8eb785ac","t":1633015613}'
2021-09-30 17:26:53 DEBUG (Thread-4) [tuya iot] on_message: {'data': {'dataId': '8f1cb9a4-946a-4ce2-9600-d737d59bbf2c', 'devId': '8xxx', 'productKey': 'SmFxxxxmh', 'status': [{'101': False, 'code': 'watersensor_state', 't': '1633015613', 'value': '2'}]}, 'protocol': 4, 'pv': '2.0', 'sign': '07c1bc3a416d2f4c71e0d04a8eb785ac', 't': 1633015613}
2021-09-30 17:26:53 DEBUG (Thread-4) [tuya iot] mq receive-> {'data': {'dataId': '8f1cb9a4-946a-4ce2-9600-d737d59bbf2c', 'devId': '8444xx', 'productKey': 'SmFKxxxQvmh', 'status': [{'101': False, 'code': 'watersensor_state', 't': '1633015613', 'value': '2'}]}, 'protocol': 4, 'pv': '2.0', 'sign': '07c1bc3a416d2f4c71e0d04a8eb785ac', 't': 1633015613}
2021-09-30 17:26:53 DEBUG (Thread-4) [tuya iot] mq _on_device_report-> [{'101': False, 'code': 'watersensor_state', 't': '1633015613', 'value': '2'}]
2021-09-30 17:26:53 DEBUG (Thread-4) [custom_components.tuya_v2] _update--><custom_components.tuya_v2._init_tuya_sdk.<locals>.DeviceListener object at 0x7f01117d27f0>;->>{'watersensor_state': '2', 'battery_state': 'high'}
2021-09-30 17:26:53 DEBUG (Thread-4) [custom_components.tuya_v2] _update--><custom_components.tuya_v2._init_tuya_sdk.<locals>.DeviceListener object at 0x7f01117d27f0>;->>{'watersensor_state': '2', 'battery_state': 'high'}

Guide contributeur