Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Power State and Communication Issues #266

Open
ronyn77 opened this issue Aug 17, 2023 · 24 comments
Open

Power State and Communication Issues #266

ronyn77 opened this issue Aug 17, 2023 · 24 comments

Comments

@ronyn77
Copy link

ronyn77 commented Aug 17, 2023

I've made multiple attempts to change the settings and troubleshoot the issue, but unfortunately, I haven't been able to solve the problem. Here's what I've done so far:

I added a media player widget for my Samsung S95C TV on the dashboard using the integration. However, I'm experiencing incorrect visualization of the integration's power state. Sometimes the TV is on and functioning, but the integration shows it as off, and vice versa. When the integration shows the TV as off, I can't access other options like changing the source or audio mode.

I've tried changing the ports as suggested, including 9110, 9119, and 9197. However, I didn't notice any significant differences in behavior. Initially, it appeared to work, but after a period (which varies from 5 minutes to a couple of hours or more), the issue returns, and changing ports doesn't seem to have any effect in the long run.

I also experimented with switching between "Control Web Socket Channel," "Remote Web Socket Channel," and "Rest API Call" options. While there were slight variations, I couldn't identify which one was better, and ultimately the problem persisted.

I attempted to use the "Use volume mute status to detect fake power ON" option, but it didn't change anything in terms of the issue.

In Node-RED, I created a function to send a WOL (Wake-on-LAN) packet using the TV's MAC address. However, this approach didn't work.

Interestingly, when I added specific code to my configuration.yaml file (noting that this configuration differs slightly from what's in the documentation), the sent WOL packet successfully turned on the TV.

media_player:
  - platform: samsungtv_smart
    name: S95C
    host: 10.10.10.73
    mac: "aa:bb:cc:dd:ee:ff"

However, this only works the first time after restarting HA. Subsequent attempts only turn on the Samsung media player widget, not the TV itself. This behavior is strange, and it suggests there might be communication problems between the TV and the integration.

The only reliable method to successfully enable the power-on function is by utilizing the SmartThings integration.

@ukmgranger
Copy link

I'm having the same issue with regards to the media player not showing that the TV is on (Samsung BU8000).
I have not yet had a change to try out some of the solutions from the post above.

@ronyn77
Copy link
Author

ronyn77 commented Aug 26, 2023

Hello @ollo69 ,
could you please lend a hand here?
I'm struggling to figure out what the issue is. I've provided all of my settings below. I've even set up a binary sensor to assist in determining the entity's state, but despite that, it appears to not be functioning correctly. After turning on the TV, the state of the Samsung TV's media player entity switches on.
However, after a while, it switches off again, even though the SmartThings integration continues to indicate that it's on, along with the newly created sensor.

Snag_3dc4ce

Snag_3de304

Snag_473687

Snag_3e2f11

Snag_3e470d

@ollo69
Copy link
Owner

ollo69 commented Aug 26, 2023

I do not understand on what that binary sensor is based.

@ronyn77
Copy link
Author

ronyn77 commented Aug 26, 2023

I do not understand on what that binary sensor is based.

The sensor is based on the 'smartthing' entity switch, which is responsible for turning the TV on and off. I use this switch to determine the state of the TV and relay that to the binary sensor, which can be either 'on' or 'off'. I made another adjustment to the configuration, changing the TCP port to 0 (ICMP). In the past, without the binary sensor, it only worked intermittently; often, the media player entity would remain 'on' even if the TV was turned off, and vice versa. Now, with the sensor paired, it appears to be functioning correctly. I've been testing it for 10 hours, and so far, it's consistent: when the TV is off, the media player entity is also off, and vice versa. I hope this continues to be the case in the future. However, there is a slight delay in the time it takes for the TV to turn on and for the media player entity to register this change—it takes about 3 to 4 seconds. Turning it off is quicker, taking less than 2 seconds.

@danielaguirre708
Copy link

I had the same issue, but the error was the IP address. in our initial setup, the integration requested an IP, the thing is maybe your TV is getting the IP via DHCP (Automatic) so the IP address could change, the TV turn on because it's using "smart_things" but it didn't refresh the status because it's pointing to that IP, my fix was setup a static IP in the tv ,
I would like to know if setting up static IP , it's the correct way or if this integration can work with dynamic IP

@SDR3078
Copy link

SDR3078 commented Sep 26, 2023

I am having the same issue! While it seems more stable by setting the TCP port to 0 (ICMP), it still detects the state of the TV wrong sometimes. While the solution proposed by @ronyn77 can work by linking the state directly to another integration (SmartThings), I'd prefer not to include my SmartThings integration in my Home Assistant setup. I'm using WOL packet and control web socket. Anyone an idea on how to make it more stable?

@edzards
Copy link

edzards commented Sep 28, 2023

I have the same issue also with a Samsung S95C. Would be great if this could be solved.

@ickam
Copy link

ickam commented Oct 26, 2023

@ollo69 I have a 2022 neo-qled tv and I am experiencing a similar problem, I think. When I send a command (tv on / off) one of the following outcomes is as likely as another:

  1. the command will execute promptly and status will update
  2. the command will execute promptly, but the status won't update
  3. the command will execute, but with a delay significant enough to think that it's not executing.
  4. the command won't execute

On my previous try with home assistant I also had some apps defined and the commands to run them were susceptible to the same problems.

Some details about my setup:

  • home assistant host has ethernet connection. Currently it's run on a current version of dietpi on odroid c2. Previously I tried to run it in a x86_64 proxmox VM. Same symptoms.

  • The TV itself is using wifi, but the AP is literally above it and the signal is strong enough for 4k playback at high bitrates

I would really appreciate if this could get resolved!

@cwjackso
Copy link

Came here to check for issues like this as I have started experiencing this myself.

As SmartThings was mentioned I went to check the SmartThings App to see if the tv still functioned through that. When I opened it I got a prompt saying something along the lines of "We've disconnected this device because you haven't used it in a while, tap here to reconnect". After doing that the Home Assistant status is reporting correctly again!

Worth checking.

@ickam
Copy link

ickam commented Oct 30, 2023

Came here to check for issues like this as I have started experiencing this myself.

As SmartThings was mentioned I went to check the SmartThings App to see if the tv still functioned through that. When I opened it I got a prompt saying something along the lines of "We've disconnected this device because you haven't used it in a while, tap here to reconnect". After doing that the Home Assistant status is reporting correctly again!

Worth checking.

We use the smartthings app daily to control the tv. I'm just fed up with mispressing buttons on it. I wish that was the fix for me, but alas no. :(

@besiktas97
Copy link

I am experiancing the same issue since couple of weeks.

@tintin814
Copy link

tintin814 commented Nov 14, 2023

Same setup here with the similar issue. Home Assistant reports the TV as "on" when it is turned off. The problem is produced either the TV is turned off by its physical remote or by Home Assistant. I tried to update the status manually in the developer tool but it resumes to "on" again after a few seconds. Although it reports the status as "on" already, I am still able to turn on the TV by sending a command.

@ollo69 I have a 2022 neo-qled tv and I am experiencing a similar problem, I think. When I send a command (tv on / off) one of the following outcomes is as likely as another:

  1. the command will execute promptly and status will update
  2. the command will execute promptly, but the status won't update
  3. the command will execute, but with a delay significant enough to think that it's not executing.
  4. the command won't execute

On my previous try with home assistant I also had some apps defined and the commands to run them were susceptible to the same problems.

Some details about my setup:

  • home assistant host has ethernet connection. Currently it's run on a current version of dietpi on odroid c2. Previously I tried to run it in a x86_64 proxmox VM. Same symptoms.
  • The TV itself is using wifi, but the AP is literally above it and the signal is strong enough for 4k playback at high bitrates

I would really appreciate if this could get resolved!

Copy link

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Dec 30, 2023
@andrewmv
Copy link

andrewmv commented Jan 2, 2024

Commenting to keep this from being auto-closed - its still affecting me.

@github-actions github-actions bot removed the Stale label Jan 2, 2024
@niXta1
Copy link

niXta1 commented Jan 3, 2024

I got the same problem here on my S90C.

@egilTerki
Copy link

I have the same issue. From the logs it looks like the tv is on, but still registers as off

2024-01-20 14:02:41.639 DEBUG (MainThread) [custom_components.samsungtv_smart.api.smartthings] {'deviceId': 'xxx', 'state': 'ONLINE', 'lastUpdatedDate': '2024-01-20T12:19:59.643Z'}

2024-01-20 14:02:42.629 DEBUG (MainThread) [custom_components.samsungtv_smart.api.smartthings] {'main': {'mndt': {'value': '2022-01-01'}, 'mnfv': {'value': 'T-PTMDEUC-1602.2|ST_ENERGY'}, 'supportsPowerOnByOcf': {'value': 'true'}, 'mnhw': {'value': None}, 'data': {'value': None}, 'di': {'value': 'xxx'}, 'supportedPlaybackCommands': {'value': '["play","pause","stop","fastForward","rewind"]'}, 'supportedInputSources': {'value':
'["digitalTv","HDMI1","HDMI2","HDMI3"]'}, 'mnsl': {'value': None}, 'supportedPictureModesMap': {'value': '[{"id":"modeGen_589826","name":"EyeComfort"},{"id":"modeIntelligent","name":"Optimised"}]'}, 'dmv': {'value': 'res.1.1.0,sh.1.1.0'}, 'error': {'value': None}, 'switch': {'value': 'on'}, 'vid': {'value': 'VD-STV-2022'}, 'mnpv': {'value': '6.5'}, 'supportedPictureModes': {'value': '["EyeComfort","Optimised"]'}, 'firmwareVersion': {'value': '3.5.0'}, 'icv': {'value': 'core.1.1.0'}, 'supportedSoundModes': {'value': '["Amplify","Standard"]'}, 'st': {'value': '2023-12-31T13:55:13Z'}, 'updatedTime': {'value': '1705753201'}, 'deviceConnectionState': {'value': None}, 'powerConsumption': {'value': None}, 'pictureMode': {'value': 'Optimised'}, 'supportedSoundModesMap': {'value': '[{"id":"modeAmplify","name":"Amplify"},{"id":"modeStandard","name":"Standard"}]'}, 'disabledCapabilities': {'value': '["powerConsumptionReport"]'}, 'soundMode': {'value': 'Standard'}, 'playbackStatus': {'value': None}, 'supportedTrackControlCommands': {'value': None}, 'mobileCamSupported': {'value': 'true'}, 'mute': {'value': 'unmuted'}, 'supportedAmbientApps': {'value': '["weather"]'}, 'n': {'value': 'Samsung Q77BA 65 TV'}, 'mnmo': {'value': 'QE65Q77BATXXC'}, 'volume': {'value': '9', 'unit': '%'}, 'tvChannel': {'value': ''}, 'mnmn': {'value': 'Samsung Electronics'}, 'imeAdvSupported': {'value': 'true'}, 'mnml': {'value': None}, 'supportedInputSourcesMap': {'value': '[{"id":"dtv","name":"TV"},{"id":"HDMI1","name":"HDMI 1"},{"id":"HDMI2","name":"HDMI 2"},{"id":"HDMI3","name":"HDMI 3"}]'}, 'tvChannelName': {'value': 'CYL8nSudXE.m3uIPTV'}, 'mnos': {'value': 'Tizen'}, 'pi': {'value': 'xxx'}, 'inputSource': {'value': 'dtv'}, 'status': {'value': 'Idle'}}}
2024-01-20 14:02:42.631 DEBUG (MainThread) [custom_components.samsungtv_smart.media_player] Samsung TV is OFF or SmartThings not configured, _get_st_sources not executed

Copy link

github-actions bot commented Mar 6, 2024

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Mar 6, 2024
@metec22
Copy link

metec22 commented Mar 7, 2024

I also have the same issue (S89C). The default Samsung integration shows the correct status of the TV so I created a binary sensor based on it and added it in the configuration. However, the status still shows off even though the binary sensor is showing on. Does anything else need to be configured to ensure the binary sensor is used for status?
Would be nice if we could have an option to set the status to always be on so that sources and other options are available.

@github-actions github-actions bot removed the Stale label Mar 8, 2024
@edzards
Copy link

edzards commented Mar 10, 2024

Since a couple of weeks I have a new issue with the integration. I have an S95C. My configuration for the integration:

  • WOL Packet (TV connected via ethernet)
  • Control Web Socket Channel
  • TCP port: 0 (also tried 9110, 9119, 9197 as stated in the documentation) -> does not help
  • I also created a binary sensor based on the power consumption -> does not help

In general, it works rather well. However, when the TV is turned off, the state of the TV in Home Assistant changes from On and immediately to Off in 5 min periods.

Any help is pretty much appreciated.

@ronyn77
Copy link
Author

ronyn77 commented Mar 11, 2024

Why don't you connect a sensor to SmartThings? In my case, it worked pretty well. Moreover, because I experienced some issues with the SmartThings integration in the past, I was forced to disable the sensor connection. After resolving the integration issue, I didn't re-enable the sensor, because it seems to still work fine today. I might have encountered a few problems a couple of times, but they could have been caused by many other factors as well. Give it a try.

@Kieran00
Copy link

Kieran00 commented Apr 14, 2024

I am also having the same issue. I have a fixed IP and a binary sensor based on power consumption of the TV (which i can confirm works by watching it in a differant widget). I have also tried all suggested ports and alternating between wifi/wried... smartthings and WOL. It is an S92C. It works if i restart HA but once it is turned off it will rarely show up as on again unless I restart HA. The power works all the time though just not the status/sources. Is there any progress on this at all that could be of help? Thanks.
Screenshot 2024-04-14 161734
Screenshot 2024-04-14 161748
Screenshot 2024-04-14 161843

@andrewmv
Copy link

If you're comfortable with some light soldering/breadboarding and your Samsung TV has a headphone-jacked shaped service port marked "Ex-Link", you can use that as an alternative way to control the TV via Home Assistant without using the SmartThings API.

It's much more limited in scope than this integration, since the ExLink port doesn't allow you to query the TV's current state or interact with any of the smart/homescreen features, but it provides some very rudimentary idempotent controls that satisfied my personal use cases of turning the TV on, off, and selecting the appropriate HDMI source explicitly.

Dropping it here in case it might be useful for anyone
https://github.com/andrewmv/samsung-tv-serial-console

@ronyn77
Copy link
Author

ronyn77 commented Apr 17, 2024

....now the power state hasn't been updating anymore. I have a Samsung S95C, and until now it worked without any problems. However, after updating Home Assistant, the media player entity shows as turned off all the time. The only way to bring it back on is to restart Home Assistant.

@mytasker
Copy link

mytasker commented May 28, 2024

So, looks like I'm not alone on this.

My work around is to reload the integration (using the below)
If you manually reload the integration, it will show the correct entity state after that.

So, add the below to your automation script:

Replace the entity device name to your device - on mine I named it smarthingstv )

service: homeassistant.reload_config_entry
metadata: {}
data: {}
target:
  entity_id: media_player.smarthingstv 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests