homebridge-lifx-lan icon indicating copy to clipboard operation
homebridge-lifx-lan copied to clipboard

State out of sync

Open abjugard opened this issue 7 years ago • 8 comments

I use a utility called LSwitch on my laptop to quickly turn the bulbs on or off. This works great except for one thing, HomeBridges knowledge of the power state of my lights goes out of sync.

This means that if I turn the lights off this way when I go to bed, to get them to turn back on in the morning I have to ask HomeBridge to turn them off (even though they are visibly off), and then on.

I believe the culprit is this line of code. Are those if clauses necessary for anything other than to minimise traffic?

abjugard avatar Apr 08 '17 20:04 abjugard

I experience this issue as well if I use the Lifx app or a flic button to change the lights. Homebridge goes out of sync and I have to do the same thing, telling Siri to turn them off and then on again to make it work.

AmpacheUser avatar May 02 '17 21:05 AmpacheUser

@abjugard @AmpacheUser i've released a new version (0.2.2) that removes the highlighted section of code...hopefully that resolves it.

devbobo avatar May 04 '17 04:05 devbobo

This does seem to have fixed the issue. Thanks

AmpacheUser avatar May 10 '17 03:05 AmpacheUser

Hi dev. Still having the same issue here as well. Using any other software (LIFX app, Echo, Lightbow, etc) to flip a LIFX and Homebridge-lifx-lan goes out of status sync. A bit annoying.... is there some sort of status update feature you can implement? Thank you

Jinsterrrr avatar Aug 03 '17 11:08 Jinsterrrr

I found the following bit of code from the documentation for node-lifx

I am not a programmer. So don't really know what to do with it. But it seems like it will give us status updates on the lights if we can set this bit of code to run every few minutes...

https://www.npmjs.com/package/node-lifx#requesting-light-state-and-info

Jinsterrrr avatar Aug 04 '17 08:08 Jinsterrrr

G'day @Jinsterrrr,

Are you able to provide for more detailed info that than it's not working ? Are you changing the state and checking the status on the same device ? Which HomeKit app are you using ?

What versions of homebridge-lifx-lan and homebridge are you using ?

Please watch the video linked below, as it shows the Home app keeping in sync as it should... https://www.smugmug.com/gallery/n-wzcB3J/i-XpMPsqK

Thanks,

David

devbobo avatar Aug 08 '17 07:08 devbobo

Hi David. Thanks for providing the video. I am using the latest versions of homebridge and the lifx-lan plug-in, both were installed just a few days ago with the npm command.

The problem exists. I will explain the full setup and how to replicate it.

For simplicity, I have an iPhone, and an iPad. The iPad is permanently fixed to the wall as an automation switch. I have the LIFX app and the Home app installed on both the iPhone and the iPad. Homebridge and LIFX-lan are both running inside a VM (Ubuntu guest, Windows host).

If I operate the LIFX lights via the LIFX app on the iPad, then switch to the Home app on the iPad, then the status does indeed update itself in the Home app. This is consistent with the video you have shown.

If I operate the LIFX lights via the LIFX app on the iPhone, however, the Home app on the iPad does NOT update the light status, UNLESS I briefly switch to the LIFX app on the iPad first, to allow the LIFX app on the iPad to update its status, and then go back to the Home app on the iPad. This way, the Home app updates the status. But NOT if I wait too long (let's say a minute). If I don't swipe to the LIFX app on the iPad within a minute or so, even though the LIFX app still updates its status, Home no longer does....

So in summary: change LIFX on iPad -> Home on iPad updates change LIFX on iPhone -> quickly swipe to LIFX on iPad to allow status update -> Home on iPad updates change LIFX on iPhone -> delayed or not swiping to LIFX on iPad -> Home on iPad does not update Operate LIFX in any other way not on the iPad (e.g: via Echo) -> quickly swipe to LIFX on iPad to allow it to update -> Home on iPad updates Operate LIFX in any other way not on the iPad (e.g: via Echo) -> delayed or not swiping to LIFX on iPad first to allow it to update -> Home on iPad does not update

Jinsterrrr avatar Aug 16 '17 01:08 Jinsterrrr

I had the same error with this plugin got frustrating, so i decided to go another path. Used node-red-contrib-node-lifx plugin with node-red and everything works great. If anyone is interested just let me know.

maragelis avatar Oct 03 '17 06:10 maragelis