Hi, I’m still quite a novice what openhab is concerned and currently trying to integrate my Sony Bravia in the system.
I can integrate the individual functions (apps, sources, etc.) as a switch into the sitemap. However I try to integrate this as a selection. Is it possible to create a virtual selection item that switches switches (like the picture?)
Thank you for your answer, I have already read the article. My question is now how can I use the mappings to turn on exuding switches?
I have currently created a rule but it doesnt works:
rule "TV Quelle"
when
Item sonySource received update
then
if sonySource.state.contains ("HDMI1") {
sonyHDMI1.sendCommand(ON)
}
else if sonySource.state.contains ("HDMI2") {
sonyHDMI2.sendCommand(ON)
...
You will receive a command from your UI so:
And then sonySource.state.toString.contains("XXXX")
rule "TV Quelle"
when
Item sonySource received command
then
if sonySource.state.toString.contains("HDMI1") {
sonyHDMI1.sendCommand(ON)
}
else if sonySource.state.toString.contains("HDMI2") {
sonyHDMI2.sendCommand(ON)
...
Or better:
rule "TV Quelle"
when
Item sonySource received command
then
var itemName = ""
if sonySource.state.toString.contains("HDMI1") {
itemName = "sonyHDMI1"
}
else if sonySource.state.toString.contains("HDMI2") {
itemName = "sonyHDMI2"
...
...
//end of rule
sendCommand(itemName, "ON")
1 Like