tuya / tuya-homebridge

Homebridge custom plugin for controlling Powered by Tuya (PBT) devices in HomeKit. This plugin is officially maintained by the Tuya Developer Team.
MIT License
351 stars 180 forks source link

Device not shown in accesories nor Homekit App #250

Closed onichan88 closed 2 years ago

onichan88 commented 2 years ago

Describe the bug I configured Tuya IoT to add the device from Tuya Smart. All seems Ok, in logs it shows the device, and if I manually switch ON light or fan, it shows in the logs, but the device is never shown in the accesories tab neither Home kit App. Seems to get stuck adding the device, it don't shows added.

Expected behavior Device shown in the accesories tab and homekit app.

Screenshots If applicable, add screenshots to help explain your problem.

Device info (please complete the following information, which can be found in log): request path = /v1.0/iot-01/associated-users/devices

TuyaOpenAPI request: method = get, endpoint = https://openapi.tuyaeu.com, path = /v1.0/iot-01/associated-users/devices, params = {"size":100}, body = null, headers = {"t":"1655110979790","client_id":"xr3wpp4yh7w5yt4adkjc","nonce":"9a4ea5f0-eaf7-11ec-8701-67ba08cb5740","Signature-Headers":"client_id","sign":"2052473588E23B279825B83E322F77F4B8CA72421D162092906E203D2AC5B073","sign_method":"HMAC-SHA256","access_token":"ad31c5f94e9581ba1f926b2cd97e5c3b","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.5.0"} TuyaOpenAPI response: {"result":{"devices":[{"active_time":1654875544,"biz_type":0,"category":"fsd","create_time":1654875544,"icon":"smart/icon/ay1564458733639x1LBu/7e84ea311049e256d357d89d74276448.png","id":"bf27ee43ba522590ea28wj","ip":"$$$$$$$$$","lat":"","local_key":"$$$$$$$$$$$$$","lon":"","model":"101","name":"VentLuz","online":true,"owner_id":"58787915","product_id":"u5ovvhurbvynvspv","product_name":"Light+Fan-new product","status":[{"code":"switch_led","value":false},{"code":"work_mode","value":"white"},{"code":"bright_value","value":247},{"code":"temp_value","value":0},{"code":"colour_data","value":""},{"code":"scene_data","value":""},{"code":"brightness_min_1","value":10},{"code":"led_type_1","value":"led"},{"code":"fan_switch","value":false},{"code":"fan_speed","value":6},{"code":"fan_direction","value":"forward"},{"code":"countdown_left_fan","value":0}],"sub":false,"time_zone":"+02:00","uid":"eu1654841901186FqSG1","update_time":1654878752,"uuid":"201a83e843e2699b"}],"has_more":false,"last_row_key":"728CA09CB4615F9B6FDA13AD5DA40F38","total":1},"success":true,"t":1655110980202,"tid":"9fda5fb5eaf711eca25c82f07e008233"} path = /v1.0/iot-01/associated-users/devices TuyaOpenAPI request: method = get, endpoint = https://openapi.tuyaeu.com, path = /v1.0/devices/functions, params = {"device_ids":"bf27ee43ba522590ea28wj"}, body = null, headers = {"t":"1655110980244","client_id":"xr3wpp4yh7w5yt4adkjc","nonce":"9a4ea5f0-eaf7-11ec-8701-67ba08cb5740","Signature-Headers":"client_id","sign":"F16E4D28360C7D7110F43BE2F47CB1673603734E45B88B6248293BEFA3A0D465","sign_method":"HMAC-SHA256","access_token":"ad31c5f94e9581ba1f926b2cd97e5c3b","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.5.0"}

Device functions (please complete the following information, which can be found in log): request path = /v1.0/devices/functions TuyaOpenAPI response: {"result":[{"category":"fsd","devices":["bf27ee43ba522590ea28wj"],"functions":[{"code":"switch_led","desc":"switch led","name":"switch led","type":"Boolean","values":"{}"},{"code":"work_mode","desc":"work mode","name":"work mode","type":"Enum","values":"{\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}"},{"code":"bright_value","desc":"bright value","name":"bright value","type":"Integer","values":"{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}"},{"code":"temp_value","desc":"temp value","name":"temp value","type":"Integer","values":"{\"min\":0,\"max\":1000,\"scale\":0,\"step\":1}"},{"code":"colour_data","desc":"colour data","name":"colour data","type":"Json","values":"{}"},{"code":"scene_data","desc":"scene data","name":"scene data","type":"String","values":"{\"maxlen\":255}"},{"code":"control_data","desc":"control data","name":"control data","type":"String","values":"{\"maxlen\":255}"},{"code":"brightness_min_1","desc":"brightness min 1","name":"brightness min 1","type":"Integer","values":"{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}"},{"code":"led_type_1","desc":"led type 1","name":"led type 1","type":"Enum","values":"{\"range\":[\"led\",\"incandescent\",\"halogen\"]}"},{"code":"fan_switch","desc":"fan switch","name":"fan switch","type":"Boolean","values":"{}"},{"code":"fan_speed","desc":"fan speed","name":"fan speed","type":"Integer","values":"{\"unit\":\"\",\"min\":1,\"max\":6,\"scale\":0,\"step\":1}"},{"code":"fan_direction","desc":"fan direction","name":"fan direction","type":"Enum","values":"{\"range\":[\"forward\",\"reverse\"]}"},{"code":"countdown_left_fan","desc":"countdown left fan","name":"countdown left fan","type":"Integer","values":"{\"unit\":\"min\",\"min\":0,\"max\":540,\"scale\":0,\"step\":1}"}],"product_id":"u5ovvhurbvynvspv"}],"success":true,"t":1655110980533,"tid":"a00db8ceeaf711ec87382aa367714e21"} path = /v1.0/devices/functions Adding: VentLuz (fsd / bf27ee43ba522590ea28wj)

Additional context TuyaOpenAPI request: method = post, endpoint = https://openapi.tuyaeu.com, path = /v1.0/iot-03/open-hub/access-config, params = null, body = {"uid":"eu1654841901186FqSG1","link_id":"9a93ec50-eaf7-11ec-8701-67ba08cb5740","link_type":"mqtt","topics":"device","msg_encrypted_version":"1.0"}, headers = {"t":"1655110981120","client_id":"xr3wpp4yh7w5yt4adkjc","nonce":"9a4ea5f0-eaf7-11ec-8701-67ba08cb5740","Signature-Headers":"client_id","sign":"F305465D48C6AE2C3684710D9259B192273FF7DE2618A73332080C7BB95733E5","sign_method":"HMAC-SHA256","access_token":"ad31c5f94e9581ba1f926b2cd97e5c3b","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.5.0"} TuyaOpenAPI response: {"result":{"client_id":"cloud_62fcf9fa53800e4c7565d7a8cc194ac3","expire_time":7200,"password":"e03ae63ff2270020852942144c800d8b","sink_topic":{"device":"cloud/token/out/{device_id}"},"source_topic":{"device":"cloud/token/in/4b0a7be8a1a863e45dd3834aeb096b59"},"url":"ssl://m1.tuyaeu.com:8883","username":"cloud_4b0a7be8a1a863e45dd3834aeb096b59"},"success":true,"t":1655110981723,"tid":"a0c55badeaf711ec87382aa367714e21"} path = /v1.0/iot-03/open-hub/access-config TuyaOpenMQ connecting: ssl://m1.tuyaeu.com:8883 TuyaOpenMQ connected

Logs of switching On-Off the light: TuyaOpenMQ onMessage: topic = cloud/token/in/4b0a7be8a1a863e45dd3834aeb096b59, message = {"data":{"dataId":"3aa502ef-a2de-4066-b7d1-b200b5ff2421","devId":"bf27ee43ba522590ea28wj","productKey":"u5ovvhurbvynvspv","status":[{"20":true,"code":"switch_led","t":"1655111628","value":true}]},"protocol":4,"pv":"2.0","sign":"e0950db685f676bb0142873c8d067685","t":1655111628} TuyaOpenMQ onMessage: topic = cloud/token/in/4b0a7be8a1a863e45dd3834aeb096b59, message = {"data":{"dataId":"e105f93f-1e42-4627-a6bc-7a79293247fe","devId":"bf27ee43ba522590ea28wj","productKey":"u5ovvhurbvynvspv","status":[{"20":false,"code":"switch_led","t":"1655111631","value":false}]},"protocol":4,"pv":"2.0","sign":"b65f30f28c85c744dcd92f823d5251a5","t":1655111631}

Logs of switching On-Off fan: TuyaOpenMQ onMessage: topic = cloud/token/in/4b0a7be8a1a863e45dd3834aeb096b59, message = {"data":{"dataId":"d7038f8b-19dd-422c-ac89-d50efbd82ea4","devId":"bf27ee43ba522590ea28wj","productKey":"u5ovvhurbvynvspv","status":[{"60":true,"code":"fan_switch","t":"1655111666","value":true}]},"protocol":4,"pv":"2.0","sign":"15bf845d8563ce210f80c0da883b4e83","t":1655111666} TuyaOpenMQ onMessage: topic = cloud/token/in/4b0a7be8a1a863e45dd3834aeb096b59, message = {"data":{"dataId":"7e89c881-9461-4080-80d5-8116ea61316c","devId":"bf27ee43ba522590ea28wj","productKey":"u5ovvhurbvynvspv","status":[{"60":false,"code":"fan_switch","t":"1655111669","value":false}]},"protocol":4,"pv":"2.0","sign":"998772d0a109528a738339d452451750","t":1655111669}

github-actions[bot] commented 2 years ago

Thank you for your feedback, we will solve this issue soon