Enigma2 sitemap

sound

Group   BR_Zero                           "Zero ložnice"            <zero>        (BR_Zero)   ["TV"]
String  e2_br_Channel                     "Program [%s]"            <zero>        (BR_Zero)	{ http="<[http://192.168.0.33:80/web/getcurrent:3000:REGEX(.*?<e2servicename>(.*?)</e2servicename>.*)]" }
String  e2_br_Actual_Streaming            "Pořad [%s]"              <zero>        (BR_Zero)	{ http="<[http://192.168.0.33:80/web/getcurrent:3000:REGEX(.*?<e2eventname>(.*?)</e2eventname>.*)]" }
String  e2_br_Actual_StreamingED          "Popis [%s]"              <zero>        (BR_Zero)	{ http="<[http://192.168.0.33:80/web/getcurrent:3000:REGEX(.*?<e2eventdescription>(.*?)</e2eventdescription>.*)]" }
String  e2_br_Actual_StreamingEDE         "Popis [%s]"              <zero>        (BR_Zero)	{ http="<[http://192.168.0.33:80/web/getcurrent:3000:REGEX(.*?<e2eventdescriptionextended>(.*?)</e2eventdescriptionextended>.*)]" }
Number  e2_br_number_channel //GH
Number  e2_br_number_key
Dimmer  e2_br_vol_out
Number  e2_br_vol_in                      "Volume [%s]"             <zero>        (BR_Zero)	{ http="<[http://192.168.0.33:80/web/vol:3000:REGEX(.*?<e2current>(.*?)</e2current>.*)]" }
String  e2_br_HD_Free                     "HD Free [%s]"            <zero>        (BR_Zero)	{ http="<[http://192.168.0.33:80/web/deviceinfo:3000:REGEX(.*?<e2free>(.*?)</e2free>.*)]" }
Switch  e2_br_onoff                       "Power Zero"                            (BR_Zero)                [ "Switchable" ]
Switch 	e2_br_ct1                         "CT1"                     <tv_ct1>      (BR_Zero) [ "Switchable" ]
Switch 	e2_br_ct24                        "CT 24"                   <tv_ct24>     (BR_Zero) [ "Switchable" ]
Switch 	e2_br_nova                        "Nova"                    <tv_nova>     (BR_Zero) [ "Switchable" ]
Switch 	e2_br_prima                       "Prima"                   <tv_prima>    (BR_Zero) [ "Switchable" ]
Switch 	e2_br_barrandov                   "Barrandov"               <tv_barrandov>(BR_Zero) [ "Switchable" ]
Switch 	e2_br_rebel                       "Rebel"                   <tv_rebel>    (BR_Zero) [ "Switchable" ]
sitemap zero label="zero" icon="zero" {
    Frame         label="Enigma2 BR" {
        Switch    item=e2_br_onoff
        Slider    item=e2_br_vol_out  label="Zvuk Zero [%s]" icon="soundvolume"
        Text      item=e2_br_vol_in
        Switch    item=e2_br_number_key       label="Zvuk Zero [%s]"  icon="soundvolume" mappings=[113="mute", 114="\u25BC", 115="\u25B2"]
        Switch    item=e2_br_number_key       label="\u2B1B\u2B1B\u2B1B\u2B1B [%s]"     icon="zero" mappings=[398="red", 399="green", 400="yelow", 401="blue"] labelcolor=[398="red", 399="green", 400="yellow", 401="blue"]
        Switch    item=e2_br_number_key       label="Command [%s]"                      icon="zero" mappings=[352="OK", 1="EXIT", 105="\u25C4", 106="\u25BA"]
        Text      item=e2_br_Channel
        Text      item=e2_br_Actual_Streaming
        Text      item=e2_br_HD_Free
        Selection item=e2_br_number_channel   label="TV program"  icon="zero" mappings=[1="CT 1", 2="CT 24", 3="Nova", 4="Prima", 5="Barrandov", 6="Rebel"]
        Switch    item=e2_br_number_channel   label="TV program"  icon="zero" mappings=[1="CT 1", 2="CT 24", 3="Nova"]
        Switch    item=e2_br_number_channel   label="TV program"  icon="zero" mappings=[4="Prima", 5="Barrandov", 6="Rebel"]
        Text      item=e2_br_Google  label="Google Home" icon="google" {
        Text      item=e2_br_Channel
        Switch    item=e2_br_ct1
        Switch    item=e2_br_ct24
        Switch    item=e2_br_nova
        Switch    item=e2_br_prima
        Switch    item=e2_br_barrandov
        Switch    item=e2_br_rebel
      }
        Text      item=e2_br_Actual_StreamingED
        Text      item=e2_br_Actual_StreamingEDE
    }
}
var String e2_br_ip = "192.168.0.33"

rule "e2_br_number_key"
    when
        Item e2_br_number_key received command
    then
        sendHttpGetRequest("http://" + e2_br_ip + "/web/remotecontrol?command=" + (e2_br_number_key.state as Number))
end

rule "e2_vol_out"
    when
        Item e2_br_vol_out received command
    then
        sendHttpGetRequest("http://" + e2_br_ip + "/web/vol?set=set" + (e2_br_vol_out.state as Number))
end

rule "e2_vol_in"
    when
        Item e2_br_vol_in changed
    then
        e2_br_vol_out.postUpdate(e2_br_vol_in.state as Number)
end

rule "Selection item=e2_br_number_channel"
    when
        Item e2_br_number_channel received command
    then
        switch(receivedCommand) {
            case 1 :   sendHttpGetRequest("http://" + e2_br_ip + "/web/zap?sRef=1:0:1:1F41:CA1:3:EB0000:0:0:0") //ct1
            case 2 :   sendHttpGetRequest("http://" + e2_br_ip + "/web/zap?sRef=1:0:1:1F43:CA1:3:EB0000:0:0:0") //ct24
            case 3 :   sendHttpGetRequest("http://" + e2_br_ip + "/web/zap?sRef=1:0:1:3391:C89:3:EB0000:0:0:0") //nova
            case 4 :   sendHttpGetRequest("http://" + e2_br_ip + "/web/zap?sRef=1:0:1:3392:C89:3:EB0000:0:0:0") //prima
            case 5 :   sendHttpGetRequest("http://" + e2_br_ip + "/web/zap?sRef=1:0:1:132B:CA2:3:EB0000:0:0:0") //barrandov
            case 6 :   sendHttpGetRequest("http://" + e2_br_ip + "/web/zap?sRef=1:0:1:5248:C99:3:EB0000:0:0:0") //rebel
}
            e2_br_number_channel.postUpdate(OFF)
end

rule "ct1"
    when
        Item e2_br_ct1 received command
    then
        switch(receivedCommand) {
            case ON :  sendHttpGetRequest("http://" + e2_br_ip + "/web/zap?sRef=1:0:1:1F41:CA1:3:EB0000:0:0:0")
}
            e2_br_ct1.postUpdate(OFF)
end

rule "ct24"
    when
        Item e2_br_ct24 received command
    then
        switch(receivedCommand) {
            case ON :  sendHttpGetRequest("http://" + e2_br_ip + "/web/zap?sRef=1:0:1:1F43:CA1:3:EB0000:0:0:0")
}
            e2_br_ct24.postUpdate(OFF)
end

rule "nova"
    when
        Item e2_br_nova received command
    then
        switch(receivedCommand) {
            case ON :  sendHttpGetRequest("http://" + e2_br_ip + "/web/zap?sRef=1:0:1:3391:C89:3:EB0000:0:0:0")
}
            e2_br_nova.postUpdate(OFF)
end

rule "prima"
    when
        Item e2_br_prima received command
    then
        switch(receivedCommand) {
            case ON :  sendHttpGetRequest("http://" + e2_br_ip + "/web/zap?sRef=1:0:1:3392:C89:3:EB0000:0:0:0")
}
            e2_br_prima.postUpdate(OFF)
end

rule "barrandov"
    when
        Item e2_br_barrandov received command
    then
        switch(receivedCommand) {
            case ON :  sendHttpGetRequest("http://" + e2_br_ip + "/web/zap?sRef=1:0:1:132B:CA2:3:EB0000:0:0:0")
}
            e2_br_barrandov.postUpdate(OFF)
end

rule "rebel"
    when
        Item e2_br_rebel received command
    then
        switch(receivedCommand) {
            case ON :  sendHttpGetRequest("http://" + e2_br_ip + "/web/zap?sRef=1:0:1:5248:C99:3:EB0000:0:0:0")
}
            e2_br_rebel.postUpdate(OFF)
end

rule "OnOff"
    when
        Item e2_br_onoff received command
    then                                                                    
        switch(receivedCommand) {
            case ON :  sendHttpGetRequest("http://" + e2_br_ip + "/web/powerstate?newstate=4")
            case OFF : sendHttpGetRequest("http://" + e2_br_ip + "/web/powerstate?newstate=5")
}
end