codetheweb / homebridge-tuya-outlet

A plugin for Homebridge for Tuya-based outlets
15 stars 11 forks source link

Crashing plugin #15

Closed socalcal closed 6 years ago

socalcal commented 6 years ago

I installed this plugin using the uuid as the devId in the config.json file and shortly after home bridge starts up and is added to home kit, I get:

/usr/local/lib/node_modules/homebridge-tuya-outlet/node_modules/tuyapi/index.js:282
      client.write(buffer);
            ^

TypeError: Cannot read property 'write' of null
    at retryConnect.to (/usr/local/lib/node_modules/homebridge-tuya-outlet/node_modules/tuyapi/index.js:282:13)
    at Socket.handleError (/usr/local/lib/node_modules/homebridge-tuya-outlet/node_modules/net-retry-connect/index.js:21:13)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at emitErrorNT (net.js:1278:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

and home bridge quits. Any ideas on what I'm doing wrong? No other devices are running the Jinvoo app. I have another outlet that I'm currently using, but not connected to home bridge. Might that be the issue? Thanks!

codetheweb commented 6 years ago

I'll try to take a look at this in a few days, but for now try passing in an IP address in your config.json. Something like this:

{
  "accessory": "TuyaOutlet",
  "name": "Tuya Outlet",
  "devId": "xxxxxxxxxxxxxxxxxxx",
  "localKey": "xxxxxxxxxxxxxxx",
  "ip": "192.168.x.xxx"
}
socalcal commented 6 years ago

I realized I had to add the name as "Tuya Outlet" in the config.json file, but could the change it in Home app. Working great now. No need for ip field. Thanks!

codetheweb commented 6 years ago

👍