How to integrate Samsung TV (binding) in to sitemap

1,522 views
Skip to first unread message

RGL

unread,
Oct 2, 2013, 8:56:21 AM10/2/13
to ope...@googlegroups.com
Experts - I am stuck at the point that I set up my Samsung TV binding in openhab.cfg and need a little hint:

samsungtv:SchlafzimmerTV.host=192.168.0.246

and created some items:

/* TV Settings */

Number        TV_Kanal      {samsungtv="0:SchlafzimmerTV:KEY_0, 1:SchlafzimmerTV:KEY_1, 2:SchlafzimmerTV:KEY_2, 3:SchlafzimmerTV:KEY_3, 4:SchlafzimmerTV:KEY_4, 5:SchlafzimmerTV:KEY_5, 6:SchlafzimmerTV:KEY_6, 7:SchlafzimmerTV:KEY_7, 8:SchlafzimmerTV:KEY_8, 9:SchlafzimmerTV:KEY_9"}
Dimmer        TV_Kanal_up_down {samsungtv="INCREASE:Livingroom:KEY_CHUP, DECREASE:Livingroom:KEY_CHDOWN"}
Rollershutter TV_Lautstaerke   {samsungtv="UP:SchlafzimmerTV:KEY_VOLUP, DOWN:SchlafzimmerTV:KEY_VOLDOWN"}

I would no like to make use of those settings in my sitemap - but I have no clue how to make use of the Number item.
Does anyone have an example available? (I checked the Sample Wiki but did not find one.)

Thanks,
Ronny

 

 

 

 

 

 

Kevin Rasmussen

unread,
Oct 2, 2013, 9:36:33 AM10/2/13
to ope...@googlegroups.com
Hi there.

In my own environment I have made a simple "remote" control:

Sitemap:
Switch item="TV_Kanal_Remote_Top" label="TV_Channel" mappings=[0="1", 1="2", 2="3"]
Switch item="TV_Kanal_Remote_Middle" mappings=[0="4", 1="5", 2="6"]
Switch item="TV_Kanal_Remote_Bottom" mappings=[0="7", 1="8", 2="9"]
Switch item="TV_Kanal_Remote_Zero" mapping=[0="0"]

Then do a rule for each Switch item and sent the corresponding command to your number item, and after that, update your Switch item with the value 3 (this marks the button "unpressed" again hence it updates it to a non-existing value):

rule "TV_Kanal_Remote_Top"
when
received command TV_Kanal_Remote_Top
Then
Switch TV_Kanal_Remote_Top.state {
case 0 : {
sendCommand("TV_Kanal", 1) 
}
case 1 : {
sendCommand("TV_Kanal", 2)
 
case 2 : {
sendCommand("TV_Kanal", 3)
sendUpdate("TV_Kanal_Remote_Top", 3) 
End

And the same for both "TV_Kanal_Remote_Middle" and "TV_Kanal_Remote_Bottom".

Then a simple rule for the "TV_Kanal_Remote_Zero":

rule "TV_Kanal_Remote_Zero"
When
received command TV_Kanal_Remote_Zero
Then
sendCommand("TV_Kanal", 0)
sendUpdate("TV_Kanal_Remote_Zero", 3)
End 
 

This creates a nice little numpad as you knows it from a computer keyboard:

1 2 3
4 5 6
7 8 9
     0

RGL

unread,
Oct 10, 2013, 8:17:22 AM10/10/13
to ope...@googlegroups.com
 Interesting suggerstion - will try this out.
 I was hoping the guy who wrote the binding will have a good sitemap example available with all controls integrated.
 
But your suggestion is a great starting point already.
Thanks,
Ronny
 
 
 
Reply all
Reply to author
Forward
0 new messages