Samsung Smart TV - No control?

I tested it, I still have issue the state turns on while the tv is off. I think ping is the way to go but not on port 8001, on my tv the remote server wakes up regularly while the tv is off. The upnp server (http://{}:9197/dmr) only wakes up for 1 minute after shut down and stays off until the tv is turned on again.

Based on others JS implementations of SamsungWS the most used approch is ping the endpoint in 8001 port.
Anyway i added a new param for edit this.

@giefca try this
update_method=ping
update_custom_ping_url=YOUR CUSTOM URL

Anyway, in the only scenario where the update is wrong, it is now turning off and on the TV several times

mate, you dont realise how long ive spent trying to fix this and yours has finnaly worked!

Iv got a q7 using wifi connectivity and everything works fine, except the tts to speach but not sure that should anyway tbf.

You sir, are a legend.

Got the tv on the wifi and the component is working, I dont have any issue with the state of the tv. It seems to work ok when on or off, The only thing is i cant turn the tv on anymore. Worked on the LAN but not the wifi.

Thanks a lot for this btw!

Sorry, Tried to add a second tv and getting the following:

File “/srv/homeassistant/lib/python3.7/site-packages/websocket/_abnf.py”, line 182, in validate
raise WebSocketProtocolException(“Invalid close opcode.”)
websocket._exceptions.WebSocketProtocolException: Invalid close opcode.

also on your documentation it says to use sourcelist which doesnt work but source_list does, just fyi :slight_smile: thanks again @xchwarze

whats is your tv model?
please post all config of second tv

I tried again with 8001 and it keeps randomly turn on and off. I checked it’s not an issue with the component, I can access api as if the tv was on. If someone has the same issue you just have to change your ping url.
Thanks for the modification, I will update it later. I already made the change and added other missing functionalities to your previous version.

@xchwarze my second tv is a samsung ue49mu6400

I think the issue lies in the token file. I think it only allows for one token at a time.

If i add a 2nd tv it just keeps popping up asking for me to allow or deny the connection on the 2nd tv and if i click allow
 the 2nd tv works and the 1st tv loses its state.

  • platform: samsungtv_custom
    host: 192.168.0.6
    mac: xx:xx:xx:xx:xx:xx
    port: 8002
    name: Smalls

edit: also when i click allow on the 2nd tv, the number in the token-file changes

edit2: So i tried only the 49inch, removed the 55 altogether and it just asks for new permission every time i turn the tv on then it does work, as soon as i turn it off and on again, i need to allow the permissions. I have checked in the settings and changed the notification from first time to off and it still pops up and asks. Still cant turn either tv on, but can turn off ok

@xchwarze Tried your version with my NU8000 and it works fine. One small bug. After I turn the TV off, it turns off and then turns back on for some time and then turns off and then stays on. If I turn it off one more time from inside the HA, it stays off.

@pegatron89 please test the lastest commit in master branch

@arsaboo mmm let me think on it

---------- edit
New release:

Uploaded v3.0.3 not working Although I do see the list configured now but the TV does not respond to anything


Got the component working. I had to make an empty token-192.168.0.x.txt file which then allowed both tvs to be controlled. Apps work on both, can control volume change source on both now. State seems ok for now will let you know.

It can turn my 49" tv On & off, But can only turn the 55" off and not on

Thanks again for this, Owe you one :+1:

thanks for testing @pegatron89 !
you configure the mac address for 55" TV?

For use wakeonlan method the component need the mac address

yeah the mac address is there I made sure i was using the wifimac and not the ethernet mac, Does not switch it on. I have fixed a permenant ethernet cable up to the 55" today and the component can now switch on and off, The state is also more reliable as well. Just seems to be on the wifi it has issues.

No problem thank you for taking the time to make it work! If you need any more testing done for any other features you add let me know

mmm I don’t think wakeonlan works with WiFi

I recently bought a 82" 4K QLED (QA82Q60RAWXXY) for my lounge and this component works great. Thanks a lot.

Only thing that is missing is ability to send notifications (like webos). hope someone will figure that out too. Amazing work mate. really appreciate it.

edit: initially i tried with port 8001. it didn’t work properly (only turn on worked not turn off, etc). then I switched to port 8002, everything seems to be working, including sources.

Hello!
Today leave a new, more stable version of the component

@xchwarze Thank you so much for getting this to work on my 2018 Q7. I have been trying for months with different releases.

hi what do you mean by empty token?

Don’t think you have to do this with the latest version (haven’t tested so not sure)

But just in case if you are on a rasp pi, In the samsungtv_custom folder (/home/homeassistant/.homeassistant/custom_components/samsungtv_custom) create a black empty file token-192.168.x.x.txt - x being the ip address of the tv! check the permissions on the file as well, Home assistant will need to have write access to it.

Hope it helps
Craig

Edit: edited file name, It should be token-ipaddress.txt

1 Like

hi @xchwarze

thanks for your component. I have tried it using port 8002, however I cannot turn my tv on or off, when I manually turn it on with the Samsung remote it does detect the state of the TV. My tv is connected via wifi and not ethernet.

Any recommendations?