Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After plugging off the socket and setting it back, have to restart homebridge server #33

Open
makstech opened this issue Jan 30, 2018 · 1 comment

Comments

@makstech
Copy link

makstech commented Jan 30, 2018

Your plugin is awesome and saved my day, so thanks!
But what I found, is that, if you take out the socket or it is not plugged in from beginning (homebridge launch), it will still be available in Home app and after plugging it back, it won't work at all for at least a minute (although from Mi Home App it's working right away) and then, it will just burst all those times that you've pressed in Home app that toggle switch.
Is it possible to fix that?

If it is not plugged in from the beginning it will log this error:

poll update failed on 66070639 { Error: send EHOSTDOWN 192.168.8.199:54321
    at Object._errnoException (util.js:1024:11)
    at _exceptionWithHostPort (util.js:1046:20)
    at SendWrap.afterSend [as oncomplete] (dgram.js:498:11)
  code: 'EHOSTDOWN',
  errno: 'EHOSTDOWN',
  syscall: 'send',
  address: '192.168.8.199',
  port: 54321 }

And other times it send:

poll update failed on 66070639 { Error: Call to device timed out
    at retry (/usr/local/lib/node_modules/homebridge-miio/node_modules/miio/lib/device.js:225:18)
    at _ensureToken.catch.err (/usr/local/lib/node_modules/homebridge-miio/node_modules/miio/lib/device.js:238:8)
    at <anonymous> code: 'timeout' }

And also, what about adding config setting to set a name for specific ID so it would be a lot more convenient to see which device is triggered or is timing out..
Thanks

@Bluebie
Copy link
Owner

Bluebie commented Jan 31, 2018

hm that's odd. i thought it would mark the device unavailable after some poll failures. unplugged plugs is not a common scenario in my house. unsure what's going on with the bursting.

as for naming, i think it's possible to expose an optional name attribute over homekit, so when the device is renamed in Home app, that is transmitted to homebridge and the plugin, and could be used for debug messages. It wouldn't be a ton of work to implement, and i think it's a more reasonable way to solve that problem than hard coding device id's in to a config file on the homebridge system.

but, to be honest, i totally lack motivation to do any of this. i hate coding, and this thing does everything i need it to do. if you want to implement some cool stuff and send a pull request i'm happy to look over it, give it a test, and publish it though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants