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
879 stars 207 forks source link

Brightness + temperature and humidity Sensor #435

Open fadmoze22 opened 3 years ago

fadmoze22 commented 3 years ago

Device normal info

Device info: { "active_time": 1626679936, "biz_type": 18, "category": "dgnbj", "create_time": 1626679936, "icon": "smart/icon/ay1523669254163tcGDj/55cae1232fb26bb1a70190bda2bd9efd.png", "id": "bfac779760830c90b0ytkw", "ip": "", "lat": "", "local_key": "", "lon": "", "name": "Makhzan Climate", "node_id": "847127fffe055188", "online": true, "owner_id": "3192429", "product_id": "vzqtvljm", "product_name": "two in one(Brightness + temperature and humidity)", "status": [ { "code": "battery_percentage", "value": 100 }, { "code": "bright_value", "value": 33 }, { "code": "temp_current", "value": 307 }, { "code": "humidity_value", "value": 58 } ], "sub": true, "time_zone": "+08:00", "uid": "***", "update_time": 1630610909, "uuid": "bfac779760830c90b0ytkw" },

Device specifications: 2021-09-03 09:31:40 DEBUG (SyncWorker_5) [tuya iot] Request: method = GET, url = https://openapi.tuyaeu.com/v1.0/devices/bfac779760830c90b0ytkw/specifications, params = None, body = None, t = 1630650700263 2021-09-03 09:31:40 DEBUG (SyncWorker_5) [tuya iot] Response: { "result": { "category": "dgnbj", "functions": [], "status": [ { "code": "battery_percentage", "type": "Integer", "values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}" }, { "code": "bright_value", "type": "Integer", "values": "{\"unit\":\"\",\"min\":0,\"max\": 1000,\"scale\":0,\"step\":1}" }, { "code": "temp_current", "type": "Integer", "values": "{\"min\":-400,\"max\": 2000,\"scale\":1,\"step\":1}" }, { "code": "humidity_value", "type": "Integer", "values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}" } ] }, "success": true, "t": 1630650700355 }

fadmoze22 commented 3 years ago

new driver wanted

cvroque commented 3 years ago

This ones looks simple, do you mind applying this file and reporting the results?

You can either download this file and overwrite your current installation (\config\custom_components\tuya_v2\sensor.py) or do a small change at line 62. After that restart HA and the device should show up.

fadmoze22 commented 3 years ago

It's working, thank you very much.

cvroque commented 3 years ago

Sweet, I created an PR https://github.com/tuya/tuya-home-assistant/pull/445 so you won't lose your sensors next time you update.