tuya / tuya-home-assistant

Home Assistant integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, maintained by the Home Assistant Community and Tuya Developer Team.
MIT License
871 stars 206 forks source link

EMITERM Climate is not updating on lovelace #674

Open jmvaz opened 2 years ago

jmvaz commented 2 years ago

Describe the bug Integration with homeassistant is not working for climate device: Device Information:

Expected behavior The target temperature commands sent through homelace doesn't perform any update on the device. Also, all the updates sent thought the api aren't reflected on the lovelace. It is not possible to set the modes, like High and Low, only is possible to turn on or off.

Screenshots image Video showin the problem: https://screenrec.com/share/hXosb0SUvY

Home Assistant Version

Device info:

{ "active_time": 1611858489, "biz_type": 18, "category": "qn", "create_time": 1611858489, "icon": "smart/icon/1470624702_0.jpeg", "id": "71707360ecfabcd7830c", "ip": "", "lat": "", "local_key": "", "lon": "", "name": "Panel heater office", "online": true, "owner_id": "3063176", "product_id": "t25mzpypc9tblzki", "product_name": "Panel heater", "status": [ { "code": "switch", "value": false }, { "code": "lock", "value": false }, { "code": "temp_set", "value": 32 }, { "code": "temp_current", "value": 23 }, { "code": "mode", "value": "high" } ], "sub": false, "time_zone": "+00:00", "uid": "*", "update_time": 1635632202, "uuid": "71707360ecfabcd7830c" }, Device specifications (please complete the following information, which can be found in log):** Same device's id, like this: [2021-11-06 11:10:20 DEBUG (SyncWorker_4) [tuya iot] Request: method = GET, url = https://openapi.tuyaeu.com/v1.0/devices/71707360ecfabcd7830c/specifications, params = None, body = None, t = 1636197020490 2021-11-06 11:10:20 DEBUG (SyncWorker_4) [tuya iot] Response: { "result": { "category": "qn", "functions": [ { "code": "mode", "type": "Enum", "values": "{\"range\":[\"smart\",\"auto\",\"low\",\"high\",\"af\"]}" }, { "code": "temp_set", "type": "Integer", "values": "{\"unit\":\"℃\",\"min\":15,\"max\":35,\"scale\":0,\"step\":1}" }, { "code": "lock", "type": "Boolean", "values": "{}" }, { "code": "switch", "type": "Boolean", "values": "{}" } ], "status": [ { "code": "mode", "type": "Enum", "values": "{\"range\":[\"smart\",\"auto\",\"low\",\"high\",\"af\"]}" }, { "code": "temp_current", "type": "Integer", "values": "{\"unit\":\"℃\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}" }, { "code": "temp_set", "type": "Integer", "values": "{\"unit\":\"℃\",\"min\":15,\"max\":35,\"scale\":0,\"step\":1}" }, { "code": "lock", "type": "Boolean", "values": "{}" }, { "code": "switch", "type": "Boolean", "values": "{}" } ] }, "success": true, "t": 1636197020556 }

Additional context 2021-11-06 11:10:23 DEBUG (MainThread) [custom_components.tuya_v2.climate] climate init 2021-11-06 11:10:23 DEBUG (MainThread) [custom_components.tuya_v2.climate] climate add-> ['71707360ecfabcd7830c', '717073608caab51b23a2'] 2021-11-06 11:11:34 DEBUG (SyncWorker_3) [tuya iot] Request: method = POST, url = https://openapi.tuyaeu.com/v1.0/devices/71707360ecfabcd7830c/commands, params = None, body = {'commands': [{'code': 'switch', 'value': True}, {'code': 'mode', 'value': 'auto'}]}, t = 1636197094182 2021-11-06 11:11:34 DEBUG (SyncWorker_3) [tuya iot] Response: { "result": true, "success": true, "t": 1636197094266 } 2021-11-06 11:11:34 DEBUG (Thread-6) [tuya iot] _on_log: Received PUBLISH (d0, q0, r0, m0), 'cloud/token/in/9a67b1cb81bc0e2abd5a75ae518ebd4b', ... (348 bytes) 2021-11-06 11:11:34 DEBUG (Thread-6) [tuya iot] payload-> b'{"data":"ZllU3tE6Kvm2MKfzHRbHsmZTrQ3/xdw178tr8hY6iz4zjNEVzyyehFpEGOCq/noku4u44ZfHxPXzd4jmZUwe97tdaVld8oh9Yr4DxGIYWhu2UYH5i+lJayUcKbMX05PuVenCCYo4B8dDsBMr9QB1LqLuCeUcXx2uXnpXeh/Vs+G+0u5R1AIKW9gOsb+kODZipW5vZ0sG+hFkAjcgkw/K3+hUflJWv8SkHFjqtmCSH99uR8+IUiI8WIehh2UFevF/","protocol":4,"pv":"2.0","sign":"cca334b9c01524b73ac04160ff62d161","t":1636197093}' 2021-11-06 11:11:34 DEBUG (Thread-6) [tuya iot] on_message: {'data': {'dataId': '0c2525e5-f0f7-4966-a574-3fa0476a4f34', 'devId': '71707360ecfabcd7830c', 'productKey': 't25mzpypc9tblzki', 'status': [{'1': True, 'code': 'switch', 't': '1636197093', 'value': True}]}, 'protocol': 4, 'pv': '2.0', 'sign': 'cca334b9c01524b73ac04160ff62d161', 't': 1636197093} 2021-11-06 11:11:34 DEBUG (Thread-6) [tuya iot] mq receive-> {'data': {'dataId': '0c2525e5-f0f7-4966-a574-3fa0476a4f34', 'devId': '71707360ecfabcd7830c', 'productKey': 't25mzpypc9tblzki', 'status': [{'1': True, 'code': 'switch', 't': '1636197093', 'value': True}]}, 'protocol': 4, 'pv': '2.0', 'sign': 'cca334b9c01524b73ac04160ff62d161', 't': 1636197093} 2021-11-06 11:11:34 DEBUG (Thread-6) [tuya iot] mq _on_device_report-> [{'1': True, 'code': 'switch', 't': '1636197093', 'value': True}] 2021-11-06 11:11:34 DEBUG (Thread-6) [custom_components.tuya_v2] _update--><custom_components.tuya_v2.DeviceListener object at 0x7f74d8704130>;->>71707360ecfabcd7830c 2021-11-06 11:11:36 DEBUG (SyncWorker_6) [custom_components.tuya_v2.climate] climate temp-> {'entity_id': ['climate.ty71707360ecfabcd7830c'], 'temperature': 34.0} 2021-11-06 11:11:37 DEBUG (SyncWorker_0) [custom_components.tuya_v2.climate] climate temp-> {'entity_id': ['climate.ty71707360ecfabcd7830c'], 'temperature': 31.0} 2021-11-06 11:11:37 DEBUG (SyncWorker_5) [custom_components.tuya_v2.climate] climate temp-> {'entity_id': ['climate.ty71707360ecfabcd7830c'], 'temperature': 28.0} 2021-11-06 11:11:38 DEBUG (SyncWorker_2) [custom_components.tuya_v2.climate] climate temp-> {'entity_id': ['climate.ty71707360ecfabcd7830c'], 'temperature': 26.0} 2021-11-06 11:11:39 DEBUG (SyncWorker_6) [custom_components.tuya_v2.climate] climate temp-> {'entity_id': ['climate.ty71707360ecfabcd7830c'], 'temperature': 22.0} 2021-11-06 11:11:40 DEBUG (SyncWorker_9) [custom_components.tuya_v2.climate] climate temp-> {'entity_id': ['climate.ty71707360ecfabcd7830c'], 'temperature': 31.0} 2021-11-06 11:11:41 DEBUG (SyncWorker_0) [tuya iot] Request: method = POST, url = https://openapi.tuyaeu.com/v1.0/devices/71707360ecfabcd7830c/commands, params = None, body = {'commands': [{'code': 'switch', 'value': False}]}, t = 1636197101380 2021-11-06 11:11:41 DEBUG (SyncWorker_0) [tuya iot] Response: { "result": true, "success": true, "t": 1636197101438 } 2021-11-06 11:11:41 DEBUG (Thread-6) [tuya iot] _on_log: Received PUBLISH (d0, q0, r0, m0), 'cloud/token/in/9a67b1cb81bc0e2abd5a75ae518ebd4b', ... (348 bytes) 2021-11-06 11:11:41 DEBUG (Thread-6) [tuya iot] payload-> b'{"data":"kg7AQNQrx5/R4LXHFRk3iIa6pW+fB91UcZfBc2Fml+QpJM9OZOUoH4uI9kDU1FN1u4u44ZfHxPXzd4jmZUwe97tdaVld8oh9Yr4DxGIYWhu2UYH5i+lJayUcKbMX05PuVenCCYo4B8dDsBMr9QB1LoO7TkY14lcSprG2WUP0YWoq+u9hiU28fYvSxJtlIJevNx1CZEL8Sd4TXGWn9EfEYYoMpppcyqKZ8eYZZF0+ctYXz20pArYdI8kt/R61g/CP","protocol":4,"pv":"2.0","sign":"cf299138f7bfc510b605bdd01d817d04","t":1636197101}' 2021-11-06 11:11:41 DEBUG (Thread-6) [tuya iot] on_message: {'data': {'dataId': '45b77dad-b837-4f24-b835-2d787815c140', 'devId': '71707360ecfabcd7830c', 'productKey': 't25mzpypc9tblzki', 'status': [{'1': False, 'code': 'switch', 't': '1636197101', 'value': False}]}, 'protocol': 4, 'pv': '2.0', 'sign': 'cf299138f7bfc510b605bdd01d817d04', 't': 1636197101} 2021-11-06 11:11:41 DEBUG (Thread-6) [tuya iot] mq receive-> {'data': {'dataId': '45b77dad-b837-4f24-b835-2d787815c140', 'devId': '71707360ecfabcd7830c', 'productKey': 't25mzpypc9tblzki', 'status': [{'1': False, 'code': 'switch', 't': '1636197101', 'value': False}]}, 'protocol': 4, 'pv': '2.0', 'sign': 'cf299138f7bfc510b605bdd01d817d04', 't': 1636197101} 2021-11-06 11:11:41 DEBUG (Thread-6) [tuya iot] mq _on_device_report-> [{'1': False, 'code': 'switch', 't': '1636197101', 'value': False}] 2021-11-06 11:11:41 DEBUG (Thread-6) [custom_components.tuya_v2] _update--><custom_components.tuya_v2.DeviceListener object at 0x7f74d8704130>;->>71707360ecfabcd7830c 2021-11-06 11:11:42 DEBUG (SyncWorker_5) [tuya iot] Request: method = POST, url = https://openapi.tuyaeu.com/v1.0/devices/71707360ecfabcd7830c/commands, params = None, body = {'commands': [{'code': 'switch', 'value': True}, {'code': 'mode', 'value': 'auto'}]}, t = 1636197102749 2021-11-06 11:11:42 DEBUG (SyncWorker_5) [tuya iot] Response: { "result": true, "success": true, "t": 1636197102799 } 2021-11-06 11:11:43 DEBUG (Thread-6) [tuya iot] _on_log: Received PUBLISH (d0, q0, r0, m0), 'cloud/token/in/9a67b1cb81bc0e2abd5a75ae518ebd4b', ... (348 bytes) 2021-11-06 11:11:43 DEBUG (Thread-6) [tuya iot] payload-> b'{"data":"PR5syW7yAGlEpqqCftYIQsfy8kdlRkriV6yV7fgTsl7BY5Vkh4Oj4WGHQVHiC/eVu4u44ZfHxPXzd4jmZUwe97tdaVld8oh9Yr4DxGIYWhu2UYH5i+lJayUcKbMX05PuVenCCYo4B8dDsBMr9QB1LqLuCeUcXx2uXnpXeh/Vs+G+0u5R1AIKW9gOsb+kODZipW5vZ0sG+hFkAjcgkw/K3ykioKlKXGVpaG2bEQAXYNhuR8+IUiI8WIehh2UFevF/","protocol":4,"pv":"2.0","sign":"aadbab1e52d8094e717b88a6886b2d40","t":1636197102}' 2021-11-06 11:11:43 DEBUG (Thread-6) [tuya iot] on_message: {'data': {'dataId': '55b4dd3b-b4e0-4510-8f16-4e700c87af9c', 'devId': '71707360ecfabcd7830c', 'productKey': 't25mzpypc9tblzki', 'status': [{'1': True, 'code': 'switch', 't': '1636197102', 'value': True}]}, 'protocol': 4, 'pv': '2.0', 'sign': 'aadbab1e52d8094e717b88a6886b2d40', 't': 1636197102} 2021-11-06 11:11:43 DEBUG (Thread-6) [tuya iot] mq receive-> {'data': {'dataId': '55b4dd3b-b4e0-4510-8f16-4e700c87af9c', 'devId': '71707360ecfabcd7830c', 'productKey': 't25mzpypc9tblzki', 'status': [{'1': True, 'code': 'switch', 't': '1636197102', 'value': True}]}, 'protocol': 4, 'pv': '2.0', 'sign': 'aadbab1e52d8094e717b88a6886b2d40', 't': 1636197102} 2021-11-06 11:11:43 DEBUG (Thread-6) [tuya iot] mq _on_device_report-> [{'1': True, 'code': 'switch', 't': '1636197102', 'value': True}] 2021-11-06 11:11:43 DEBUG (Thread-6) [custom_components.tuya_v2] _update--><custom_components.tuya_v2.DeviceListener object at 0x7f74d8704130>;->>71707360ecfabcd7830c 2021-11-06 11:11:43 DEBUG (SyncWorker_6) [custom_components.tuya_v2.climate] climate temp-> {'entity_id': ['climate.ty71707360ecfabcd7830c'], 'temperature': 33.0} 2021-11-06 11:11:44 DEBUG (SyncWorker_9) [custom_components.tuya_v2.climate] climate temp-> {'entity_id': ['climate.ty71707360ecfabcd7830c'], 'temperature': 34.0} 2021-11-06 11:11:45 DEBUG (SyncWorker_1) [custom_components.tuya_v2.climate] climate temp-> {'entity_id': ['climate.ty71707360ecfabcd7830c'], 'temperature': 31.0} 2021-11-06 11:11:46 DEBUG (SyncWorker_4) [custom_components.tuya_v2.climate] climate temp-> {'entity_id': ['climate.ty71707360ecfabcd7830c'], 'temperature': 28.0} 2021-11-06 11:11:46 DEBUG (SyncWorker_3) [custom_components.tuya_v2.climate] climate temp-> {'entity_id': ['climate.ty71707360ecfabcd7830c'], 'temperature': 26.0} 2021-11-06 11:12:00 DEBUG (Thread-6) [tuya iot] _on_log: Received PUBLISH (d0, q0, r0, m0), 'cloud/token/in/9a67b1cb81bc0e2abd5a75ae518ebd4b', ... (348 bytes) 2021-11-06 11:12:00 DEBUG (Thread-6) [tuya iot] payload-> b'{"data":"2AzsMWFlI1oqZqKdAR7ZY51flMHo2ah5cIpRzqWi91fLhW/KhQK0INV2gpALRK9xu4u44ZfHxPXzd4jmZUwe97tdaVld8oh9Yr4DxGIYWhu2UYH5i+lJayUcKbMX05PuVenCCYo4B8dDsBMr9QB1Lg7XAgJNqJ4DA4djEZMmMFuE8LsoL9pH5uIuI8jLXPnm30ogijLv8zrZvAjggImyLwjDWoCXzfAqaJI4Rl0K+1ocjHXrggFTAY7fcGZn8l+C","protocol":4,"pv":"2.0","sign":"42b36b550d9dded15cd5e1cdb320a200","t":1636197119}' 2021-11-06 11:12:00 DEBUG (Thread-6) [tuya iot] on_message: {'data': {'dataId': 'd0474820-fc30-48dc-a7c8-fe0959fbf6b0', 'devId': '71707360ecfabcd7830c', 'productKey': 't25mzpypc9tblzki', 'status': [{'3': 35, 'code': 'temp_set', 't': '1636197119', 'value': 35}]}, 'protocol': 4, 'pv': '2.0', 'sign': '42b36b550d9dded15cd5e1cdb320a200', 't': 1636197119} 2021-11-06 11:12:00 DEBUG (Thread-6) [tuya iot] mq receive-> {'data': {'dataId': 'd0474820-fc30-48dc-a7c8-fe0959fbf6b0', 'devId': '71707360ecfabcd7830c', 'productKey': 't25mzpypc9tblzki', 'status': [{'3': 35, 'code': 'temp_set', 't': '1636197119', 'value': 35}]}, 'protocol': 4, 'pv': '2.0', 'sign': '42b36b550d9dded15cd5e1cdb320a200', 't': 1636197119} 2021-11-06 11:12:00 DEBUG (Thread-6) [tuya iot] mq _on_device_report-> [{'3': 35, 'code': 'temp_set', 't': '1636197119', 'value': 35}] 2021-11-06 11:12:00 DEBUG (Thread-6) [custom_components.tuya_v2] _update--><custom_components.tuya_v2.DeviceListener object at 0x7f74d8704130>;->>71707360ecfabcd7830c 2021-11-06 11:12:06 DEBUG (Thread-6) [tuya iot] _on_log: Received PUBLISH (d0, q0, r0, m0), 'cloud/token/in/9a67b1cb81bc0e2abd5a75ae518ebd4b', ... (348 bytes) 2021-11-06 11:12:06 DEBUG (Thread-6) [tuya iot] payload-> b'{"data":"ioRSp8EvXWSO2NTwJhjXdvt1UHuIWj15Gb2Rm3XTccE66GRK+R1hxRMhn5eRhJS2u4u44ZfHxPXzd4jmZUwe97tdaVld8oh9Yr4DxGIYWhu2UYH5i+lJayUcKbMX05PuVenCCYo4B8dDsBMr9QB1LqXsHZZ9iVIVtmlkN35GNgL7aiOeMN4nZ/zS46f1Lkm9S666sDMoS3escvEMZiF69ixUmtp3e4fYLErImcMuP/aE8De4QCCzJFMJZD72eeVG","protocol":4,"pv":"2.0","sign":"29bd197460c580687033fb036e4382b1","t":1636197125}' 2021-11-06 11:12:06 DEBUG (Thread-6) [tuya iot] on_message: {'data': {'dataId': 'bba953cf-9bda-4381-857e-5453a5b19eed', 'devId': '71707360ecfabcd7830c', 'productKey': 't25mzpypc9tblzki', 'status': [{'code': 'mode', 't': '1636197125', '7': 'Low', 'value': 'low'}]}, 'protocol': 4, 'pv': '2.0', 'sign': '29bd197460c580687033fb036e4382b1', 't': 1636197125} 2021-11-06 11:12:06 DEBUG (Thread-6) [tuya iot] mq receive-> {'data': {'dataId': 'bba953cf-9bda-4381-857e-5453a5b19eed', 'devId': '71707360ecfabcd7830c', 'productKey': 't25mzpypc9tblzki', 'status': [{'code': 'mode', 't': '1636197125', '7': 'Low', 'value': 'low'}]}, 'protocol': 4, 'pv': '2.0', 'sign': '29bd197460c580687033fb036e4382b1', 't': 1636197125} 2021-11-06 11:12:06 DEBUG (Thread-6) [tuya iot] mq _on_device_report-> [{'code': 'mode', 't': '1636197125', '7': 'Low', 'value': 'low'}] 2021-11-06 11:12:06 DEBUG (Thread-6) [custom_components.tuya_v2] _update--><custom_components.tuya_v2.DeviceListener object at 0x7f74d8704130>;->>71707360ecfabcd7830c 2021-11-06 11:12:09 DEBUG (Thread-6) [tuya iot] _on_log: Received PUBLISH (d0, q0, r0, m0), 'cloud/token/in/9a67b1cb81bc0e2abd5a75ae518ebd4b', ... (348 bytes) 2021-11-06 11:12:09 DEBUG (Thread-6) [tuya iot] payload-> b'{"data":"jkqfU6yS09saKWSntHvD4Q3dGShOYLbAAsqAyrbbwvz8oJGZFN6kZE9XEzWba+IMu4u44ZfHxPXzd4jmZUwe97tdaVld8oh9Yr4DxGIYWhu2UYH5i+lJayUcKbMX05PuVenCCYo4B8dDsBMr9QB1LoO7TkY14lcSprG2WUP0YWoq+u9hiU28fYvSxJtlIJevNx1CZEL8Sd4TXGWn9EfEYe0l6sKg39pZ/nVh9h46/GkXz20pArYdI8kt/R61g/CP","protocol":4,"pv":"2.0","sign":"8b4fd0fa7476378ef91926376d034578","t":1636197128}' 2021-11-06 11:12:09 DEBUG (Thread-6) [tuya iot] on_message: {'data': {'dataId': 'e4e12919-532c-4051-85c3-22b17bf863ed', 'devId': '71707360ecfabcd7830c', 'productKey': 't25mzpypc9tblzki', 'status': [{'1': False, 'code': 'switch', 't': '1636197128', 'value': False}]}, 'protocol': 4, 'pv': '2.0', 'sign': '8b4fd0fa7476378ef91926376d034578', 't': 1636197128} 2021-11-06 11:12:09 DEBUG (Thread-6) [tuya iot] mq receive-> {'data': {'dataId': 'e4e12919-532c-4051-85c3-22b17bf863ed', 'devId': '71707360ecfabcd7830c', 'productKey': 't25mzpypc9tblzki', 'status': [{'1': False, 'code': 'switch', 't': '1636197128', 'value': False}]}, 'protocol': 4, 'pv': '2.0', 'sign': '8b4fd0fa7476378ef91926376d034578', 't': 1636197128} 2021-11-06 11:12:09 DEBUG (Thread-6) [tuya iot] mq _on_device_report-> [{'1': False, 'code': 'switch', 't': '1636197128', 'value': False}] 2021-11-06 11:12:09 DEBUG (Thread-6) [custom_components.tuya_v2] _update--><custom_components.tuya_v2.DeviceListener object at 0x7f74d8704130>;->>71707360ecfabcd7830c 2021-11-06 11:12:21 DEBUG (Thread-6) [tuya iot] _on_log: Sending PINGREQ 2021-11-06 11:12:21 DEBUG (Thread-6) [tuya iot] _on_log: Received PINGRESP

More logs can be requested. Let me know in what can I help further.

Thanks!

jmvaz commented 2 years ago

Is some other information required?

jmvaz commented 2 years ago

this issue will be fixed?

jmvaz commented 2 years ago

What can I do to overcome this issue?