Page 3 of 3

Re: Samsung TV control in Domoticz

Posted: Friday 17 November 2017 11:48
by perwei
stavast wrote: Friday 31 March 2017 18:40
Good luck!
Hi

I've finally got the spare time to try samsunctl. I've installed it on my Raspberry Pi using pip3 as described in the initial post from stavast. No errors during installation but running samsungctl returns an error :

Code: Select all

pi@raspberrypi:~ $ /usr/local/bin/samsungctl -i --host 10.0.0.71 --method websocket
Error: Operation now in progress


I was wondering which port it was using so i looped through the ports that nmap found :

Code: Select all

~$ nmap -p 1-65535 10.0.0.71

Starting Nmap 7.01 ( https://nmap.org ) at 2017-11-17 11:43 CET
Nmap scan report for 10.0.0.71
Host is up (0.010s latency).
Not shown: 65523 closed ports
PORT      STATE SERVICE
7676/tcp  open  imqbrokerd
7678/tcp  open  unknown
8000/tcp  open  http-alt
8001/tcp  open  vcom-tunnel
8002/tcp  open  teradataordbms
8080/tcp  open  http-proxy
8187/tcp  open  unknown
9119/tcp  open  unknown
9197/tcp  open  unknown
9999/tcp  open  abyss
10443/tcp open  unknown
15500/tcp open  unknown

Nmap done: 1 IP address (1 host up) scanned in 2.34 seconds
Then I went through all of these using --port parameter in samsungctl but still the same error.

Regards,
Per W.

Re: Samsung TV control in Domoticz

Posted: Friday 17 November 2017 14:19
by EdwinK
Same error. Not smart enough to figure it out :(

Re: Samsung TV control in Domoticz

Posted: Sunday 31 December 2017 16:04
by Calzor Suzay
stavast wrote: Friday 31 March 2017 18:40

4. Make sure your TV is on, run the following command from the cli (Change xxx.xxx.xxx.xxx with the IP address of your TV):

Code: Select all

pi@domoticz:~ $ samsungctl --host xxx.xxx.xxx.xxx --method websocket KEY_MUTE  
5. Depending on the setting of your TV, the TV will ask you if you want to allow the external control from the device from which you just send the mute key

6. Allow the external control with your TV Remote and voila! remote control should be working now and the volume of your TV should be muted.
How did you get this working and what is point 5?
Is it mobile device manager notification as I have this off so it shouldn't prompt but on my KS7000 I get

samsungctl -i --host 192.168.1.42 --method websocket
Error: Operation now in progress

Any ideas?

Re: Samsung TV control in Domoticz

Posted: Sunday 31 December 2017 20:40
by Calzor Suzay
Ok managed to get it further...

I have it working via the command line but specify a port, in my case 8001 and have to add a timeout option, even 1 works, so...

samsungctl -i --host 192.168.1.42 --port 8001 --method websocket --timeout 1

Brings me up a menu from a quick test can send commands.

I transferred the options over to Domoticz, it sees the tv 'alive' but now have this problem

2017-12-31 19:35:17.480 (SamsungTV) isAlive status :True
2017-12-31 19:35:17.480 (SamsungTV) Devices are connected - Initialisation
2017-12-31 19:35:17.482 Error: (SamsungTV) 'onStart' failed 'ImportError'.
2017-12-31 19:35:17.482 Error: (SamsungTV) ----> Line 134 in /home/osmc/domoticz/plugins/SamsungTV/plugin.py, function onStart
2017-12-31 19:35:17.482 Error: (SamsungTV) ----> Line 287 in /home/osmc/domoticz/plugins/SamsungTV/plugin.py, function SamsungSend
2017-12-31 19:35:17.482 Error: (SamsungTV) ----> Line 10 in /usr/lib/python3.4/samsungctl/remote.py, function __init__
2017-12-31 19:35:17.482 Error: (SamsungTV) ----> Line 13 in /usr/lib/python3.4/samsungctl/remote_websocket.py, function __init__
2017-12-31 19:35:17.482 (SamsungTV) Heartbeat interval set to: 15.

It obviously creates no devices and fails, any ideas?