Closed TheEngineerGuy closed 1 year ago
Hi @TheEngineerGuy The only way the plugin can determine the power state of the TV is to ping the network port. Ping response is subject to your local network topology. The ping response is parsed to see if the TVs network port is responding, indicating that the TV is on or off.
Please read also this wiki page: https://github.com/jsiegenthaler/homebridge-samsungtvht/wiki/Power-Control#detecting-current-power-state
You may also want to tune your Ping Command and Ping Interval to be more reliable on your local network
Note that a hard-wired LAN where Homebridge and the TV are on the same LAN and same segment will always work better
Correct. My TV isn't hardwired, and I ran packet capture on my Firewall in the middle, no ping response was being sent back by the TV. That is why I posted here :).
I don't believe it is because the status recognized is ON, it is possibly because status update to OFF is not being reflected.
I use another plugin at the same time, which reflects the state correctly.
My plugin works as follows: If a ping response is received, the TV is deemed to be ON If no ping response is received, the TV is deemed to be OFF It's the only means of determining the power state of the TV. This is why you need to up the debugLevel and observe the ping responses. Make sure the ping response for no connection contains the string you have in the plugin config pingResponseOff field
What other plugin are you using? If it contains a different and more reliable power state detection mechanism, I'd be interested in seeing what it does.
I totally get this. And I am in agreement that your plugin works this way. But sometimes the status gets 'stuck at ON' per say. Not sure why.
The other plugin I use is 'https://github.com/mmende/homebridge-samsungtv-control2'
What model TV do you have?Regards JochenSent from my iPhoneOn 15 Oct 2022, at 17:33, TheEngineerGuy @.***> wrote: I totally get this. And I am in agreement that your plugin works this way. But sometimes the status gets 'stuck at ON' per say. Not sure why. The other plugin I use is 'https://github.com/mmende/homebridge-samsungtv-control2'
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>
2012 Samsung UNES6100F
I have a similar problem with my Samsung ES7000 which keeps toggling to ON in HomeBridge even when the TV is turned OFF
This is what the log shows when it happens
Samsung TV HT] Samsung TV LR: getInput returning input 999 [UNKNOWN] [11/17/2022, 9:07:39 AM] [Samsung TV HT] Samsung TV B1: getInput returning input 999 [UNKNOWN] [11/17/2022, 9:07:43 AM] [Samsung TV HT] Samsung TV LR: sendKey: keySequence KEY_POWEROFF [11/17/2022, 9:07:43 AM] [Samsung TV HT] Samsung TV LR: sendKey: send KEY_POWEROFF [11/17/2022, 9:08:15 AM] [Samsung TV HT] Samsung TV LR: Power changed from 0 OFF to 1 ON
@johnnyacarter Thanks, that helps. I've also noticed some strange behavior since iOS 16. I'll spend some time on in in the next few days.
For some reason it's remaining OFF currently, but i'm getting a lot of these lines in the log
[11/17/2022, 2:40:48 PM] [Samsung TV HT] Samsung TV B1: getInput returning input 999 [UNKNOWN] [11/17/2022, 2:40:48 PM] [Samsung TV HT] Samsung TV B1: getCurrentMediaState returning 2 [STOP] [11/17/2022, 2:40:48 PM] [Samsung TV HT] Samsung TV B1: getTargetMediaState returning 2 [STOP] [11/17/2022, 2:40:48 PM] [Samsung TV HT] Samsung TV LR: getInput returning input 999 [UNKNOWN] [11/17/2022, 2:40:48 PM] [Samsung TV HT] Samsung TV LR: getCurrentMediaState returning 2 [STOP] [11/17/2022, 2:40:48 PM] [Samsung TV HT] Samsung TV LR: getTargetMediaState returning 2 [STOP] [11/17/2022, 2:40:48 PM] [Sonos] Kitchen Sonos: get Remaining Duration: return 0s [11/17/2022, 2:40:48 PM] [Sonos] Library Sonos: get Remaining Duration: return 0s [11/17/2022, 2:40:48 PM] [Samsung TV HT] Samsung TV B1: getInput returning input 999 [UNKNOWN] [11/17/2022, 2:40:48 PM] [Samsung TV HT] Samsung TV B1: getCurrentMediaState returning 2 [STOP] [11/17/2022, 2:40:48 PM] [Samsung TV HT] Samsung TV B1: getTargetMediaState returning 2 [STOP] [11/17/2022, 2:40:48 PM] [Samsung TV HT] Samsung TV LR: getInput returning input 999 [UNKNOWN] [11/17/2022, 2:40:48 PM] [Samsung TV HT] Samsung TV LR: getCurrentMediaState returning 2 [STOP] [11/17/2022, 2:40:48 PM] [Samsung TV HT] Samsung TV LR: getTargetMediaState returning 2 [STOP] [11/17/2022, 2:40:52 PM] [Sonos] Kitchen Sonos: get Remaining Duration: return 0s [11/17/2022, 2:40:52 PM] [Sonos] Library Sonos: get Remaining Duration: return 0s [11/17/2022, 2:40:52 PM] [Samsung TV HT] Samsung TV B1: getInput returning input 999 [UNKNOWN] [11/17/2022, 2:40:52 PM] [Samsung TV HT] Samsung TV B1: getCurrentMediaState returning 2 [STOP] [11/17/2022, 2:40:52 PM] [Samsung TV HT] Samsung TV B1: getTargetMediaState returning 2 [STOP] [11/17/2022, 2:40:52 PM] [Samsung TV HT] Samsung TV LR: getInput returning input 999 [UNKNOWN] [11/17/2022, 2:40:52 PM] [Samsung TV HT] Samsung TV LR: getCurrentMediaState returning 2 [STOP] [11/17/2022, 2:40:52 PM] [Samsung TV HT] Samsung TV LR: getTargetMediaState returning 2 [STOP]
@johnnyacarter I think I'll modify the ping response. At the moment it relies on 0% loss for ON, and 100% loss for OFF. Any ping response which is between 0% and 100% does not get evaluated. I plan to change it to 100% loss = OFF, anything else showing at least one ping response was received = ON
@johnnyacarter, @TheEngineerGuy I've made the changes, documented in this branch: https://github.com/jsiegenthaler/homebridge-samsungtvht/tree/Improve-PowerStateMonitor
I have released v0.1.24-beta.1 I would appreciate it if you could install it, try it for a few days, and let me know if detection of the power state is more stable
@johnnyacarter, @TheEngineerGuy I've made the changes, documented in this branch:
https://github.com/jsiegenthaler/homebridge-samsungtvht/tree/Improve-PowerStateMonitor
I have released v0.1.24-beta.1
I would appreciate it if you could install it, try it for a few days, and let me know if detection of the power state is more stable
I have installed v0.1.24-beta.1, seems to be working but still getting these lines in the log
getInput returning input 999 [UNKNOWN]
Hi @johnnyacarter : "getInput returning input 999 [UNKNOWN]" is behaviour by design when the plugin debugLevel is >0. Set debugLevel to None in the plugin settings, or "debugLevel": 0, in the config.json. Then restart Homebridge and those debug messages will no longer appear in the log.
The reason getinput always returns UNKNOWN is that te plugin has no means of requesting the current state of the TV, and thus never knows which Input the TV is set to (HDMI1, HDMI2, etc)
Good find!! Seems to be working fine now. Closing the issue. Thanks @jsiegenthaler .
In my view, this plugin is perfect now.
It’s still doing it, after a restart of Homebridge, the Samsung ES7000 TV is ON when it is actually OFF. My second Samsung ES6540 TV ES6540 is reporting OFF. Both TV’s are set up the same
On 22 Nov 2022, at 02:19, TheEngineerGuy @.***> wrote:
Closed #12 as completed.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.
Hi @johnnyacarter Happy to help further, but I do need logs. Please put Homebridge in debug mode, and restart. Make sure that your observed issue is produced. If not, truncate the log, do another restart, and observe again. Once you see the issue occurring, send me the log file by email (insert a g between j and s of my username and use that well known email service starting with g)
Here is a section of the log, I turned the TV OFF on IOS Home at 10:40 and it then later turned its self back ON, I then repeated it again at 10:43
I have worked out why my Samsung TV flipped to "ON" in the plugin in homebridge. In the TV settings under system there is a preference for auto update firmware in standby mode, if you turn this off the plugin won't get successful ping request and then assumes the TV is on. Hope this helps someone out there
Thanks for the feedback. That confirms it is not a plugin issue at all. I'll close the issue.
Describe The Bug: Hard to reproduce - Sometimes HomeKit status gets stuck in 'ON' even when TV is off.
To Reproduce: Turn TV off from remote. Sometimes, HomeKit TV status stays ON perpetually.
Expected behavior: Turn TV off from remote. HomeKit TV status changes to OFF.
Plugin Config:
Screenshots:
Environment: