Samsung Smart TV Plus

Questions and comments specific to a particular plugin should go here.
holdestmade
Experienced User
Posts: 174
Joined: Thu Dec 04, 2014 2:44 pm

Re: Samsung Smart TV Plus

Post by holdestmade » Wed Nov 14, 2018 11:13 am

See attached, get works OK but as you can see set gets an invocation error

Image

User avatar
kgschlosser
Site Admin
Posts: 4313
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Samsung Smart TV Plus

Post by kgschlosser » Wed Nov 14, 2018 1:00 pm

UPNP error 501 Action Failed MAY be returned if current state of service prevents invoking that action

I didn't know any of the UPNP actually functioned on the TV's. I thought it was all turned off. apparently get mute and get volume are not. are there any others that work? like source/input or channel.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4313
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Samsung Smart TV Plus

Post by kgschlosser » Wed Nov 14, 2018 1:32 pm

That is a pretty nifty tool isn't it?
You can learn all kinds of things about a network attached device. so long as it supports UPNP.

I believe I found the problem with the plugin. give it a go.
I also sped up the discovery process if there is more then a single NIC card in the machine.
Attachments
SamsungSmartTVPlus-0.2.3b.egplugin
(204.19 KiB) Downloaded 10 times
If you like the work I have been doing then feel free to Image

holdestmade
Experienced User
Posts: 174
Joined: Thu Dec 04, 2014 2:44 pm

Re: Samsung Smart TV Plus

Post by holdestmade » Wed Nov 14, 2018 4:46 pm

kgschlosser wrote:
Wed Nov 14, 2018 1:00 pm
UPNP error 501 Action Failed MAY be returned if current state of service prevents invoking that action

I didn't know any of the UPNP actually functioned on the TV's. I thought it was all turned off. apparently get mute and get volume are not. are there any others that work? like source/input or channel.
I tried all of them I think and only things like status work, not input unfortunately

holdestmade
Experienced User
Posts: 174
Joined: Thu Dec 04, 2014 2:44 pm

Re: Samsung Smart TV Plus

Post by holdestmade » Wed Nov 14, 2018 4:48 pm

kgschlosser wrote:
Wed Nov 14, 2018 1:32 pm
That is a pretty nifty tool isn't it?
You can learn all kinds of things about a network attached device. so long as it supports UPNP.

I believe I found the problem with the plugin. give it a go.
I also sped up the discovery process if there is more then a single NIC card in the machine.
An error on restart:

14/11/2018 16:47:29 Exception in thread SamsungTVScan:
14/11/2018 16:47:29 Traceback (most recent call last):
14/11/2018 16:47:29 File "threading.pyc", line 801, in __bootstrap_inner
14/11/2018 16:47:29 File "threading.pyc", line 754, in run
14/11/2018 16:47:29 File "C:\ProgramData\EventGhost\plugins\SamsungSmartTVPlus\__init__.py", line 125, in _scan_loop
14/11/2018 16:47:29 sn = tv['device_id']
14/11/2018 16:47:29 TypeError: string indices must be integers, not str

User avatar
kgschlosser
Site Admin
Posts: 4313
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Samsung Smart TV Plus

Post by kgschlosser » Fri Nov 30, 2018 8:40 am

OK folks. I wanted to let ya'll know I have been putting some time into correcting this error.

apparently I am now the maintainer of the samsungctl library. No one wanted to ontake the task. So instead of letting it fizzle and die. I said I would do it.

So this is where I am at.. websocket problem is fixed. I added a whole new discovery process. it works much faster. all of the usual remote keys work.

PLUS
things we can get

Code: Select all

brightness
contrast
sharpness
color_temperature
source
channel
media info
volume
mute
channel volume (audio channel)
channel mute (audio channel)
media meta data
media position
source list
channel list
channel metadata
things we can set

Code: Select all

brightness
contrast
sharpness
color_temperature
source
channel
media info
volume
mute
channel volume (audio channel)
channel mute (audio channel)
playing media
seek
channel label
source label
running apps
opening the browser to a specific webpage
and there is more. I am simply to lazy to type it all.
you will get events for any\all of the above if anything changes

and they said it couldn't be done... 8)

This will probably be the most feature rich Samsung TV HA control that has been made to date.

All of the things I mentioned above I have tested and they do work. I am now starting to code the EG connection bits to the samsungctl library. and all of the actions and the threading system for the events. it is basically an almost complete plugin rewrite. after I get this cone so it covers all but 2 years of Samsung TV's I will then add support for those as well. so as it stands.. 2008 - 2013 and 2016 - 2018 TVs will work. I can't remember if 2015 TV's use that bonkers encryption or not. I know the H series for certain maybe the J. I do not believe that anyone has coded in support for all 4 connection types into a single API. we have 3 of the 4. the port 5500 (legacy) the websocket and the token based SSL websocket. i coded everything so it automatically picks the proper connection type to use.

I am going to bed now. I have been up and working on this thing for over 48 hours. I am tired and my eyes are starting to hurt. I have written 4000 lines of code in the past 2 days. I still have another 2-3 thousand to go.
If you like the work I have been doing then feel free to Image

holdestmade
Experienced User
Posts: 174
Joined: Thu Dec 04, 2014 2:44 pm

Re: Samsung Smart TV Plus

Post by holdestmade » Fri Nov 30, 2018 8:54 am

Brilliant, thanks for you work on this

User avatar
kgschlosser
Site Admin
Posts: 4313
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Samsung Smart TV Plus

Post by kgschlosser » Fri Nov 30, 2018 11:07 am

ok nap time is over. back to work.
If you like the work I have been doing then feel free to Image

slattynan
Posts: 43
Joined: Fri Jul 06, 2018 12:15 pm

Re: Samsung Smart TV Plus

Post by slattynan » Fri Nov 30, 2018 6:40 pm

kgschlosser wrote:
Fri Nov 30, 2018 11:07 am
ok nap time is over. back to work.
Long nap by your standards, must be refreshed :lol:

User avatar
kgschlosser
Site Admin
Posts: 4313
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Samsung Smart TV Plus

Post by kgschlosser » Sun Dec 02, 2018 12:26 am

ok so here is a test version. I do not own a TV that uses the websocket. So I was not able to test it. on the legacy side of things it does work.

I am going to need to see output from the channels and channel lists. in order to get the channel change functioning.. the volume, mute, source and all of the video properties seem to work just fine. events and all.

This version I have not tested. my wife stole the extension cord I had the TV plugged into. so I made some changes that didn't get tested out.

but anywho. give it a go and report any issues please.

to get a printout of the channel and clannel list just add a dump result to log after either of the get actions. this will print it out to the screen. I do not have any means of getting any kind of OTA where I live so I cannot build a channel list (which is needed to be able to set the channel) not do I know how the europe/asia TV's have the data formatted. i know the channel numbers are different then here in the US
Attachments
SamsungSmartTVPlus-0.3.0b.egplugin
(222.61 KiB) Downloaded 4 times
If you like the work I have been doing then feel free to Image

george tirebuyer
Posts: 41
Joined: Sun Apr 28, 2013 12:25 pm

Re: Samsung Smart TV Plus

Post by george tirebuyer » Sun Dec 02, 2018 6:07 pm

Doesn't seem to find the TV. The "Plugin Item Settings" comes up blank. I'm on a wired LAN setup. with a post 2016 TV I think. BTW the Windows SmartView app doesn't work either but it does find the TV.

User avatar
kgschlosser
Site Admin
Posts: 4313
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Samsung Smart TV Plus

Post by kgschlosser » Sun Dec 02, 2018 6:42 pm

do you have UPNP enabled on your computer??
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4313
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Samsung Smart TV Plus

Post by kgschlosser » Sun Dec 02, 2018 6:57 pm

and also the detection is not instant. did you let it sit for a bit?

you can also do a test and see if the TV responds to SSDP packets by downloading the Intel UPNP developer tools and using the Device sniffer to send out the discovery packets and see if the TV responds.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4313
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Samsung Smart TV Plus

Post by kgschlosser » Sun Dec 02, 2018 7:09 pm

also when the plugin config initially comes up. give it 30 seconds to see if it populates. This is an Unknown to me because I do not have one of these TV's they could have changed how fast the TV responds to the discovery packets. IDK. I know it takes up to 5 seconds for my TV to appear. I know I need to add a message telling the user to wait while it looks for the TV. I have not gotten there yet.

My other question is. did the old plugin work?? if it did then this one should work as well and I may have to change the timeout time for the discovery. I think i was pushing 8 seconds in the old plugin and I am running at 5 now. (because of some changes i made I thought I might be able to use a smaller timeout). maybe 8 seconds is the number. The SSDP discovery part always runs it simply loops. I should change that to have a 20 second timeout and change the timeout on the receive to be smaller.. it's a complicated thing getting the best combination while not making EG complain about not closing threads when you shut it down. there has to be an exit routine from the loop. so when receiving on a socket it stops and waits so I have to use a socket timeout to have it exit occasionally to check and see if the loop has been canceled. if I set non blocking on the socket it will cause high CPU use constantly looping I would have to put a wait on it anyway. and it wouldn't be released if data arrived. so i may as well leave it wait where it does. I simply have to get the timeout high enough to not cause higher CPU consumption but small enough so that EG will not pitch a fit when it closes.
If you like the work I have been doing then feel free to Image

holdestmade
Experienced User
Posts: 174
Joined: Thu Dec 04, 2014 2:44 pm

Re: Samsung Smart TV Plus

Post by holdestmade » Sun Dec 02, 2018 7:38 pm

Hi,

I am having same issue with no TVs detected. Tried the device sniffer again and it does still respond as before.

Do I need to add samsungctl, if so which version, the latest one I see is dependant on Python 3

Cheers

Post Reply