AMoo-Miki / homebridge-tuya-lan

Homebridge plugin for IoT devices that use Tuya Smart's platform
MIT License
200 stars 51 forks source link

problem connecting rgbw light #155

Open saethone opened 4 years ago

saethone commented 4 years ago

Hey,

I'm having some problems connecting to a smart light. I've done a bunch of troubleshooting already so hopefully I can give the info needed to solve it.

I'll start with the error log. I had to manually add the IP to the config file to get any connection

When homebridge starts I first see this: [1/25/2020, 2:48:25 PM] [TuyaLan] Starting discovery... [TuyaDiscovery] Discovery started on port 6666. [TuyaDiscovery] Discovery started on port 6667. [TuyaDiscovery] UDP from 192.168.1.159:6667 0x000055aa...0x0000aa55 [1/25/2020, 2:48:29 PM] [TuyaLan] Discovered a device that has not been configured yet (eb0fd8f90566531ff6im53@192.168.1.159). [TuyaDiscovery] UDP from 192.168.1.159:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.159:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.159:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.159:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.159:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.159:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.159:6667 0x000055aa...0x0000aa55 [TuyaDiscovery] UDP from 192.168.1.159:6667 0x000055aa...0x0000aa55 [1/25/2020, 2:49:54 PM] [TuyaLan] Failed to discover Office Overhead (undefined) in time but will connect via 192.168.1.159. [1/25/2020, 2:49:54 PM] [TuyaLan] Connected to Office Overhead [TuyaAccessory] Sending first query to Office Overhead (3.1) ��R�d��\��n2?Y� Malformed update from Office Overhead with command 10: ����,E�5#k� [TuyaAccessory] Raw update from Office Overhead (3.1) with command 10: 000055aa000000000000000a0000002c00000001828681ab2c45c435236bab0da801c752816401d4d55cf5f61f6e323f5918bd1a072328720000aa55

This message decoded says:

Cmd > 10 Len > 60 Size > 44 Seq > 0 CRC > Pass 0 Decoded 10> parse data error

When I turn the light off in the Ucomen app I get this message:

[TuyaAccessory] Odd message from Office Overhead with command 8: =bX�J�,�� ��&el�<-�[?�B� �� [TuyaAccessory] Raw message from Office Overhead (3.1) with command 8: 000055aa00000000000000080000004b00000000332e3300000000000062e400000001f5efc03eb9930ef4ee27e70f6016033d62587fd04a8d047f2c1c1f0387900cf8f926656ce93c2dde5b3ffc428c0bb783cfa057d00000aa55

which decodes to

Cmd > 8 Len > 91 Size > 75 Seq > 0 CRC > Pass 0 Decoded 8> {"dps":{"20":false},"t":1579987577}

and turning it on gives

Cmd > 8 Len > 91 Size > 75 Seq > 0 CRC > Pass 0 Decoded 8> {"dps":{"20":true},"t":1579987692}

The schema for this device is this:

{ "name: "Office Overhead", id: '(Hidden)', key: '(hidden)', def: { schema: '[{"mode":"rw","code":"switch_led","name":"\u5f00\u5173","property":{" type":"bool"},"iconname":"icon-dp_power2","id":20,"type":"obj","desc":""},{"mode":"rw" ,"code":"work_mode","name":"\u6a21\u5f0f","property":{"range":["white","colour","sce ne","music"],"type":"enum"},"iconname":"icon-dp_list","id":21,"type":"obj","desc":""}, {"mode":"rw","code":"bright_value","name":"\u4eae\u5ea6\u503c","property":{"min":10 ,"max":1000,"scale":0,"step":1,"type":"value"},"iconname":"icon-dp_sun","id":22,"type" :"obj","desc":""},{"mode":"rw","code":"temp_value","name":"\u51b7\u6696\u503c","pro perty":{"min":0,"max":1000,"scale":0,"step":1,"type":"value"},"iconname":"icon-dp_half ","id":23,"type":"obj","desc":""},{"mode":"rw","code":"colour_data","name":"\u5f69\u 5149","property":{"type":"string","maxlen":255},"iconname":"icon-dp_light","id":24,"ty pe":"obj","desc":""},{"mode":"rw","code":"scene_data","name":"\u573a\u666f","propert y":{"type":"string","maxlen":255},"iconname":"icon-dp_box2","id":25,"type":"obj","desc ":""},{"mode":"rw","code":"countdown","name":"\u5012\u8ba1\u65f6\u5269\u4f59\u65 f6\u95f4","property":{"min":0,"max":86400,"scale":0,"step":1,"type":"value"},"iconnam e":"icon-timer1","id":26,"type":"obj","desc":""},{"mode":"wr","code":"music_data","nam e":"\u97f3\u4e50\u706f","property":{"type":"string","maxlen":255},"iconname":"icon- yinliang","id":27,"type":"obj","desc":""},{"mode":"rw","code":"control_data","name":"\ \u8c03\u8282","property":{"type":"string","maxlen":255},"iconname":"icon-setting","id ":28,"type":"obj","desc":""}]', extras: '[{"id":20,"inputStyle":"","inputType":"plain"},{"id":21,"inputStyle":"" ,"inputType":"plain"},{"id":22,"inputStyle":"","inputType":"plain"},{"id":23,"inputSty le":"","inputType":"plain"},{"id":26,"inputStyle":"","inputType":" "}]', }, }

and here is my config for the device:

{ "name": "Office Overhead", "type": "RGBTWLight", "manufacturer": "Lumimen", "model": "RGBW Light", "id:": "---", "key": "---", "ip": "192.168.1.159", "pingtimeout": "3600", "dpPower": 1, "dpMode": 2, "dpBrightness": 3, "dpColorTemperature": 4, "dpColor": 5, "colorFunction": "HSB", "scaleBrightness": 1000, "scaleWhiteColor": 1000 }

I'm assuming because the schema lists the brightness and color scale as 1000 that it uses HSB color, but I have tried with HEXHSB and get the same type of problem.

Any idea what might be the issue here?

leereichardt commented 1 year ago

Question... How are you decoding the Raw response?