Page 3 of 9
Re: Python Plugin: Samsung TV
Posted: Friday 08 September 2017 12:56
by sennheiser
@zak45
I installed python plugin SamsungTV and it's ok but I want to use the Kodi remote but I have this message :
(Samsung TV) Remote command not defined: Select
But I don't know how to defined this commande ?
Thx
Re: Python Plugin: Samsung TV
Posted: Friday 08 September 2017 18:23
by zak45
Wiki need to be updated ....
Which version you have ?
Re: Python Plugin: Samsung TV
Posted: Friday 08 September 2017 19:18
by sennheiser
@zak45
samsungctl-0.6.0.tar.gz
Re: Python Plugin: Samsung TV
Posted: Friday 08 September 2017 20:04
by zak45
sennheiser wrote: ↑Friday 08 September 2017 19:18
@zak45
samsungctl-0.6.0.tar.gz
what's your plugin version ?
2017-09-08 20:03:44.935 (Samsung TV Salon) Initialized
version 2.0.0, author 'zak45'
Re: Python Plugin: Samsung TV
Posted: Saturday 09 September 2017 12:38
by Yustmenl
Hello when tying to run
sudo samsungctl -i --host 192.168.X.X --port 8001 --method websocket
I get this as a result
Code: Select all
Traceback (most recent call last):
File "/usr/local/bin/samsungctl", line 11, in <module>
load_entry_point('samsungctl==0.6.0', 'console_scripts', 'samsungctl')()
File "/usr/local/lib/python2.7/dist-packages/samsungctl/__main__.py", line 93, in main
config = _read_config()
File "/usr/local/lib/python2.7/dist-packages/samsungctl/__main__.py", line 37, in _read_config
except FileNotFoundError:
NameError: global name 'FileNotFoundError' is not defined
it looks like the plugin is trying to use python 2.7 even though python 3 is installed
I also tryed this
https://linuxconfig.org/how-to-change-f ... bian-linux but this didn't turned out to be a sollution.
anyone have any idea what could be the issue?
[edit] somehowe i could install samsungctl again with pip install samsungctl
and the same goes for websocket
also when testing from the commandline it works and i see responce on my TV but the plugin gives the folowing error in the log
Code: Select all
2017-09-09 17:34:59.658 Error: (SamsungTV) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/samsungtv/:/usr/lib/python3.4/:/usr/lib/python3.4/plat-arm-linux-gnueabihf:/usr/lib/python3.4/lib-dynload'.
2017-09-09 17:34:59.658 Error: (TV Woonkamer) Module Import failed, exception: 'ImportError'
2017-09-09 17:34:59.658 Error: (TV Woonkamer) Module Import failed: ' Name: samsungctl'
[Edit 2] i found the problem, i overlooked one line in the wiki
Code: Select all
sudo cp -r /usr/local/lib/python3.4/dist-packages/samsungctl/ /usr/lib/python3.4/
Re: Python Plugin: Samsung TV
Posted: Sunday 10 September 2017 11:56
by zak45
@Yustmenl
nice that you have been able to help yourself

Re: Python Plugin: Samsung TV
Posted: Sunday 10 September 2017 22:02
by sennheiser
@zak45
Hi,
I don't know what's happen but I create a folder SamsungTV but when I reboot my raspberry this folder is automatically delete !
I'm lost....
EDIT : It's the same with domoticz ... if I add a switch for exemple it's remove if I reboot my raspberry

Re: Python Plugin: Samsung TV
Posted: Sunday 10 September 2017 23:37
by zak45
Looks like your Domoticz re install at each boot !! ??
Re: Python Plugin: Samsung TV
Posted: Monday 11 September 2017 9:49
by sennheiser
Looks like my raspberry is in read only mode !
I tried to install the new beta domoticz software... after this installation, it was ok but after the raspberry reboot I was back at the last version of domoticz.
EDIT : I was clone my SD CARD and it's ok with the new SD CARD ! ...
Re: Python Plugin: Samsung TV
Posted: Saturday 23 September 2017 19:55
by mircer
Hello
First, i want to Thank you all for the information you share.
I have a problem and I will be glad if someone can help
when I try to turn off the TV, I getting this error:
2017-09-23 20:47:45.100 Error: (SamsungTV) 'onCommand' failed 'WebSocketBadStatusException'.
2017-09-23 20:47:45.101 Error: (SamsungTV) ----> Line 170 in C:\Program Files (x86)\Domoticz\plugins\SamsungTV\plugin.py, function onCommand
2017-09-23 20:47:45.101 Error: (SamsungTV) ----> Line 287 in C:\Program Files (x86)\Domoticz\plugins\SamsungTV\plugin.py, function SamsungSend
2017-09-23 20:47:45.101 Error: (SamsungTV) ----> Line 10 in C:\Program Files (x86)\Python35-32\Lib\site-packages\samsungctl\remote.py, function __init__
2017-09-23 20:47:45.101 Error: (SamsungTV) ----> Line 23 in C:\Program Files (x86)\Python35-32\Lib\site-packages\samsungctl\remote_websocket.py, function __init__
2017-09-23 20:47:45.101 Error: (SamsungTV) ----> Line 220 in C:\Program Files (x86)\Python35-32\Lib\site-packages\websocket\_core.py, function connect
2017-09-23 20:47:45.101 Error: (SamsungTV) ----> Line 69 in C:\Program Files (x86)\Python35-32\Lib\site-packages\websocket\_handshake.py, function handshake
2017-09-23 20:47:45.101 Error: (SamsungTV) ----> Line 129 in C:\Program Files (x86)\Python35-32\Lib\site-packages\websocket\_handshake.py, function _get_resp_headers
i'm using Python 3.5.2.
Thanks
I found the problem. now there is no error, but the commands not work (only ON command working)
Re: Python Plugin: Samsung TV
Posted: Saturday 23 September 2017 20:03
by emme
Let me just say
OMG! this plugin is AMAZING!!!
THANK YOU SO MUCH!!!
Re: Python Plugin: Samsung TV
Posted: Saturday 23 September 2017 22:39
by zak45
emme wrote: ↑Saturday 23 September 2017 20:03
Let me just say
OMG! this plugin is AMAZING!!!
THANK YOU SO MUCH!!!
Happy you like it

thanks

Re: Python Plugin: Samsung TV
Posted: Sunday 24 September 2017 14:13
by felix63
mircer wrote: ↑Saturday 23 September 2017 19:55
I found the problem. now there is no error, but the commands not work (only ON command working)
I use the following script to turn off the tv
Code: Select all
samsungctl --method websocket --host 192.168.x.x --port 8001 -v KEY_POWER
Depending on your version of TV you might need to change the method parameter and the port.
Re: Python Plugin: Samsung TV
Posted: Tuesday 26 September 2017 23:49
by mircer
Hello felix63,
I try:
C:\WINDOWS\system32>samsungctl --method websocket --host 192.168.1.189 --port 8001 -v KEY_POWER
Sending control command: KEY_POWER
But nothing happens.
I have 2017 model, 75mu7000
someone know what i'm doing wrong ?
Thanks for the help
Re: Python Plugin: Samsung TV
Posted: Wednesday 27 September 2017 10:40
by felix63
Sorry... difficult to answer that question. I am running on linux not windows. And without any other than 'nothing happens' it's difficult to debug. Can't help you out.
Re: Python Plugin: Samsung TV
Posted: Wednesday 27 September 2017 10:52
by emme
mircer wrote: ↑Tuesday 26 September 2017 23:49
Hello felix63,
I try:
C:\WINDOWS\system32>samsungctl --method websocket --host 192.168.1.189 --port 8001 -v KEY_POWER
Sending control command: KEY_POWER
But nothing happens.
I have 2017 model, 75mu7000
someone know what i'm doing wrong ?
Thanks for the help
Are you trying to switch it on or off? is that the only one button that does not work?
some models does not support wake up on lan, especially if you have it WiFi connected (the interface is down while tv is off)
If you're trying to switch it off... ensure the remote connection is enabled and the plugin is paired with the device
ciao
M
Re: Python Plugin: Samsung TV
Posted: Monday 16 October 2017 20:32
by gijsje
i think it is seeing the tv
2017-10-16 20:30:54.511 (Samsung TV) Calling message handler 'onHeartbeat'.
2017-10-16 20:30:54.512 (Samsung TV) isAlive status :True
When i want to change something i get
2017-10-16 20:28:07.724 Error: (Samsung TV) 'onCommand' failed 'ImportError'.
2017-10-16 20:28:07.724 Error: (Samsung TV) ----> Line 170 in /home/pi/domoticz/plugins/samsungctl/plugin.py, function onCommand
2017-10-16 20:28:07.724 Error: (Samsung TV) ----> Line 287 in /home/pi/domoticz/plugins/samsungctl/plugin.py, function SamsungSend
2017-10-16 20:28:07.724 Error: (Samsung TV) ----> Line 10 in /usr/lib/python3.5/samsungctl/remote.py, function __init__
2017-10-16 20:28:07.724 Error: (Samsung TV) ----> Line 13 in /usr/lib/python3.5/samsungctl/remote_websocket.py, function __init__
Any idea?
Re: Python Plugin: Samsung TV
Posted: Monday 16 October 2017 21:17
by zak45
'onCommand' failed 'ImportError'
Looks like you do not have copied in the folder that can be found by the plugin system. Please take a look at the wiki.
Re: Python Plugin: Samsung TV
Posted: Tuesday 17 October 2017 0:06
by gijsje
i do have the plugin.py in the folder plugins/samsungctl did try also to change the folder to SamsungTV and Samsung TV without suc6
also checked if /usr/lib/python3.5/samsungctl/remote.py and /usr/lib/python3.5/samsungctl/remote_websocket.py are there and they are
If i restart domoticz i do get
2017-10-16 23:44:03.107 Error: (Samsung TV) 'onStart' failed 'ImportError'.
2017-10-16 23:44:03.107 Error: (Samsung TV) ----> Line 134 in /home/pi/domoticz/plugins/SamsungTV/plugin.py, function onStart
2017-10-16 23:44:03.107 Error: (Samsung TV) ----> Line 287 in /home/pi/domoticz/plugins/SamsungTV/plugin.py, function SamsungSend
2017-10-16 23:44:03.107 Error: (Samsung TV) ----> Line 10 in /usr/lib/python3.5/samsungctl/remote.py, function __init__
2017-10-16 23:44:03.107 Error: (Samsung TV) ----> Line 13 in /usr/lib/python3.5/samsungctl/remote_websocket.py, function __init__
if i try button mute i get
017-10-16 23:47:51.587 User: Admin initiated a switch command (117/Samsung TV - Volume/Set Level)
2017-10-16 23:47:51.619 (Samsung TV) Calling message handler 'onCommand'.
2017-10-16 23:47:51.619 (Samsung TV) onCommand called for Unit 3: Parameter 'Off', Level: 0, Connected: True
2017-10-16 23:47:51.621 Error: (Samsung TV) 'onCommand' failed 'ImportError'.
2017-10-16 23:47:51.621 Error: (Samsung TV) ----> Line 182 in /home/pi/domoticz/plugins/SamsungTV/plugin.py, function onCommand
2017-10-16 23:47:51.621 Error: (Samsung TV) ----> Line 287 in /home/pi/domoticz/plugins/SamsungTV/plugin.py, function SamsungSend
2017-10-16 23:47:51.621 Error: (Samsung TV) ----> Line 10 in /usr/lib/python3.5/samsungctl/remote.py, function __init__
2017-10-16 23:47:51.621 Error: (Samsung TV) ----> Line 13 in /usr/lib/python3.5/samsungctl/remote_websocket.py, function __init__
I do have a K series tv so maybe it does not work ue49ks7000s
if i do samsungctl --host 192.168.0.112 --method websocket KEY_VOLUP that is working also samsungctl --host 192.168.0.112 --method websocket KEY_MUTE
Re: Python Plugin: Samsung TV
Posted: Tuesday 24 October 2017 18:35
by dextm80
Hi guys, a guide for linux installation (ubuntu) and domoticz?