codetheweb / homebridge-tuya-outlet

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

Plugin causes "Updating" - "No Response" error #13

Closed blloyd78 closed 6 years ago

blloyd78 commented 6 years ago

Since updating to JSON v8.1.0, this plugin has stopped working. Homebridge appears to start up correctly and occasionally all of the accessories will load up. Within a matter of minutes however, all of the accessories (MiLight LED bulbs, Bose SoundTouch speaker) stop responding. The only way to resume normal activity is to remove reference to Tuya accessories from config.json and uninstall the homebridge-tuya-outlet plugin.

Neither homebridge status (systemctl status -l homebridge) nor syslog show any errors.

Strangely this plugin did work prior to the 8.1.0 upgrade.

codetheweb commented 6 years ago

Sorry, but I have no idea what the problem could be. Try starting Homebridge with DEBUG=* homebridge and see if anything useful shows up.

rrobe53 commented 6 years ago

I get that too. Here's the output I get with no Tuya accessories:

Testing conditions was having the Home application open, with the Homebridge application shut down. Then starting Homebridge and tapping the accessory to cause it to change to updating, eventually failing to no response.

*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
Tue, 24 Apr 2018 23:55:07 GMT EventedHTTPServer Server listening on port 51826
Tue, 24 Apr 2018 23:55:08 GMT EventedHTTPServer [::ffff:x.x.x.178] New connection from client
Tue, 24 Apr 2018 23:55:08 GMT EventedHTTPServer [::ffff:x.x.x.178] HTTP server listening on port 44873
Tue, 24 Apr 2018 23:55:08 GMT EventedHTTPServer [::ffff:x.x.x.178] HTTP request: /pair-verify
Tue, 24 Apr 2018 23:55:08 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify
Tue, 24 Apr 2018 23:55:08 GMT HAPServer [CC:22:3D:E3:CE:30] Pair verify step 1/2
Tue, 24 Apr 2018 23:55:08 GMT EventedHTTPServer [::ffff:x.x.x.178] HTTP Response is finished
Tue, 24 Apr 2018 23:55:08 GMT EventedHTTPServer [::ffff:x.x.x.178] HTTP request: /pair-verify
Tue, 24 Apr 2018 23:55:08 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify
Tue, 24 Apr 2018 23:55:08 GMT HAPServer [CC:22:3D:E3:CE:30] Pair verify step 2/2
Tue, 24 Apr 2018 23:55:08 GMT HAPServer [CC:22:3D:E3:CE:30] Client FE1CA930-BAF0-494E-B83E-2F495F2096B9 verification complete
Tue, 24 Apr 2018 23:55:08 GMT EventedHTTPServer [::ffff:x.x.x.178] HTTP Response is finished
Tue, 24 Apr 2018 23:55:08 GMT EventedHTTPServer [::ffff:x.x.x.178] HTTP request: /accessories
Tue, 24 Apr 2018 23:55:08 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /accessories
Tue, 24 Apr 2018 23:55:08 GMT EventedHTTPServer [::ffff:x.x.x.178] HTTP Response is finished
Tue, 24 Apr 2018 23:55:12 GMT EventedHTTPServer [::ffff:x.x.x.187] New connection from client
Tue, 24 Apr 2018 23:55:12 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP server listening on port 40441
Tue, 24 Apr 2018 23:55:12 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP request: /pair-verify
Tue, 24 Apr 2018 23:55:12 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify
Tue, 24 Apr 2018 23:55:12 GMT HAPServer [CC:22:3D:E3:CE:30] Pair verify step 1/2
Tue, 24 Apr 2018 23:55:12 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP Response is finished
Tue, 24 Apr 2018 23:55:12 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP request: /pair-verify
Tue, 24 Apr 2018 23:55:12 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify
Tue, 24 Apr 2018 23:55:12 GMT HAPServer [CC:22:3D:E3:CE:30] Pair verify step 2/2
Tue, 24 Apr 2018 23:55:12 GMT HAPServer [CC:22:3D:E3:CE:30] Client FE1CA930-BAF0-494E-B83E-2F495F2096B9 verification complete
Tue, 24 Apr 2018 23:55:12 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP Response is finished
Tue, 24 Apr 2018 23:55:12 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP request: /accessories
Tue, 24 Apr 2018 23:55:12 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /accessories
Tue, 24 Apr 2018 23:55:12 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP Response is finished

Here's the output when I do have a Tuya accessory added

*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
2018-04-24T23:55:48.970Z TuyAPI Device(s): 
2018-04-24T23:55:48.972Z TuyAPI [ { type: 'outlet',
    ip: 'x.x.x.26',
    id: '<removed>',
    key: '<removed>',
    uid: '',
    port: 6668,
    version: 3.1,
    cipher: 
     { algorithm: [Object],
       mode: [Object],
       blockSize: 16,
       _finish: false,
       _input: null,
       output: null,
       _op: [Function],
       _decrypt: false } } ]
Tue, 24 Apr 2018 23:55:48 GMT EventedHTTPServer Server listening on port 51826
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.178] New connection from client
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.178] HTTP server listening on port 39919
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.178] HTTP request: /pair-verify
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] Pair verify step 1/2
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.178] HTTP Response is finished
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.178] HTTP request: /pair-verify
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] Pair verify step 2/2
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] Client FE1CA930-BAF0-494E-B83E-2F495F2096B9 verification complete
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.178] HTTP Response is finished
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.178] HTTP request: /accessories
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /accessories
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.178] HTTP Response is finished
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] New connection from client
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP server listening on port 34437
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP request: /pair-verify
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] Pair verify step 1/2
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP Response is finished
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP request: /pair-verify
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] Pair verify step 2/2
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] Client FE1CA930-BAF0-494E-B83E-2F495F2096B9 verification complete
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP Response is finished
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP request: /accessories
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /accessories
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP Response is finished
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP request: /characteristics
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics
Tue, 24 Apr 2018 23:55:50 GMT Accessory [Homebridge] Processing characteristic set: [{"aid":3,"iid":10,"ev":true},{"aid":3,"iid":11,"ev":true}]
Tue, 24 Apr 2018 23:55:50 GMT Accessory [Homebridge] Registering Characteristic "On" for events
Tue, 24 Apr 2018 23:55:50 GMT Accessory [Homebridge] Registering Characteristic "Outlet In Use" for events
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP Response is finished
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP request: /characteristics
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics
Tue, 24 Apr 2018 23:55:50 GMT Accessory [Homebridge] Processing characteristic set: [{"aid":3,"iid":10,"ev":true},{"aid":3,"iid":11,"ev":true}]
Tue, 24 Apr 2018 23:55:50 GMT Accessory [Homebridge] Registering Characteristic "On" for events
Tue, 24 Apr 2018 23:55:50 GMT Accessory [Homebridge] Registering Characteristic "Outlet In Use" for events
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP Response is finished
Tue, 24 Apr 2018 23:55:51 GMT EventedHTTPServer [::ffff:x.x.x.89] New connection from client
Tue, 24 Apr 2018 23:55:51 GMT EventedHTTPServer [::ffff:x.x.x.89] HTTP server listening on port 40975
Tue, 24 Apr 2018 23:55:51 GMT EventedHTTPServer [::ffff:x.x.x.89] HTTP request: /pair-verify
Tue, 24 Apr 2018 23:55:51 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify
Tue, 24 Apr 2018 23:55:51 GMT HAPServer [CC:22:3D:E3:CE:30] Pair verify step 1/2
Tue, 24 Apr 2018 23:55:51 GMT EventedHTTPServer [::ffff:x.x.x.89] HTTP Response is finished
Tue, 24 Apr 2018 23:55:51 GMT EventedHTTPServer [::ffff:x.x.x.89] HTTP request: /pair-verify
Tue, 24 Apr 2018 23:55:51 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify
Tue, 24 Apr 2018 23:55:51 GMT HAPServer [CC:22:3D:E3:CE:30] Pair verify step 2/2
Tue, 24 Apr 2018 23:55:51 GMT HAPServer [CC:22:3D:E3:CE:30] Client FE1CA930-BAF0-494E-B83E-2F495F2096B9 verification complete
Tue, 24 Apr 2018 23:55:51 GMT EventedHTTPServer [::ffff:x.x.x.89] HTTP Response is finished
Tue, 24 Apr 2018 23:55:51 GMT EventedHTTPServer [::ffff:x.x.x.89] HTTP request: /accessories
Tue, 24 Apr 2018 23:55:51 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /accessories
Tue, 24 Apr 2018 23:55:51 GMT EventedHTTPServer [::ffff:x.x.x.89] HTTP Response is finished
Tue, 24 Apr 2018 23:55:54 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP request: /characteristics?id=3.10
Tue, 24 Apr 2018 23:55:54 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /characteristics?id=3.10
Tue, 24 Apr 2018 23:55:54 GMT Accessory [Homebridge] Getting value for Characteristic "On"
2018-04-24T23:55:54.633Z homebridge-tuya Getting device status...
2018-04-24T23:55:54.633Z TuyAPI Payload: 
2018-04-24T23:55:54.634Z TuyAPI { gwId: '<removed>', devId: '<removed>' }
2018-04-24T23:55:54.634Z TuyAPI Sending this data:  000055aa000000000000000a000000467b2267774964223a223031323030313139363030313934353737393634222c226465764964223a223031323030313139363030313934353737393634227d000000000000aa55
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>
2018-04-24T23:55:48.970Z TuyAPI Device(s): 
2018-04-24T23:55:48.972Z TuyAPI [ { type: 'outlet',
    ip: 'x.x.x.26',
    id: '<removed>',
    key: '<removed>',
    uid: '',
    port: 6668,
    version: 3.1,
    cipher: 
     { algorithm: [Object],
       mode: [Object],
       blockSize: 16,
       _finish: false,
       _input: null,
       output: null,
       _op: [Function],
       _decrypt: false } } ]
Tue, 24 Apr 2018 23:55:48 GMT EventedHTTPServer Server listening on port 51826
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.178] New connection from client
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.178] HTTP server listening on port 39919
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.178] HTTP request: /pair-verify
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] Pair verify step 1/2
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.178] HTTP Response is finished
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.178] HTTP request: /pair-verify
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] Pair verify step 2/2
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] Client FE1CA930-BAF0-494E-B83E-2F495F2096B9 verification complete
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.178] HTTP Response is finished
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.178] HTTP request: /accessories
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /accessories
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.178] HTTP Response is finished
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] New connection from client
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP server listening on port 34437
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP request: /pair-verify
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] Pair verify step 1/2
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP Response is finished
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP request: /pair-verify
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] Pair verify step 2/2
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] Client FE1CA930-BAF0-494E-B83E-2F495F2096B9 verification complete
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP Response is finished
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP request: /accessories
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /accessories
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP Response is finished
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP request: /characteristics
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics
Tue, 24 Apr 2018 23:55:50 GMT Accessory [Homebridge] Processing characteristic set: [{"aid":3,"iid":10,"ev":true},{"aid":3,"iid":11,"ev":true}]
Tue, 24 Apr 2018 23:55:50 GMT Accessory [Homebridge] Registering Characteristic "On" for events
Tue, 24 Apr 2018 23:55:50 GMT Accessory [Homebridge] Registering Characteristic "Outlet In Use" for events
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP Response is finished
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP request: /characteristics
Tue, 24 Apr 2018 23:55:50 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics
Tue, 24 Apr 2018 23:55:50 GMT Accessory [Homebridge] Processing characteristic set: [{"aid":3,"iid":10,"ev":true},{"aid":3,"iid":11,"ev":true}]
Tue, 24 Apr 2018 23:55:50 GMT Accessory [Homebridge] Registering Characteristic "On" for events
Tue, 24 Apr 2018 23:55:50 GMT Accessory [Homebridge] Registering Characteristic "Outlet In Use" for events
Tue, 24 Apr 2018 23:55:50 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP Response is finished
Tue, 24 Apr 2018 23:55:51 GMT EventedHTTPServer [::ffff:x.x.x.89] New connection from client
Tue, 24 Apr 2018 23:55:51 GMT EventedHTTPServer [::ffff:x.x.x.89] HTTP server listening on port 40975
Tue, 24 Apr 2018 23:55:51 GMT EventedHTTPServer [::ffff:x.x.x.89] HTTP request: /pair-verify
Tue, 24 Apr 2018 23:55:51 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify
Tue, 24 Apr 2018 23:55:51 GMT HAPServer [CC:22:3D:E3:CE:30] Pair verify step 1/2
Tue, 24 Apr 2018 23:55:51 GMT EventedHTTPServer [::ffff:x.x.x.89] HTTP Response is finished
Tue, 24 Apr 2018 23:55:51 GMT EventedHTTPServer [::ffff:x.x.x.89] HTTP request: /pair-verify
Tue, 24 Apr 2018 23:55:51 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify
Tue, 24 Apr 2018 23:55:51 GMT HAPServer [CC:22:3D:E3:CE:30] Pair verify step 2/2
Tue, 24 Apr 2018 23:55:51 GMT HAPServer [CC:22:3D:E3:CE:30] Client FE1CA930-BAF0-494E-B83E-2F495F2096B9 verification complete
Tue, 24 Apr 2018 23:55:51 GMT EventedHTTPServer [::ffff:x.x.x.89] HTTP Response is finished
Tue, 24 Apr 2018 23:55:51 GMT EventedHTTPServer [::ffff:x.x.x.89] HTTP request: /accessories
Tue, 24 Apr 2018 23:55:51 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /accessories
Tue, 24 Apr 2018 23:55:51 GMT EventedHTTPServer [::ffff:x.x.x.89] HTTP Response is finished
Tue, 24 Apr 2018 23:55:54 GMT EventedHTTPServer [::ffff:x.x.x.187] HTTP request: /characteristics?id=3.10
Tue, 24 Apr 2018 23:55:54 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /characteristics?id=3.10
Tue, 24 Apr 2018 23:55:54 GMT Accessory [Homebridge] Getting value for Characteristic "On"
2018-04-24T23:55:54.633Z homebridge-tuya Getting device status...
2018-04-24T23:55:54.633Z TuyAPI Payload: 
2018-04-24T23:55:54.634Z TuyAPI { gwId: '<removed>', devId: '<removed>' }
2018-04-24T23:55:54.634Z TuyAPI Sending this data:  000055aa000000000000000a000000467b2267774964223a223031323030313139363030313934353737393634222c226465764964223a223031323030313139363030313934353737393634227d000000000000aa55
  EventedHTTPServer [::ffff:x.x.x.187] Client connection closed +1m
  EventedHTTPServer [::ffff:x.x.x.187] HTTP connection was closed +2ms
  EventedHTTPServer [::ffff:x.x.x.187] HTTP server was closed +0ms

The last 7 lines do not pop up until I click the accessory in the Home application on my phone. The last 3 are after a period of time.

.26 is the Homebridge server, .187 is the phone.

codetheweb commented 6 years ago

It's working fine for me at the latest version (1.1.2). It looks like it tries to send data to the device and then restarts? I can't think of why else it would re-log the TuyAPI device down in the middle of your second log.

For testing, try using TuyAPI directly and see if it works (though I doubt the issue is with this package, it's a pretty thin wrapper around TuyAPI).

You could also try the Python port of TuyAPI.

rrobe53 commented 6 years ago

So I actually figured this out last night, didn't get a chance to sign in. I have multiple plugs and even if the configuration only had one I had to manually specify the IP of the actual plug in the config.json. Once manually configured the IP the errors went away and things are now working.

codetheweb commented 6 years ago

Huh, interesting. Glad to hear you got it working.