PaulAnnekov / tuyaha

Implements the special Tuya Home Assistant API.
Other
141 stars 106 forks source link

climate type tuya device stats and functions are degraded #25

Closed atus42 closed 4 years ago

atus42 commented 4 years ago

debug_discovery.py gives the below answer:

{ u'header': { u'code': u'SUCCESS', u'payloadVersion': 1}, u'payload': { u'devices': [ { u'data': { u'current_temperature': 22, u'max_temper': 95, u'min_temper': 5, u'online': True, u'state': u'true', u'temperature': 21}, u'dev_type': u'climate', u'ha_type': u'climate', u'icon': u'https://images.tuyaeu.com/smart/program_category_icon/wk.png', u'id': u'---', u'name': u'4853_Nappali'}, { u'data': { u'current_temperature': 22, u'max_temper': 95, u'min_temper': 5, u'online': True, u'state': u'true', u'temperature': 23}, u'dev_type': u'climate', u'ha_type': u'climate', u'icon': u'https://images.tuyaeu.com/smart/program_category_icon/wk.png', u'id': u'---', u'name': u'4947_Lilla'}] however this devices gives current_temperature as a 0.1 precision float. In HA I can set the target temp in 1C° steps, but the device supports 0.5C° steps. Can you correct these precision issues for us?

atus42 commented 4 years ago

Hello!

I was able to dig this further, and give You more detail. It appears that You currently use the dps attribute 127 for temperature (target temp) and 128 for current_temperature. The more precise values for these attributes are 2 for temperature (target temp) and 3 for current_temperature. These values should be divided by 10.

example raw data: "dps":{"1":true,"101":false,"102":true,"103":"1","104":"BwFoAMgB4ACgBDgAyAUoAKA=","105":"BwFoAMgB4ACgBDgAyAUoAKA=","106":"BwFoAMgB4ACgBDgAyAUoAKA=","107":"BwFoAMgB4ACgBDgAyAUoAKA=","108":"BwFoAMgB4ACgBDgAyAUoAKA=","109":"BwFoAMgB4ACgBDgAyAUoAKA=","110":"BwFoAMgB4ACgBDgAyAUoAKA=","111":"ASwAMg==","112":"EBAAAAAAAA==","113":"AAAAAAAAAhEQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==","114":"AAAAAAAAAAAAAAAA","115":"FRUVFhYVFRUVFhYWFhYAAAAAAAAAAAAA","116":"FBQAAAAAAA==","117":"AAAAAAAAARQUFAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==","118":"AAAAAAAAAAAAAAAA","119":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","120":"AAAAAAAAAA==","121":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==","122":"AAAAAAAAAAAAAAAA","123":"EBAQEBAUExAQEBAQEBAAAAAAAAAAAAAA","124":"","125":0,"126":"1","127":16,"128":22,"129":"4","130":"c","131":"B+QDCw8r","132":0,"133":true,"134":0,"135":0,"136":true,"137":true,"138":true,"139":true,"2":160,"3":227} set temp is 16.0 C°; current_temperature is 22.7C°

"productId":"foitasaq52xwyqmt" I didn't find the precision data yet, but continue to search.

atus42 commented 4 years ago

Got that too: productBeen->->schemaInfo->schemaMap-> 2, 3, 127, 128 tuya_schema_json_browser_02 tuya_schema_json_browser_01

atus42 commented 4 years ago

It appears that the provided data came from a Tuya made api/interface, so it is pointless to keep this ticket open.