Enigma2 sitemap

(Angelos) #2

you need to post much more info to get help… (that were being requested in the template that you erased when creating the thread in this section…)
Item configs and sitemap config at least
Using Code Fences

0 Likes

(Wolfifam1) #3

default.sitemap

sitemap gigablue label=“Gigablue” {
Frame {
Group item=Gigablue
}

Frame {
    Text label="Gigablue" icon="rollershutter" {
        Default item=Gigablue label="Gigabluer"  
    }
}

}

Enigma2.rule

                     rule "GB_Mute"
when
    Item GB_sendMute received command
then
    switch(receivedCommand) {
        case ON :  sendHttpGetRequest("http://root:xxxxxx@192.168.178.22:80/web/vol?set=mute")
        case OFF : sendHttpGetRequest("http://root:xxxxxxx@192.168.178.22:80/web/vol?set=mute")

}
end
enigma2.itimes

Group Gigablue
/* Gigablue HD Quad /
String GB_Sendung “Aktuelle Sendung [%s]” <projector_benq> ( Gigablue ) { http="<[http://root:xxxxxx@192.168.178.22:80/web/getcurrent:3000:REGEX(.
?(.?).)]" }
String GB_Kanal “Sender [%s]” <projector_benq> ( Gigablue ) { http="<[http://root:xxxxxxxx@192.168.178.22:80/web/getcurrent:3000:REGEX(.?(.?).*)]" }
Switch GB_sendMute “Mute” <soundvolume_mute> ( Gigablue )

I would like to expand that as written above

0 Likes

(Angelos) #4

here is something useful (check many more examples in that thread)

then you can place enigma_power_switch on your sitemap
and from what I saw in that thread quickly: you cannot set the volume directly to a preset using http. you can only send increase/decrease steps.

0 Likes

(Wolfifam1) #5

can you give me your whole template with sitmap

0 Likes

(Wolfifam1) #6

2018-11-30 00:25:01.911 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule ‘Enigma2 State’: The name ‘enigma_power_state’ cannot be resolved to an item or type; line 13, column 5, length 18

==> /var/log/openhab2/events.log <==

2018-11-30 00:25:03.728 [ome.event.ItemCommandEvent] - Item ‘GB_volume’ received command 0

==> /var/log/openhab2/openhab.log <==

2018-11-30 00:25:30.239 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule ‘Enigma2 State’: The name ‘enigma_power_state’ cannot be resolved to an item or type; line 13, column 5, length 18

2018-11-30 00:25:33.809 [WARN ] [sitemap.internal.SitemapProviderImpl] - Filename default.sitemap does not match the name gigablue of the sitemap - please fix this as you might see unexpected behavior otherwise.

2018-11-30 00:26:00.227 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule ‘Enigma2 State’: The name ‘enigma_power_state’ cannot be resolved to an item or type; line 13, column 5, length 18

0 Likes

(CM6.5 H102) #7
2018-11-30 00:25:33.809 [WARN ] [sitemap.internal.SitemapProviderImpl] - Filename default.sitemap does not match the name gigablue of the sitemap - please fix this as you might see unexpected behavior otherwise.

The file name needs to be the same as the sitemap name.

Example

gigablue.sitemap

sitemap gigablue label=“Gigablue” {
Frame {
Group item=Gigablue
}
2018-11-30 00:26:00.227 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule ‘Enigma2 State’: The name ‘enigma_power_state’ cannot be resolved to an item or type; line 13, column 5, length 18

You need to post the entire rule, not just a few lines.

0 Likes

(Wolfifam1) #8

thanks that works now now have the problem with sound
What am I doing wrong
From null

rule “GB_Mute”
when
Item GB_sendMute received command
then
switch(receivedCommand) {
case ON : sendHttpGetRequest(“http://root:xxxxxx@192.168.178.22:80/web/vol?set=mute”)
case OFF : sendHttpGetRequest(“http://root:xxxxx@192.168.178.22:80/web/vol?set=mute”)
}
end

rule “GB_Volume”
when
Item GB_sendVolume received command
then
dimmer(receivedCommand) {
case up : sendHttpGetRequest(“http://root:xxxxxx@192.168.178.22:80/web/vol?set=up”)
case down : sendHttpGetRequest(“http://root:xxxxxx@192.168.178.22:80/web/vol?set=down”)
}
end

0 Likes

(CM6.5 H102) #9

Your rules need help in the then section. This section is used for doing something based on what is defined in the when section. See and answer the comments added to the rule below.

rule “GB_Volume”
when
Item GB_sendVolume received command   // when this item get a update
then
dimmer(receivedCommand) {    // what are you trying to do on this line?
case up : sendHttpGetRequest(“http://root:werder123@192.168.178.22:80/web/vol?set=up”)   // case up?? Are you wanting to use a switch case in the rule?
case down : sendHttpGetRequest(“http://root:werder123@192.168.178.22:80/web/vol?set=down”)
}
end

Simple rule example that turns ON/OFF a light at a given time. See the notes added

rule "Turn Couch Light On"

when

	Time cron "0 30 18 ? * *"    //  At 6:30pm every day 

then

	CouchLight.sendCommand(ON)  // My light, with item name CouchLight, sends the ON command to turn the light ON.

end

rule "Turn Couch Light Off"

when

	Time cron "0 30 23 ? * *"

then 

	CouchLight.sendCommand(OFF)

end

0 Likes

(Wolfifam1) #10

I want to do loud and quiet that’s wrong

0 Likes

(CM6.5 H102) #11

Do you have to use a rule, or will giving a command via BasicUI to an item work?

This is just an example, replace with the correct http info for volume.

Item

Dimmer Volume "Your Volume [%d]"  { http="<[http://root:xxxxxx@192.168.178.22:80/web/getcurrent:3000:REGEX(.?(.?).)]" }

// or this if the info is correct.
Dimmer Volume "Your Volume [%d]"  { http="<[http://root:xxxxxx@192.168.178.22:80/web/vol?set=up]" }

And something like this in the sitemap to control the volume:

sitemap gigablue label=“Gigablue” {
Frame {
Group item=Gigablue
Slider item=Volume label="TV Volume"
}

0 Likes

(CM6.5 H102) #12

Just looking at the link posted above try this:

Add the IP address and port number to both items below and try using them to control the volume.

Items

Dimmer  Volume_Down "Volume Dowm [%d]" {http=">[ON:GET:http://IP-Address:Port/web/remotecontrol?command=114]", autoupdate="false"}
Dimmer Volume_Up "Volume Up [%d]"  {http=">[ON:GET:http://IP-Address:Port/web/remotecontrol?command=115]", autoupdate="false"}

Sitemap

sitemap gigablue label=“Gigablue” {
Frame {
Group item=Gigablue
Setpoint item=Volume_Up label="TV Volume Up"  minValue=0 maxValue=100 step=1
Slider item=Volume_Down label="TV Volume Down"
}

The above sitemap is using Setpoint to change volume up and Slider to change it down. Verify this will control the volume, then work toward eliminating the need for extra sitemap entries with the help of rules.

0 Likes

(Wolfifam1) #13

Have problem with the sidemap

sitemap our_home label="Gigablue" {
    Frame label="Gigablue" icon="groundfloor" {
        Group item=Gigablue
    }

Frame {
        Text label="Gigablue" icon="rollershutter" {
        Default item=Gigablue label="Gigablue" 
        
        sitemap gigablue label=“Gigablue” {
Frame {
Group item=Gigablue
Setpoint item=Volume_Up label="TV Volume Up"  minValue=0 maxValue=100 step=1
Slider item=Volume_Down label="TV Volume Down"

        }
    }
}


Welcome!

Available sitemaps

It seems like you have not defined any sitemaps yet. To build one, please check the documentation for guidance.

0 Likes

(CM6.5 H102) #14

You had the site map before, what changed? Read both the documentation and what others take the time to reply in a post. e.g.

I corrected the site map file and commented out what you don’t need for testing. Try it now and see if this works. Also it’s best to have your files organized so it’s easier to read. e.g. placing the { } in a structured manor like below.

sitemap our_home label="Gigablue" {

//    Frame label="Gigablue" icon="groundfloor" 
//      {
//        Group item=Gigablue
//      }

//    Frame 
//      {
//        Text label="Gigablue" icon="rollershutter" 
//        Default item=Gigablue label="Gigablue" 
//      }
        
  
    Frame 
      { 
        Group item=Gigablue
        Setpoint item=Volume_Up label="TV Volume Up"  minValue=0 maxValue=100 step=1
        Slider item=Volume_Down label="TV Volume Down"
      }
    
}
0 Likes

(Wolfifam1) #15

ok I understood that
but unfortunately I have no function

Group Gigablue
/* Gigablue HD Quad */
String  GB_Sendung  "Aktuelle Sendung [%s]"  <projector_benq>   ( Gigablue )	{ http="<[http://root:werder123@192.168.178.22:80/web/getcurrent:3000:REGEX(.*?<e2eventname>(.*?)</e2eventname>.*)]" }
String  GB_Kanal    "Sender [%s]"            <projector_benq>   ( Gigablue )	{ http="<[http://root:werder123@192.168.178.22:80/web/getcurrent:3000:REGEX(.*?<e2servicename>(.*?)</e2servicename>.*)]" }
Switch  GB_sendMute "Mute"  		     <soundvolume_mute>     ( Gigablue )
Dimmer Volume_Up "Volume Up [%d]"  {http=">[ON:GET:http://root:werder123@192.168.178.22:80/web/remotecontrol?command=115]", autoupdate="false"}

From null

0 Likes

(CM6.5 H102) #16

Well, aside from telling you to read the suggested links/doc’s, as others have done, I would start with one item. That can be power ON/OFF, Volume UP/DOWN, whatever but only one item. Once you can control that item, adding the others should be straight forward.

Another tip, when you have something that doesn’t work, supply all the info you have. The logs are full of tips to what the issue may be. Another example from an earlier post shows the log warning, then gives the answer.

No one hear is gonna hold your hand thru every step, so stop posting and start reading.

When you have something to work with, that’s not riddled with syntax errors (because you took the time to read whats needed), post your issue someone will be glad to assist.

BTW: Based on the topic “Enigma2 sitemap” you can mark this solved. After 15 post,:pensive: you now have a sitemap.

0 Likes

(CM6.5 H102) #17

A new Topic, just in time!

1 Like

(Wolfifam1) #18

From null

That works so that’s all ok I would now like to make loud and quiet pure and switch of programs I have so far everything sank

0 Likes

(Wolfifam1) #19

From null

sitemap our_home label="Gigablue" {

   Frame label="Gigablue" icon="groundfloor" 
     {
        Group item=Gigablue
Setpoint item=GB_Volumeup label="TV Volume"  minValue=0 maxValue=100 step=1
        
      }
    
}
rule "GB_Mute"
    when
        Item GB_sendMute received command
    then
        switch(receivedCommand) {
            case ON :  sendHttpGetRequest("http://root:werder123@192.168.178.22:80/web/vol?set=mute")
            case OFF : sendHttpGetRequest("http://root:werder123@192.168.178.22:80/web/vol?set=mute")


rule "GB_Volume"
    when
        Item GB_Down received command
    then
        Setpoint(receivedCommand) {
            case UP :  sendHttpGetRequest("http://root:werder123@192.168.178.22:80/web/vol?set=up")
            case DOWN : sendHttpGetRequest("http://root:werder123@192.168.178.22:80/web/vol?set=down")
}
end

Which mistake do I make I would like to do that loudly and quietly is the wen who yes what am I doing wrong
0 Likes

(CM6.5 H102) #20

The first rule has no end, switch (first rule) and Setpoint (second rule) are not used correctly. Your post ask what mistakes do I make, but no error logs are provided to help diagnose the issue.

Please read

and for rules.

0 Likes

(Jarda Přibyl) #21

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
0 Likes