Hi,
I need to control TV volume level by sending exec command of Setpoint item
if arrow up is pressed:
executeCommandLine("/usr/local/bin/samsungctl --host 192.168.100.200 --method websocket KEY_VOLUP")
if arrow down is pressed command volume level down should be executed:
executeCommandLine("/usr/local/bin/samsungctl --host 192.168.100.200 --method websocket KEY_VOLDOWN")
How should I define such an “Setpoint Item” and how should be defined rule.
Thanks.
From pi cmd line install:
pip3 install samsungctl
pip3 install websocket-client (necessary for new TVs.
After this copy modified samsungtv.conf to pi/.config directory
{
“name”: “samsungctl”,
“description”: “Pi”,
“id”: “”,
“method”: “websocket”,
“port”: 55000,
“timeout”: 0
}
After this you can start using a command line like:
/usr/local/bin/samsungctl --host 192.168.100.200 --method websocket KEY_xxxx
Try /usr/local/bin/samsungctl -i --host 192.168.100.200 --method websocket
for all possible commands :0)
My question is about control volume Up and Down with Openhab item/rule like setpoint with arrows.
If you able please rename post to Samsung new type TV control in Openhab2.
rule “Samsung TV Volume Up/Down"
when
Item TV_VolUpDown received update
then
if(receivedCommand == OFF) executeCommandLine(”/usr/local/bin/samsungctl --host 192.168.100.200 --method websocket KEY_VOLDOWN")
if(receivedCommand == ON) executeCommandLine("/usr/local/bin/samsungctl --host 192.168.100.200 --method websocket KEY_VOLUP")
end
This is not usable :0(
If you prefer contact me on Skype jozefszabo from Bratislava (German or english or slovak)
Hi,
Prepare all as descibed in the installation above.
On sitemap I have only a group for Dreambox and Samsung
Frame {
Group item=DM8000 label=“DM8000” icon="receiver"
Group item=Samsung label=“Samsung” icon=“television”
}
Rules
rule “Samsung TV Pwr Toogle"
when
Item TV_Power received command
then
if(receivedCommand == OFF) executeCommandLine(”/usr/local/bin/samsungctl --host 192.168.100.110 --method websocket KEY_POWER")
if(receivedCommand == ON) executeCommandLine("/usr/local/bin/samsungctl --host 192.168.100.110 --method websocket KEY_POWER")
end
rule “Samsung TV Volume Up"
when
Item TV_VolUp received update
then
executeCommandLine(”/usr/local/bin/samsungctl --host 192.168.100.110 --method websocket KEY_VOLUP")
end
rule “Samsung TV Volume Down"
when
Item TV_VolDown received update
then
executeCommandLine(”/usr/local/bin/samsungctl --host 192.168.100.110 --method websocket KEY_VOLDOWN")
end
rule “Samsung TV Volume Mute"
when
Item TV_Mute received command
then
if(receivedCommand == OFF) executeCommandLine(”/usr/local/bin/samsungctl --host 192.168.100.110 --method websocket KEY_VOLUP")
if(receivedCommand == ON) executeCommandLine("/usr/local/bin/samsungctl --host 192.168.100.110 --method websocket KEY_MUTE")
end
rule “Samsung TV Pwr Toogle"
when
Item TV_Power received command
then
if(receivedCommand == OFF) executeCommandLine(”/usr/local/bin/samsungctl --host 192.168.100.110 --method websocket KEY_POWER")
if(receivedCommand == ON) executeCommandLine("/usr/local/bin/samsungctl --host 192.168.100.110 --method websocket KEY_POWER")
end
rule "Samsung TV Volume Up"
when
Item TV_VolUp received update
then executeCommandLine("/usr/local/bin/samsungctl --host 192.168.100.110 --method websocket KEY_VOLUP")
end
rule “Samsung TV Volume Down"
when
Item TV_VolDown received update
then
executeCommandLine(”/usr/local/bin/samsungctl --host 192.168.100.110 --method websocket KEY_VOLDOWN")
end
rule “Samsung TV Volume Mute"
when
Item TV_Mute received command
then
if(receivedCommand == OFF) executeCommandLine(”/usr/local/bin/samsungctl --host 192.168.100.110 --method websocket KEY_VOLUP")
if(receivedCommand == ON) executeCommandLine("/usr/local/bin/samsungctl --host 192.168.100.110 --method websocket KEY_MUTE")
end
Did you cover a problem with going offline TV? Are you able to power on? I have version M (2017) and I can perform commands. I’ve noticed some strange behavior - I’ve added a POWER key with binding OH2 and I can read ON/OFF status (switch value updates), but I can’t send anything.
HI, look at table from 2.April. They are two functions, maybe one is equivalent of display sources on TV and another for info? But I have not tryed it. Good luck.
KEY_SOURCE
KEY_HDMI
Unfortunately not…HDMI changes source and SOURCE shows all sources on TV… maybe any http request ?
I found: http://XXXXXX:8001/api/v2/ - but there is no info about it.