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

stuck at updating.. if a light is offline #21

Open
jaghond777 opened this issue Dec 10, 2016 · 9 comments
Open

stuck at updating.. if a light is offline #21

jaghond777 opened this issue Dec 10, 2016 · 9 comments

Comments

@jaghond777
Copy link

I have 3 Lifx 2nd lights, 0.1.8 works extremely well when all are online. But if one of the bulbs is switched off, then the homekit controls get stuck at updating.. both in home app and control center.
i can trigger the lights but it takes longer to respond even though all the buttons buttons continue showing updating.. . This is consistently reproduced.
Currently running on Raspberry Pi first gen

@devbobo
Copy link
Owner

devbobo commented Dec 20, 2016

Try version 0.1.9, hopefully it works better

@jaghond777
Copy link
Author

Thanks, tried that. Doesn't help. Have to hunt down any bulb which is off to get everything working again.

@ryanmaxwell
Copy link

+1 I had to stop using this plugin due to a off bulb breaking the entire homekit stack. I'd like to know when this is improved.

@fiddypal
Copy link

fiddypal commented Jan 3, 2017 via email

@jaghond777
Copy link
Author

This may be a problem with how Homebridge is implemented.
I recently added Tado smart AC control to Homebridge and the plugin speaks to the Tado cloud account to control the accessory.
Now whenever I access Control center or Home app, all of the controls take a second to "Update". This I believe is because the entire Homebridge stack is waiting on the Tado plugin.
If the internet is down, everything gets stuck at updating. Eventually the Home app shows "Apple TV not responding" and X number of accessories not responding.
To remove dependency on internet connectivity, my only option at the moment would be remove the Tado plug in.

@ridn
Copy link

ridn commented Jan 9, 2017

i can't imagine that there wouldn't be a way to fix this, through the plug in itself. Is there no way to just tell homebridge that the device is offline, hence don't wait for a response from the device?

my experience with node is non-existent so, it'd be great to get some input.
@devbobo


edit:

based on the optional parameters provided from he config file, it does look like that these should be sufficient to solve the issue, but if im not mistaken, they do have default values, (very close to the ones provided as an example). Which would mean that it should already be working after a slightly longer wait. However, that does not seem to be the case :(


edit 2:

after tinkering with the optional package parameters i seem to have found a solution that works, but likely isnt the best.
Using the following parameter, home kit should give up on trying to get an update on the device, and homebridge should provide an error (as the description states)

"messageHandlerTimeout": 45000,   // optional: in ms, if not answer in time an error is provided to get methods

setting this to a shorter time (i have it set to 10000ms or 10s) will cause the updating message to be stuck of only 10 seconds before you have control of devices again. Obviously the shorter the time the faster the response, but i imagine thats not the best idea to make the response time so low (since lifx bulbs have been known to drop connections, you have less of a chance of getting the connection back in time). The default value appears to be 45000 ms or 45s. That being said, looks like the bridge will wait the full handler timeout time you set for as long as there are devices that are offline/unreachable. (So you'll be wait ex. 10s every time you want to flip a switch if there is an offline bulb)

To use this "fix" just add the parameter above to your config.json as noted in homebridge-lifx-lan/index.js and lower the value appropriately. Then restart homebridge

homebridge-lifx-lan/index.js

  "platforms": [
      {
          "platform": "LifxLan",           // required
          "name": "LiFx LAN",              // required
          "duration": 1000,                // optional, the time to fade on/off in milliseconds
 
          ** optional node-lifx parameters **
          "broadcast": '255.255.255.255',   // optional: Broadcast address for bulb discovery
          "lightOfflineTolerance": 3,       // optional: A light is offline if not seen for the given amount of discoveries
          "messageHandlerTimeout": 45000,   // optional: in ms, if not answer in time an error is provided to get methods
          "resendPacketDelay": 150,         // optional: delay between packages if light did not receive a packet (for setting methods with callback)
          "resendMaxTimes": 3,              // optional: resend packages x times if light did not receive a packet (for setting methods with callback)
          "debug": false,                   // optional: logs all messages in console if turned on
          "address": '0.0.0.0'              // optional: specify which ipv4 address to bind to
      }
  ],

@beatmag
Copy link

beatmag commented Feb 4, 2017

I have the same problem. I've made the timeouts super short but still it has problems.
Are there any fixes for this? I've noticed the lifx bulbs going offline and instantly going online.

@ridn
Copy link

ridn commented Feb 9, 2017

if you happen to be using control center to control devices, removing the devices which get powered off from your favorites should stop them from attempting to load each time. Obviously not a "solution", but helpful.

@devbobo
Copy link
Owner

devbobo commented Feb 11, 2017

Please try version 0.2.1 and let me know if it resolves this issue.

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

6 participants