Closed entmike closed 7 years ago
I kinda monkey-patched it on line 65 of accessory.js and changed it to this for now:
return done(undefined, (outlet)?outlet.powered:null);
Interesting, I only have one Power Pivot Genius strip so I actually haven't verified if this would work well with multiple strips (should work theoretically).
Could you try logging the content of error
on line 65 to see what's the actual Wink API error?
It sounds like the error is due to a configured outlet not found.
I logged error and it always just comes back undefined. It would seem that there is "no error", however the outlet argument sometimes is also being passed null/undefined. Thus, I just kinda put some error checking there to not throw an exception and everything works as intended.
Also, I've added some small additional code enhancements that adds proper(ish) homebridge logging for the powerstrips, as well as changes to the state of each outlet. Would you be interested in me committing the changes for your review?
Ok interesting, I was planning on getting a second strip soon so I can further verify what's going on. Please do open a pull request with your improvements, much appreciated!
Hm, I am trying to, but do you have to add me as a collaborator? I cannot seem to open a pull request.
EDIT: I think I figured it out. Ignore my ignorance with all things Github :)
I have two Power Pivot Genius strips. One will reliably turn on and off, the other will change state once to on or off, and then crash. Below is example from config.json:
The error in the command window is as follows after toggling the outlet:
It's probably user error on my part, but I'm at a loss. Both strips work fine from Wink app, but the iOS Home app will crash out homebridge on certain outlets.
Thanks for any help, and for writing this plugin!