tuya-home-assistant
tuya-home-assistant copied to clipboard
Missing floodlight entities
Describe the bug When adding a new Tuya device (floodlight with PIR), only one light entity is created in home assistant
Expected behavior I expect at least another entity to be created for the PIR. I also expect a switch for "device_mode" ("auto","manual").
Screenshots
Home Assistant Version 2021.11.5
Device info Device info { "active_time": 1615625252, "biz_type": 18, "category": "gyd", "create_time": 1615062028, "icon": "smart/icon/ay1528449959696EWXeY/c103b4bedfca5656104ab8dc6834b866.png", "id": "", "ip": "", "lat": "", "local_key": "", "lon": "", "name": "PIR-WIFI-2WAY", "online": true, "owner_id": "", "product_id": "8ngdswokzfdnsqxe", "product_name": "PIR-WIFI-2WAY", "status": [ { "code": "switch_led", "value": true }, { "code": "work_mode", "value": "white" }, { "code": "bright_value", "value": 639 }, { "code": "temp_value", "value": 1000 }, { "code": "device_mode", "value": "manual" }, { "code": "pir_state", "value": "none" }, { "code": "cds", "value": "50lux" }, { "code": "pir_sensitivity", "value": "middle" }, { "code": "pir_delay", "value": 5 }, { "code": "switch_pir", "value": true }, { "code": "pir_resume_countdown", "value": 5 }, { "code": "standby_time", "value": 1 }, { "code": "standby_bright", "value": 216 } ], "sub": false, "time_zone": "+00:00", "uid": "", "update_time": 1628762400, "uuid": "*" } ], "success": true, "t": 1628763403841 }
Device specifications 2021-08-12 11:16:43 DEBUG (SyncWorker_7) [tuya iot] Request: method = GET, url = https://openapi.tuyaeu.com/v1.0/devices/XXXXX/specifications, params = None, body = None, t = 1628763403856 2021-08-12 11:16:43 DEBUG (SyncWorker_7) [tuya iot] Response: { "result": { "category": "gyd", "functions": [ { "code": "switch_led", "type": "Boolean", "values": "{}" }, { "code": "work_mode", "type": "Enum", "values": "{"range":["white","colour"]}" }, { "code": "bright_value", "type": "Integer", "values": "{"min":10,"max":1000,"scale":0,"step":1}" }, { "code": "temp_value", "type": "Integer", "values": "{"min":0,"max":1000,"scale":0,"step":1}" }, { "code": "control_data", "type": "String", "values": "{"maxlen":255}" }, { "code": "device_mode", "type": "Enum", "values": "{"range":["auto","manual"]}" }, { "code": "cds", "type": "Enum", "values": "{"range":["2000lux","300lux","50lux","10lux","5lux","now"]}" }, { "code": "pir_sensitivity", "type": "Enum", "values": "{"range":["low","middle","high"]}" }, { "code": "pir_delay", "type": "Integer", "values": "{"unit":"s","min":5,"max":3600,"scale":0,"step":1}" }, { "code": "switch_pir", "type": "Boolean", "values": "{}" }, { "code": "standby_time", "type": "Integer", "values": "{"unit":"min","min":1,"max":480,"scale":0,"step":1}" }, { "code": "standby_bright", "type": "Integer", "values": "{"min":0,"max":1000,"scale":0,"step":1}" } ], "status": [ { "code": "switch_led", "type": "Boolean", "values": "{}" }, { "code": "work_mode", "type": "Enum", "values": "{"range":["white","colour"]}" }, { "code": "bright_value", "type": "Integer", "values": "{"min":10,"max":1000,"scale":0,"step":1}" }, { "code": "temp_value", "type": "Integer", "values": "{"min":0,"max":1000,"scale":0,"step":1}" }, { "code": "device_mode", "type": "Enum", "values": "{"range":["auto","manual"]}" }, { "code": "pir_state", "type": "Enum", "values": "{"range":["pir","none"]}" }, { "code": "cds", "type": "Enum", "values": "{"range":["2000lux","300lux","50lux","10lux","5lux","now"]}" }, { "code": "pir_sensitivity", "type": "Enum", "values": "{"range":["low","middle","high"]}" }, { "code": "pir_delay", "type": "Integer", "values": "{"unit":"s","min":5,"max":3600,"scale":0,"step":1}" }, { "code": "switch_pir", "type": "Boolean", "values": "{}" }, { "code": "pir_resume_countdown", "type": "Integer", "values": "{"unit":"min","min":0,"max":480,"scale":0,"step":1}" }, { "code": "standby_time", "type": "Integer", "values": "{"unit":"min","min":1,"max":480,"scale":0,"step":1}" }, { "code": "standby_bright", "type": "Integer", "values": "{"min":0,"max":1000,"scale":0,"step":1}" } ] }, "success": true, "t": 1628763403940 }
Additional context
Home Assistant log after adding Tuya component and turning the light on:
2021-12-05 17:41:05 DEBUG (SyncWorker_7) [homeassistant.components.tuya.config_flow] Response {'code': 2401, 'msg': 'username or password wrong', 'success': False, 't': 1638726065632} 2021-12-05 17:41:05 DEBUG (SyncWorker_7) [homeassistant.components.tuya.config_flow] Response {'result': {'access_token': 'XXX', 'expire_time': 7200, 'platform_url': 'https://openapi.tuyaeu.com', 'refresh_token': 'YYYY', 'uid': 'ZZZZ'}, 'success': True, 't': 1638726065929} 2021-12-05 17:42:05 DEBUG (SyncWorker_12) [homeassistant.components.tuya.base] Sending commands for device XXXX: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}] 2021-12-05 17:42:05 DEBUG (Thread-164) [homeassistant.components.tuya] Received update for device XXXX: {'switch_led': False, 'work_mode': 'white', 'bright_value': 911, 'temp_value': 1000, 'device_mode': 'manual', 'pir_state': 'none', 'cds': '50lux', 'pir_sensitivity': 'middle', 'pir_delay': 60, 'switch_pir': True, 'pir_resume_countdown': 0, 'standby_time': 5, 'standby_bright': 0}
Tuya iot Device Debugging
Device Information Product Name PIR-WIFI-2WAY Device ID XXXXXX Product Category gyd Device Status Online Activated At 2021-11-20 17:32:53
[ { "code": "switch_led", "value": false }, { "code": "work_mode", "value": "white" }, { "code": "bright_value", "value": 911 }, { "code": "temp_value", "value": 1000 }, { "code": "control_data" }, { "code": "device_mode", "value": "manual" }, { "code": "cds", "value": "50lux" }, { "code": "pir_sensitivity", "value": "middle" }, { "code": "pir_delay", "value": 60 }, { "code": "switch_pir", "value": true }, { "code": "standby_time", "value": 5 }, { "code": "standby_bright", "value": 0 } ]
This bug is 1.5 years old. Any ETA when it's going to be resolved? Thanks