ha-samsungtv-tizen icon indicating copy to clipboard operation
ha-samsungtv-tizen copied to clipboard

TV poweroff bounce

Open energywave opened this issue 4 years ago • 14 comments

Hello and thank you for your work, I appreciate it very much!

My TV (UE50NU7092) is working nicely with your integration. But, as the integration it arrives from (SamsungTV-Custom, that I was using before) it has a problem in detecting the TV poweroff.

An image is better than 1000 words, please look here: image

At every shutdown the TV is detected (after a while...) as OFF but after about 30 sec it's detected again as ON for about 1:00 to 1:30, then again OFF. That could seem to be a minor problem but if you do lights automation with a trigger on the TV ON or OFF state, well, you can imagine the disco effect when I shutdown TV... I've added, in the meanwhile of a fix, some rules in the automation to overcome this, but I think this is an issue that should be addressed. If in some way I can help to debug what's happening I'll happy to help (I'm a dev, but not a python one, sadly)

Thank you in advance for any effort you'll make.

energywave avatar Jul 14 '20 09:07 energywave

maybe try changing the update_method to something else, possible values are: "ping", "websockets" and "smartthings" ("ping" is the default)

I guess the bounce could be coming from: https://github.com/jaruba/ha-samsungtv-tizen/blob/master/custom_components/samsungtv_tizen/media_player.py#L603-L604

but without those lines, it might just take a long time to turn off.. changing the update_method may give better results though

jaruba avatar Aug 13 '20 20:08 jaruba

On each value in update_method behavior is the same. Every 25 minutes TV is in on state while 10 seconds. image

karol93 avatar Aug 18 '20 08:08 karol93

@karol93 did you enable the smartthings api? if so, try the solutions from this post: https://github.com/jaruba/ha-samsungtv-tizen/issues/77

jaruba avatar Aug 19 '20 06:08 jaruba

Hello,

I have the exact same problem, the television is detected to be on for a few seconds while it is off.

I tried "ping", "websocket" and "smarthing" for update_method but the behavior is exactly the same.

The OFF state is useful in my case to turn off my soundbar (with IR) but suddenly it turns on all the time ...

Television model: QLED 2019 - Q70R

Any help would be appreciated, thanks in advance.

1599897964-tv.jpg - envoi d'image avec NoelShack

xekil avatar Sep 12 '20 08:09 xekil

in my case enabling smartthings API helped

karol93 avatar Sep 12 '20 15:09 karol93

I've tried websocket, exactly same behavior. I have to try smartthings (even if I don't like using internet services for things in my lan...) I had to set some rules on the ON and OFF automation (if elapsed more than 3 minutes from last ON and OFF last_triggered...) But that's far from optimal....

energywave avatar Sep 13 '20 00:09 energywave

i reset the tv and it now works fine with the smarttings method. thank you

xekil avatar Sep 13 '20 16:09 xekil

Hello,

I have same problem but in my case TV detected as ON and when (after 20 sec) OFF but TV itself does not turning ON and OFF. I monitor TV by ping and found that it's every 40-60 minutes start respond for ping for 20 seconds even TV itself turned off. So the source of the problem that TV responding to ping. I try set update_custom_ping_url to http://x.x.x.x:8001/api/v2/ but it's doesn't help because I can open this link in the brower when TV wakeup and reply to pings. Update: TV connected over WiFi

myhomeiot avatar Oct 14 '20 19:10 myhomeiot

go with the smarttings method because in ping the TV responds present even when it is off, probably because of the wake on lan, it was like that for me and since then it is perfect.

xekil avatar Oct 15 '20 05:10 xekil

I did have the same issue with state bouncing between "on" and "off" on minutely basis...

After some investigation I did find that setting custom ping URL (update_custom_ping_url) does the trick - even if you can ping the TV when it wakes up for a short time - the URL from configuration example (http://x.x.x.x:9197/dmr) is not accessible till the TV is really on. So it works well for me.

Of course it works only with update_method = "ping"

nobwyn avatar Jan 09 '21 13:01 nobwyn

@laimoncijus can you please report the exact configuration that works for you, please? :)

energywave avatar Jan 11 '21 16:01 energywave

@energywave: here is my configuration:

media_player:
  - platform: samsungtv_tizen
    name: Samsung TV
    host: samsung-tv.lan
    mac: !secret samsung_tv_mac
    update_custom_ping_url: http://samsung-tv.lan:9197/dmr
    app_list: '{"Disney+": "3201901017640"}'

nobwyn avatar Jan 12 '21 19:01 nobwyn

@laimoncijus thank you so much. I've tried but no better effect. Still the same bounce happens at power off to me. After something like 1 or 2 minutes from poweroff a false poweron is detected, followed by another poweroff and, after some other minutes, the final poweroff. My TV model is: UE50NU7092 I've checked what happens in every phase and I'll report here hoping that @jaruba can understand and help me or fix something in the integration. we start with TV in ON state.

  • TV is ON. Ping is replying. http://<IP>:9197/dmr is replying. Home Assistant shows ON state. [correct] now I turn it off from the integration or from remote, same effect.
  • TV is OFF. Ping is still replying. http://<IP>:9197/dmr is NOT replying. Home Assistant shows OFF state. [correct] now, after one or two minutes...
  • TV is OFF. Ping is still replying. http://<IP>:9197/dmr is now replying again (!!!). Home Assistant shows ON state. [INCORRECT] and finally, after some minutes...
  • TV is OFF. Ping stops replying. http://<IP>:9197/dmr stops replying too. Home Assistant shows OFF state. [correct]

So I'm wondering if it's my TV that is doing something strange and if there is a way to not have that bounce at power off and maybe to detect faster the power off (as lights in my living room changing accordingly, waiting 30 seconds from tv poweroff is A LOT! ...try to explain it to my wife... :D )

I even tried update_method: smartthings but it works even worse, power on detected, power off not detected, source list is only TV / HDMI, nothing more.

Houston, we have a problem... :_(

energywave avatar Jan 12 '21 23:01 energywave

After some more tests I found that in my case where TV connected over WiFi this plugin works better. I will keep checking both.

myhomeiot avatar Feb 01 '21 12:02 myhomeiot