Hi,
I have updated to the latest globalcache 2.0 binding, and followed some configuration instructions online, to move all my IR commands to a MAP-file.
It is working fine, but I struggle a bit to make this work with my rules.
How can I make use of the mappings in the rules??
Now i’ve got demo.items:
/* Soundbar */
String Arvani "Arvani" { channel="globalcache:itachIR:000C1E026137:m1c3", knx="5/3/2" }
demo.sitemap:
Frame label="Soundbar"
Text label="Arvani" icon="video" {
Switch item=Arvani label="Power" mappings=[Arvani_Power="ON"]
Switch item=Arvani label="Vol +" mappings=[Arvani_VolUp="Vol +"]
Switch item=Arvani label="Vol -" mappings=[Arvani_VolDown="Vol -"]
Switch item=Arvani label="Input" mappings=[Arvani_Input="Input1_2"]
Switch item=Arvani label="Optical" mappings=[Arvani_Optical="Optical1_2"]
Switch item=Arvani label="Mute" mappings=[Arvani_Mute="Mute"]
MAP-file (globalcache.map)
# Arvani Soundbar
Arvani_Power = 38109,1,1,341,170,22,20,22,20,22,20,22,20,22,20,22,20,22,20,22,20,22,63,22,63,22,63,22,63,22,63,22,63,22,63,22,63,22,20,22,20,22,20,22,20,22,20,22,20,22,63,22,20,22,63,22,63,22,63,22,63,22,63,22,63,22,20,22,63,22,1519,341,85,22,3810
Arvani_VolUp = 38109,1,1,341,171,22,21,22,21,22,21,22,21,22,21,22,21,22,21,22,21,22,63,22,63,22,63,22,63,22,63,22,63,22,63,22,63,22,63,22,21,22,21,22,21,22,21,22,21,22,63,22,21,22,21,22,63,22,63,22,63,22,63,22,63,22,21,22,63,22,1518,341,85,22,3810
Arvani_VolDown = 38109,1,1,341,170,22,20,22,20,22,21,22,20,22,21,22,20,22,20,22,20,22,63,22,63,22,63,22,63,22,63,22,63,22,63,22,63,22,63,22,21,22,63,22,21,22,20,22,20,22,63,22,20,22,21,22,63,22,20,22,63,22,63,22,63,22,21,22,63,22,1520,341,85,22,3810
Arvani_Input = 38109,1,1,341,170,22,20,22,20,22,20,22,20,22,20,22,20,22,20,22,20,22,63,22,63,22,63,22,63,22,63,22,63,22,63,22,63,22,63,22,20,22,20,22,20,22,63,22,63,22,20,22,63,22,20,22,63,22,63,22,63,22,20,22,20,22,63,22,20,22,1519,341,85,22,3810
Arvani_Optical = 38109,1,1,341,170,22,20,22,20,22,21,22,21,22,20,22,20,22,20,22,21,22,63,22,63,22,63,22,63,22,63,22,63,22,63,22,63,22,20,22,20,22,20,22,21,22,63,22,63,22,63,22,63,22,63,22,63,22,63,22,63,22,21,22,20,22,20,22,20,22,1521,341,85,22,3810
Arvani_Mute =38109,1,1,341,170,22,20,22,20,22,20,22,21,22,21,22,21,22,21,22,21,22,63,22,63,22,63,22,63,22,63,22,63,22,63,22,63,22,20,22,20,22,20,22,63,22,21,22,21,22,63,22,21,22,63,22,63,22,63,22,21,22,63,22,63,22,21,22,63,22,1518,341,85,22,3810
.demo.rules:
// Imports
import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*
// Global Variables
rule "Doorbell"
when
Item Scenarie_FF_Corridor_Doorbell received command
then
if(receivedCommand==ON) {
Arvani.sendCommand(Arvani_Mute)
}
then {
sendCommand(CC_Living_PlayURI http://IP:PORT/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=USER&pwd=PASSWD)
}
end