kpsuperplane / homebridge-wiz-lan

Control Wiz lights over LAN
Apache License 2.0
115 stars 37 forks source link

"This plugin slows down Homebridge" Reported by Homebridge 1.3.x #37

Closed muzzymate closed 3 years ago

muzzymate commented 3 years ago

Noticed while testing #32 and wanted to bring forward since still unresolved.

This is occurring when a bulb goes off-line or powered off at the mains. The below messages are logged to the console for each bulb that is powered off at the switch. I have two Wiz bulbs controlled by a single switch, so I see the below message twice. After about 10 seconds, the bulb reports in Homekit as "No Response". However, during this 10 seconds or so, the other Wiz lights are stuck on "Updating" until the timeout occurs. I have all plug-ins isolated with to their own Child Bridge, so for me only affects the Wiz lights.

[2/24/2021, 8:51:44 AM] [homebridge-wiz-lan] This plugin slows down Homebridge. The read handler for the characteristic 'On' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.
[2/24/2021, 8:51:44 AM] [homebridge-wiz-lan] This plugin slows down Homebridge. The read handler for the characteristic 'Brightness' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.

Stats:

kpsuperplane commented 3 years ago

Unfortunately it seems like this might be a homebridge limitation. The plugin responds with the successful values as soon as possible, but it seems like homebridge will wait for everything to respond.

Since pretty much the only way to determine if the bulb is offline is by waiting 10s for it to respond there isn't much I can do about it :(

MoTechnicalities commented 3 years ago

Is there a way to have HomeKit pull from cached values and just have the plugin update the cached values?

Fernyman79 commented 3 years ago

Came here to say the same. In my case the plugin was taking home bridge down, so I had to uninstall it. A shame, it was one of my favorite plugins, and also one of the more useful. It was like hue for the rest of us =)

For now I'll use the wiz app. I Hope you manage to resolve the issue.

kpsuperplane commented 3 years ago

@MoTechnicalities I could just have it report a successful change immediately, but that would not reflect real world conditions.

To be clear, we're talking about actually disconnected bulbs that don't have any power right?

MoTechnicalities commented 3 years ago

I can only say that I noticed that the Tuya app advertises that they cache the state for greater speed. I don't pretense to understand the inner workings. But yes, something needs to be done about bulbs or devices that are in a powerless state. It simply takes too long for everything to come back if you have to wait the full 10 seconds or so just to find out that other bulbs that had nothing to do with this powerless state ARE available! How are other plugins doing this?

MoTechnicalities commented 3 years ago

OR... If it is posible for the plugin to know which bulbs have not responded within a certain short test cycle amount of time simply assign them to a "no response" state until the next short test cycle period.

JesGagnon commented 3 years ago

Just curious if a fix for this has been planned? I still get it whenever I open my Home app; it takes a few seconds for the bulbs' state to be recognized, and that is with their main power always on. It used to work perfectly until a recent update.

kpsuperplane commented 3 years ago

Hey all, I'll look into this tomorrow

muzzymate commented 3 years ago

@Fernyman79 - definitely look into setting up the Wiz plugin on a Child Bridge - available on Homebridge 1.3 and above. That way your other devices will not be held up if you have a Wiz light powered off at the switch/main. Other devices can respond while Wiz is determining if a light is going to report back or not. You'll have to wait to control other Wiz bulbs, but your other devices will be controllable within a normal time span.

@kpsuperplane - Correct, this occurs for bulbs that are not receiving power (either by being unscrewed/switched off with a light switch/otherwise offline). The currently in beta version of Homebridge-Magichome-Dynamic-Plugin and if I remember correctly, the Homebridge-Tuya plugin seem to handle this particular situation but I'm not a programmer so unable to detail how they do it.

MoTechnicalities commented 3 years ago

Thanks for that Child Bridge tip! At least it put a bandaid on a really large wound! We need a cure though!

kpsuperplane commented 3 years ago

Let me know if 3.0.2 helps!

muzzymate commented 3 years ago

Thanks @kpsuperplane! Just updated and will give a full shakedown and let you know findings.

MoTechnicalities commented 3 years ago

homebridge-wiz-lan v3.0.2.... Much improvement!

muzzymate commented 3 years ago

Closing this issue. After spending some time with the update, I think we are in a good spot. Thank you!