Home Assistant integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, maintained by the Home Assistant Community and Tuya Developer Team.
I can work on adding this. The tuya integration was added to home assistnat just today so it will require a PR to the home assistant core repo. This repo is probably going to go away soon.
Device normal info
Device info (please complete the following information, which can be found in log): like this: { 2021-07-30 10:17:11 DEBUG (SyncWorker_0) [tuya iot] Response: { "result": [ { "active_time": 1627657509, "biz_type": 0, "category": "tgq", "create_time": 1618193126, "icon": "smart/icon/ay1517974017716dABhC/326862a481b571039156d6e1e0573b50.png", "id": "718051433c6105e14dca", "ip": "68.250.117.214", "lat": "41.64724304245325", "local_key": "e33392de39c29ad3", "lon": "-88.27132899643966", "name": "SW2_NEW 2", "online": true, "owner_id": "10496042", "product_id": "ubadjqh45i98tdel", "product_name": "SW2_NEW", "status": [ { "code": "switch_led_1", "value": false }, { "code": "bright_value_1", "value": 960 }, { "code": "brightness_min_1", "value": 10 }, { "code": "led_type_1", "value": "led" }, { "code": "brightness_max_1", "value": 1000 }, { "code": "countdown_1", "value": 0 } ], "sub": false, "time_zone": "-06:00", "uid": "az1574266781459lG0og", "update_time": 1627657513, "uuid": "718051433c6105e14dca" }, {
Device specifications (please complete the following information, which can be found in log): Same device's id, like this: [2021-07-01 10:18:01,351] [tuya-openapi] Request: method = GET, url = https://openapi.tuyacn.com/v1.0/devices/aaaaaaaaaaa/specifications, params = None, body = None, headers = {'client_id': 'xxxxxxxxxxxx', 'sign': 'xxxxxxxxxxxx', 'sign_method': 'HMAC-SHA256', 'access_token': '213e2d4af5e8d217abc0b104462a9f72', 't': '1625105881351', 'lang': 'en'} 2021-07-01 10:18:01 DEBUG (SyncWorker_1) [tuya iot] Response: { "result": { "category": "cz", "functions": [ { "code": "countdown_1", "type": "Integer", "values": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}" }, { "code": "switch", "type": "Boolean", "values": "{}" } ], "status": [ { "code": "cur_voltage", "type": "Integer", "values": "{\"unit\":\"V\",\"min\":0,\"max\":2500,\"scale\":0,\"step\":1}" }, { "code": "cur_current", "type": "Integer", "values": "{\"unit\":\"mA\",\"min\":0,\"max\":30000,\"scale\":0,\"step\":1}" }, { "code": "switch", "type": "Boolean", "values": "{}" }, { "code": "cur_power", "type": "Integer", "values": "{\"unit\":\"W\",\"min\":0,\"max\":50000,\"scale\":0,\"step\":1}" }, { "code": "countdown_1", "type": "Integer", "values": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}" } ] }, "success": true, "t": 1625105881348 }