AMoo-Miki / homebridge-tuya-lan

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

kindly help me.. Losing my mind here. #132

Open costispavlou opened 4 years ago

costispavlou commented 4 years ago

for starters.. https://www.reddit.com/r/homebridge/comments/edft9a/tuya_plugin_that_works/

I've managed to end up with this config.json but nothing seems to work.

{ "platform": "TuyaLan", "devices": [ { "name": "Office Shutter", "type": "SimpleBlinds", "manufacturer": "TeePao", "model": "Roller Switch", "id": "606020702cf4323eb64b", "ip": "164.215.19.174", "timeToOpen": 15, "timeToTighten": 15, "key": "3055722c675ebebf", "flipState": true }, { "name": "Bedroom Shutter", "id": "xxx", "key": "xxx", "model": "Roller Switch", "ip": "164.215.19.174", "timeToOpen": 15, "timeToTighten": 15, "flipState": true }, { "name": "Boiler Switch", "id": "xxx", "key": "xxx" } ] }

costispavlou commented 4 years ago

I've tried to do everything from the top. tuya-lan-find gives the error: at /usr/local/lib/node_modules/homebridge-tuya-lan/node_modules/http-mitm-proxy/lib/proxy.js:95:23 at /usr/local/lib/node_modules/homebridge-tuya-lan/node_modules/http-mitm-proxy/lib/ca.js:132:12 at /usr/local/lib/node_modules/homebridge-tuya-lan/node_modules/http-mitm-proxy/node_modules/async/dist/async.js:3888:9 at /usr/local/lib/node_modules/homebridge-tuya-lan/node_modules/http-mitm-proxy/node_modules/async/dist/async.js:473:16 at replenish (/usr/local/lib/node_modules/homebridge-tuya-lan/node_modules/http-mitm-proxy/node_modules/async/dist/async.js:1006:25) at iterateeCallback (/usr/local/lib/node_modules/homebridge-tuya-lan/node_modules/http-mitm-proxy/node_modules/async/dist/async.js:995:17) at /usr/local/lib/node_modules/homebridge-tuya-lan/node_modules/http-mitm-proxy/node_modules/async/dist/async.js:969:16 { code: 'EADDRINUSE', errno: 'EADDRINUSE', syscall: 'listen', address: '::', port: 8080

costispavlou commented 4 years ago

uninstalled the plugin. Reinstalled the plugin.

Same error at step 5.i as posted above

costispavlou commented 4 years ago

reinstalled the plugin ip changed to fixed ip's. discovered. but still no play

costispavlou commented 4 years ago

[Homebridge] [TuyaAccessory] Closed connection with Bedroom Shutter [Homebridge] [TuyaAccessory] Socket had a problem and will reconnect to Office Shutter (Error: ERR_PING_TIMED_OUT) [Homebridge] [TuyaAccessory] Closed connection with Office Shutter [Homebridge] [TuyaAccessory] Socket had a problem and will reconnect to Bedroom Shutter (Error: ERR_PING_TIMED_OUT) [Homebridge] [TuyaAccessory] Closed connection with Bedroom Shutter [Homebridge] [TuyaAccessory] Socket had a problem and will reconnect to Office Shutter (Error: ERR_PING_TIMED_OUT)

costispavlou commented 4 years ago

uninstalled/reinstalled plugin. changed the port of hoobs to 8000 tuya-lan-find now works with sudo

Error: Error: socket hang up at connResetException (internal/errors.js:570:14) at TLSSocket.onSocketClose (_tls_wrap.js:915:23) at TLSSocket.emit (events.js:215:7) at net.js:659:12 at Socket.done (_tls_wrap.js:481:7) at Object.onceWrapper (events.js:300:26) at Socket.emit (events.js:210:5) at TCP. (net.js:659:12) { code: 'ECONNRESET' } Error: Error: socket hang up at connResetException (internal/errors.js:570:14) at TLSSocket.onSocketClose (_tls_wrap.js:915:23) at TLSSocket.emit (events.js:215:7) at net.js:659:12 at Socket.done (_tls_wrap.js:481:7) at Object.onceWrapper (events.js:300:26) at Socket.emit (events.js:210:5) at TCP. (net.js:659:12) { code: 'ECONNRESET' } Error: Error: socket hang up at connResetException (internal/errors.js:570:14) at TLSSocket.onSocketClose (_tls_wrap.js:915:23) at TLSSocket.emit (events.js:215:7) at net.js:659:12 at Socket.done (_tls_wrap.js:481:7) at Object.onceWrapper (events.js:300:26) at Socket.emit (events.js:210:5) at TCP. (net.js:659:12) { code: 'ECONNRESET'

costispavlou commented 4 years ago

Failed to save public key to disk in /usr/local/lib/node_modules/homebridge-tuya-lan/bin/keys [Error: EACCES: permission denied, open '/usr/local/lib/node_modules/homebridge-tuya-lan/bin/keys/a1.tuyaeu.com.public.key'] { errno: -13, code: 'EACCES', syscall: 'open', path: '/usr/local/lib/node_modules/homebridge-tuya-lan/bin/keys/a1.tuyaeu.com.public.key'

costispavlou commented 4 years ago

I give up.

TheHomekitWayFinder commented 4 years ago

@costispavlou try using this config file but make sure you put in the information of the devices and report back to see if it works as the most likely thing is that your config is wrong as there were things missing in your config.

{ "platform": "TuyaLan", "devices": [ { "name": "Office Shutter", "type": "SimpleBlinds", "manufacturer": "TeePao", "model": "Roller Switch", "id": "606020702cf4323eb64b", "key": "3055722c675ebebf", "ip": "164.215.19.174", "timeToOpen": 15, "timeToTighten": 15, "flipState": true }, { "name": "Bedroom Shutter", “type”: “SimpleBlinds”, “manufacturer”: “TeePao”, “model”: “Roller Switch”, "id": "xxx", "key": "xxx", "ip": "164.215.19.174", "timeToOpen": 15, "timeToTighten": 15, "flipState": true }, { "name": "Boiler Switch", “type”: “SimpleLight”, “manufacturer”: “xxx”, “model”: “Boiler Switch”, "id": "xxx", "key": "xxx" } ] }

Sent with GitHawk

costispavlou commented 4 years ago

thanks for the help. hoobs reports that the json is invalid so can't be saved.

i've fixed the errors and saved successfully

[Homebridge] [TuyaAccessory] Discovery started.

[Homebridge] [12/21/2019, 16:24:05] [TuyaLan] Failed to discover Office Shutter (606020702cf4323eb64b) in time but will connect via 192.168.0.30. [Homebridge] [12/21/2019, 16:24:05] [TuyaLan] Failed to discover Bedroom Shutter (606020702cf4323e73fa) in time but will connect via 192.168.0.22. [Homebridge] [12/21/2019, 16:24:05] [TuyaLan] Failed to discover Boiler Switch (bfdd2fb56a0b8d19ffxsao) in time but will keep looking. [Homebridge] [12/21/2019, 16:24:06] [TuyaLan] Connected to Office Shutter [Homebridge] [12/21/2019, 16:24:06] [TuyaLan] Connected to Bedroom Shutter

The two shutter switches are connected but pressing on them does nothing. Boiler switch does not connect

TheHomekitWayFinder commented 4 years ago

When homebridge connects to the devices does it send a first query to the devices or not. Can you send a link to the boiler switch so that I can see what it supports and whether SimpleLight is the right thing to set it up as

Sent with GitHawk

costispavlou commented 4 years ago

[Homebridge] [TuyaAccessory] Closed connection with Office Shutter [Homebridge] [TuyaAccessory] Socket had a problem and will reconnect to Bedroom Shutter (Error: ERR_PING_TIMED_OUT) [Homebridge] [TuyaAccessory] Closed connection with Bedroom Shutter [Homebridge] [TuyaAccessory] Socket had a problem and will reconnect to Office Shutter (Error: ERR_PING_TIMED_OUT) [Homebridge] [TuyaAccessory] Closed connection with Office Shutter [Homebridge] [TuyaAccessory] Socket had a problem and will reconnect to Bedroom Shutter (Error: ERR_PING_TIMED_OUT) [Homebridge] [TuyaAccessory] Closed connection with Bedroom Shutter [Homebridge] [TuyaAccessory] Socket had a problem and will reconnect to Office Shutter (Error: ERR_PING_TIMED_OUT)

costispavlou commented 4 years ago

The boiler switch is a switch. water heater switch so it shouldn't be a light, but an outlet

costispavlou commented 4 years ago

all of the shutter switches work with the tuya-web plugin but as lights. I want to have the blind icon and their functionality, that's why I'm busting my head to make this work.

the water switch works perfectly as outlet.

costispavlou commented 4 years ago

https://www.aliexpress.com/item/Tuya-Smart-Life-WiFi-Curtain-Blind-Switch-for-Roller-Shutter-Electric-motor-Google-Home-Alexa-Echo/32963064005.html?

https://www.aliexpress.com/item/Tuya-Smart-Life-WiFi-Curtain-Blind-Switch-for-Roller-Shutter-Electric-motor-Google-Home-Alexa-Echo/32963064005.html?

costispavlou commented 4 years ago

nothing works. Whatever I do it doesn't want to work. And if connected, toggling does nothing.

costispavlou commented 4 years ago

[Homebridge] [12/21/2019, 17:15:08] [TuyaLan] Failed to discover Office Shutter (606020702cf4323eb64b) in time but will connect via 192.168.0.30. [Homebridge] [12/21/2019, 17:15:08] [TuyaLan] Failed to discover Bedroom Shutter (606020702cf4323e73fa) in time but will connect via 192.168.0.22. [Homebridge] [12/21/2019, 17:15:08] [TuyaLan] Bedroom Shutter has a different type (14 vs 7) [Homebridge] [12/21/2019, 17:15:08] [TuyaLan] Unregistering Bedroom Shutter [Homebridge] [12/21/2019, 17:15:08] [TuyaLan] Failed to discover Boiler Switch (bfdd2fb56a0b8d19ffxsao) in time but will keep looking. [Homebridge] [12/21/2019, 17:15:08] [TuyaLan] Connected to Office Shutter [Homebridge] [12/21/2019, 17:15:08] [TuyaLan] Connected to Bedroom Shutter [Homebridge] [TuyaAccessory] Socket had a problem and will reconnect to Office Shutter (Error: ERR_PING_TIMED_OUT) [Homebridge] [TuyaAccessory] Closed connection with Office Shutter [Homebridge] [TuyaAccessory] Socket had a problem and will reconnect to Bedroom Shutter (Error: ERR_PING_TIMED_OUT) [Homebridge] [TuyaAccessory] Closed connection with Bedroom Shutter [Homebridge] [TuyaAccessory] Socket had a problem and will reconnect to Bedroom Shutter (Error: ERR_PING_TIMED_OUT) [Homebridge] [TuyaAccessory] Closed connection with Bedroom Shutter [Homebridge] [TuyaAccessory] Socket had a problem and will reconnect to Office Shutter (Error: ERR_PING_TIMED_OUT) [Homebridge] [TuyaAccessory] Closed connection with Office Shutter [Homebridge] [TuyaAccessory] Socket had a problem and will reconnect to Office Shutter (Error: ERR_PING_TIMED_OUT) [Homebridge] [TuyaAccessory] Closed connection with Office Shutter [Homebridge] [TuyaAccessory] Socket had a problem and will reconnect to Bedroom Shutter (Error: ERR_PING_TIMED_OUT) [Homebridge] [TuyaAccessory] Closed connection with Bedroom Shutter

costispavlou commented 4 years ago

{ "platform": "TuyaLan", "devices": [ { "name": "Office Shutter", "type": "SimpleBlinds", "manufacturer": "bleh", "model": "Roller Switch", "ip": "192.168.0.30", "id": "*", "key": "**", "timeToOpen": 15, "timeToTighten": 15
}, { "name": "Bedroom Shutter", "type": "Outlet", "manufacturer": "whoeverdidthis", "model": "Roller Switch", "id": "*
", "ip": "192.168.0.22", "key": "", "timeToOpen": 15, "timeToTighten": 15, "flipState": true }, { "name": "Boiler Switch", "type": "Outlet", "manufacturer": "me", "model": "Outlet", "ip": "192.168.0.11", "id": "**", "key": "" } ] }

costispavlou commented 4 years ago

I'm using hoobs by the way. If that matters somehow.

costispavlou commented 4 years ago

the id must be the virtualid ? or the mac address?

"id": "606020702xxxxxxxx", or just the xxx

costispavlou commented 4 years ago

after failing to do anything via homekit, when I use tuya smart application the log shows this:

[Homebridge] [TuyaAccessory] Odd message from Office Shutter with command 8: { cmd: 8, data: 'n³Þê\tb‘ã•G§0Ë\u0005\u001cK' } [Homebridge] [TuyaAccessory] Closed connection with Office Shutter [Homebridge] [TuyaAccessory] Socket had a problem and will reconnect to Office Shutter (ECONNRESET)

TheHomekitWayFinder commented 4 years ago

The id must be the virtual if of the device that you can find in the TuyaSmart app

Sent with GitHawk

costispavlou commented 4 years ago

The id must be the virtual if of the device that you can find in the TuyaSmart app

Sent with GitHawk

everything is correct. The plugin just doesn't want to work.

eshventures commented 3 years ago

Exact same problem...plugin has Cleary been neglected by the developers. It doesn't work anymore. My devices are correctly setup with Virtual ID and Key. They show in Homekit but do nothing. Tried everything include static IP for each device. Will have to unfortunately go back to Tuya Web which I don't want to do.

ajayk24 commented 3 years ago

So i was going crazy for a few days with the exact same issue and finally, I managed to figure it out. I am using homebridge on a raspberry pi 4 and here's how I made it to work.

In the plugins section, click on the settings icon of the homebridge tuya lan plugin and select install previous version and from there select v1.5.0-rc.12-rc (which is actually above the v1.4.0). After this restart the homebridge and the connections should now work.

tproenca commented 3 years ago

So i was going crazy for a few days with the exact same issue and finally, I managed to figure it out. I am using homebridge on a raspberry pi 4 and here's how I made it to work.

In the plugins section, click on the settings icon of the homebridge tuya lan plugin and select install previous version and from there select v1.5.0-rc.12-rc (which is actually above the v1.4.0). After this restart the homebridge and the connections should now work.

It worked for me. Thank you so much!!!

eshventures commented 3 years ago

So i was going crazy for a few days with the exact same issue and finally, I managed to figure it out. I am using homebridge on a raspberry pi 4 and here's how I made it to work.

In the plugins section, click on the settings icon of the homebridge tuya lan plugin and select install previous version and from there select v1.5.0-rc.12-rc (which is actually above the v1.4.0). After this restart the homebridge and the connections should now work.

Thanks so much. This certainly sounds like the solution! However, I’m using hoobs…Does anyone know how to do this with hoobs? Thanks in advance for any guidance.