Switch item using two diferent binding

item
Tags: #<Tag:0x00007fd30cb27be0>

(Marcel Oliveira) #1

Dear Colleagues,

i’m new in OH and I have some questions that I can’t solve by only using the docs.

I have been using the samsung binding pretty well, it’s able to turn OFF my TV but it can’t turn ON, than I’m using broadlink to do the POWER on, may you help me to identify how to call diferent binding or add two channel ins my item, where power ON will use brodlink IR sender and power OFF we are able to keep the samsung binding as it’s capable to collect the status.

Exampleo item able to power off TV
Switch TV_Power “TV Power” [ “Switchable” ] {channel=“samsungtv:tv:sala:power”}

Below item create to pass the command to shutdown/power off
String broadlink { channel=“broadlink:rm2:34-ea-34-d0-a8-8c:command” }

Sitemap definition
Switch item=TV_Power

How to call diferent items from single site map “item”?


(Jürgen Baginski) #2

I’m not sure that you can use two different bindings, what you always can do is using a proxy item which will trigger a rule when changed. In the rule you can send the commands to the items that are connected to the specific binding.


(Thomas Rivinius) #3

For the leanest approach I would suggest to group them. Make

Group:Switch:OR(ON, OFF) gTVPower

and add the two lower level level switches to the group. This assumes that an ON-command to the samsung binding will have no effect at all, and an OFF-command to the broadlink neither, so no interference between the two items. Then the only item you will have to deal with at high level is the group.


(Josar) #4

You can find example code for what @opus explained here. It is a similar problem.


(Rich Koshak) #5

You can have as many bindings or channels as you want on an Item.

However, these bindings will not let you set up your Item like this so opus or rivi’s suggestions are the way to go.