SamsungTV Binding - KEY_POWERON don't work , but KEY_POWEROFF works

1,902 views
Skip to first unread message

Christopher Böhm

unread,
May 18, 2014, 6:30:56 PM5/18/14
to ope...@googlegroups.com
Hi guys,

i am new to openhab und this is my first try with the SamsungsTV-Bindings.
I have a Samsung TV called UE40D5700 and i want a switch in openhab to shut off/on the tv.

So, i used this: "Switch        tvoff           {samsungtv="ON:livingroom:KEY_POWERON, OFF:livingroom:KEY_POWEROFF"}"

Shutting off the TV works perfect, but i can not power on it.
I tried also "KEY_POWER", but also nothing.

How can i power on my tv with openhab?

franz.di...@gmail.com

unread,
May 19, 2014, 3:34:19 AM5/19/14
to ope...@googlegroups.com
It's the same for me. I suppose Samsung does not allow for this on purpose.

There is a trick, though: I you have your TV attached to your computer (a Raspberry Pi in my case) via HDMI,you can use the HDMI CEC interface to switch it on. You need libcec and corresponding tools around it. You need some technical background to use it. I would need to look up how I did it again, so please tell me if this is the way you want to go.

Dieter

Christopher Böhm

unread,
May 19, 2014, 7:08:00 AM5/19/14
to ope...@googlegroups.com
the TV is not connected to any kind of pc, so that's no solution for me

franz.di...@gmail.com

unread,
May 19, 2014, 7:40:30 AM5/19/14
to ope...@googlegroups.com
OK. I am afraid there is no solution for you, see also https://groups.google.com/d/msg/openhab/weiReJhJ2ZI/db2Wxhq9fpgJ

thomas....@googlemail.com

unread,
May 19, 2014, 7:59:30 AM5/19/14
to ope...@googlegroups.com
I read somewhere that because of energy saving concerns the network interface is deactivated once the TV is switched off. So no activation again. I successfully build a illumination device based on an arduino and with a spare PWM pin and a IR (infrared) arduino library I was able to emulate the samsung IR remote control to switch my TV on by placing a self made IR emitter. Currently its not functional because I need to rebuild the pcb (dont want to use the arduino, its too big). So maybe this is an solution for you? Build an infrared emitter? (I currently dont have instructions I will write a blog post about it but I dont know when I will find the time for it...)

best regards

Chris Jackson

unread,
May 19, 2014, 8:03:40 AM5/19/14
to ope...@googlegroups.com
I thought I’d read somewhere that the latest versions did have the ability to turn on as well as off, but I think this is only for models this year and I’ve not actually tried it (yet!) with my TV.

Cheers
Chris

Karel Goderis

unread,
May 19, 2014, 8:41:54 AM5/19/14
to ope...@googlegroups.com
Or you could try the irTrans binding ;-)

I have brand new Samsung devices, and no way to switch them on via the network indeed, but I also intend to solve that with an infrared blaster

K

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/d/optout.

EBorges

unread,
May 20, 2014, 4:25:33 AM5/20/14
to ope...@googlegroups.com
If anyone wants to persue the HDMI-CEC route bare in mind that there are options that do not require to have any PC , or RPI, attached to TV. Google's Chromecast has this feature ( see Chromecast FAQ) and it could be used to turn on the TV. There's also HDMI-CEC / IP bridges ( see kwikwai for example)
Neverthless I'm currently not aware of OpenHab direct control over HDMI-CEC ( someone correct me if I'm wrong)

Cheers
Eurico

Karel Goderis

unread,
May 20, 2014, 4:39:05 AM5/20/14
to ope...@googlegroups.com
At EUR 240 the kwikwai does not come cheap either, but is seems to be an elegant solution. They do not support Java, so from OH's point of view it is a question of developing a TCP baesd binding issuing ASCII commands
Chromecast, in Google tradition, will be the more affordable solution ;-)

K

franz.di...@gmail.com

unread,
May 20, 2014, 10:22:04 AM5/20/14
to ope...@googlegroups.com
I think a Raspberry Pi is a fairly cheap solution, especially if it can run openHAB anyway. Keep in mind its low power consumption as well.

hl_at

unread,
Jan 10, 2015, 6:55:37 PM1/10/15
to ope...@googlegroups.com
Hello Dieter!


But how to send from OpenHAB the commands (nice tool for cec commands: http://www.cec-o-matic.com/) to the raspberry (--> OpenHAB is running on a different machine)? If we could send from OpenHAB commands to Raspberry which uses CEC to control the TV I think it's possible to use the TV OSD for Messages from OpenHAB to the TV.

Possible?

Herbert

alex...@gmail.com

unread,
Jan 11, 2015, 4:13:48 PM1/11/15
to ope...@googlegroups.com
Hi Herbert,

this is actually a pretty neat idea! One could try to use the "OSD Display" feature of libCEC to let the TV display a message -- I tried to do just that a few moments ago, but unfortunately, my TV (2014 Samsung) does not seem to support this feature over CEC. Look here for a compatibility matrix from libCEC: http://libcec.pulse-eight.com/vendor/support
As you can see, no manufacturer seems to support "OSD String Display" at the moment (or it has not been tested, yet).

I did manage to change HDMI inputs and so on, so cec-tools seems to be working, but sadly, OSD Display does not :-(

(P.S.: getting the data from your openHAB machine to the raspberry would have been very easy when using the exec-binding, i.e. establishing a SSH connection to your raspberry and sending the command via command line).

Herbert Lackner

unread,
Jan 11, 2015, 8:22:18 PM1/11/15
to ope...@googlegroups.com
Hey Alex!

Thanks for checking the Idea. As I am absolutely not into the exec Binding could you please post an example config for turning Off or On the TV? As i have a Samsung B Series TV I have to try controlling it via Raspberry and HDMI.

Thx 

Von meinem iPad gesendet
--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/yd_ie5ZDIR0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.

alex...@gmail.com

unread,
Jan 12, 2015, 5:00:49 AM1/12/15
to ope...@googlegroups.com
Hey Herbert,

sure, here you go:
Put this into your *.items file:

Switch        TV_OnOff    "Turn TV on/off"    (TV)    {exec=">[OFF:ssh pi@YOUR_IP echo \'standby 0\' | sudo cec-client -s] >[ON:ssh pi@YOUR_IP echo \'on 0\' | sudo cec-client -s]"}

You can then either put this item in your sitemap, or send commands to it within your rules (e.g. by invoking "sendCommand(TV_OnOff, OFF)").
Just tested this with my Samsung TV, works fine!

However, please note that in order for the above to work you have to have public/private-key authentication enabled on your Rasperry, so that your openHAB machine can log in without getting prompted for a password.

Hope I could help you!

Regards
Alex

hl_at

unread,
Feb 16, 2015, 4:25:59 PM2/16/15
to
Hey Alex!

Thank you for your hints and excuse My late Response. It just took me a while to jump over My worries about using samy go to hack my TV (had to revert Firmware)

There is stated: "Allow send remote controller key-codes for TV via telnet. Can use PuTTY at desktop with settings: port - 2345, connection type - Raw. On PC you can use this app." (remote lan control http://wiki.samygo.tv/index.php5/Content_Library_applications_list#Remote_LAN_Control)

--> I tested it with an Ios App and the Desktop program - it's working.

My openHAB.cfg config:

# Host of the first TV to control
samsungtv
:wohnzimmer.host=192.168.1.12
# Port of the TV to control (optional, defaults to 55000)
samsungtv
:wohnzimmer.port=2345

My items config:

 Switch mute           {samsungtv="ON:wohnzimmer:KEY_MUTE, OFF:wohnzimmer:KEY_MUTE"}


and of Course if have the Switch in the sitemap.

If I use the Switch in OpenHAB i see that openHAB receives the message - but nothing happens on TV.
Trying with Port 55000 i always get a connect error.

Any ideas?

Herbert

P.S. if you speak german - here some addon to the OSD Stuff we were talking about :http://forum.fhem.de/index.php?topic=12988.55;wap2 or http://samsung.rainerullrich.de/)


Torstein Sunde

unread,
May 1, 2015, 11:15:15 AM5/1/15
to ope...@googlegroups.com
If you are already using the CEC client on the Pi connected to the TV for controlling XBMC/Kodi, this solution will deactivate the control over this source. This means you can no longer remote control the application with your standard TV-remote. A reboot of the media center is necessary to regain control.

Luckily, Kodi has built in commands that can turn on the TV for you via CEC. For this purpose, the CECActivateSource command is what you need. This addon exposes the built in CEC commands over JSON RPC. After installing the addon, one can simply run the following command to turn on your TV while still maintaining control via your regular remote

curl -s --data-binary '{"id":1,"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"addonid":"script.json-cec","params":{"command":"activate"}}}' -H 'content-type: application/json;' http://<ip-to-kodi>:8080/jsonrpc
or
http://<ip-to-kodi>:8080/jsonrpc?request={"id":1,"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"addonid":"script.json-cec","params":{"command":"activate"}}}

Regards,
Torstein
Reply all
Reply to author
Forward
0 new messages