tavicu / homebridge-samsung-tizen

Homebridge plugin for Samsung TV's with Tizen OS
MIT License
638 stars 86 forks source link

Question - Device Power State Triggers #676

Open JasonGoldenDDT opened 2 months ago

JasonGoldenDDT commented 2 months ago

I understand there are technical limitations for now Samsung reports the power status of a TV. I've read the support document about this limitation.

My question is around how homebridge stores device status. If a user triggered power event for example sends a message to homebridge the power is off, and thus displays this status in HomeKit, how is this data stored?

Does Homebridge store this value until a new value comes from the server? Does it forget?

I am noticing with multiple plugins (LG Thinq / this one), the device falls out of sync with HomeKit frequently. I'm unclear why this could happen if the appliance always sends a single when it's power cycles.

I disabled a Samsung status trigger because the plug in would repeatedly trigger the automation.

"When TV powers on in the evening turn on light." this would work, but a few minutes later it would be triggered again.

It seems like this is an issue that could be resolved with software logic. Something that ignores the repeating ping values and only acknowledges the devices triggered value changes.

tavicu commented 2 months ago

Hi.

"until a new value comes from the server" no value comes from the device if that's what you mean. Because samsung tvs don't report changes of the state.

The plugin is pinging the TV and update the state based on multiple checks.

Unfortunately it cannot be resolved with the current software logic that Samsung provides :)

JasonGoldenDDT commented 2 months ago

Thank you for that clarification.

Can you elaborate on how the plug-in handles signals from Samsung's API?

Is it able to differentiate between a user initiated push / pull event and the API's routine event?

I notice that HomeKit reflects the TV power status near instantly when I power on/off using the TV remote.

This suggest the API is pushing the update when it receives the update.

Could the plugin be updated with logic to ignore duplicate values for power status? Adjusting this may keep the automation triggers from firing repeatedly with each polling event.

For example:

If the User Power cycles the TV to ON, the plugin won't update HomeKit until that value change to OFF.