Termineo
(Rainer)
October 8, 2019, 12:35pm
1
Platform information:
Hardware: _Raspberry Pi 3
OS: openHABian 2.4.0
KNX Binding
Hello,
I think I have a very beginner question - but I don’t know how to do it correct. I’m very new in programming with openHAB. I already searched in other Topics but didn’t find an answer.
My configuration has three Switch elements on the sitemap to move my rollershutters in position:
Switch item=GF_LivingRoom_ShutterLeftPosition mappings=[25="25%", 50="50%", 75="75%"]
Switch item=GF_LivingRoom_ShutterMiddlePosition mappings=[25="25%", 50="50%", 75="75%"]
Switch item=GF_LivingRoom_ShutterRightPosition mappings=[25="25%", 50="50%", 75="75%"]
The items for the three are defined e.g. like this:
Number GF_LivingRoom_ShutterRightPosition "Rolladen rechts - Höhe anfahren" <rollershutter> (GF_LivingRoom, gShutter) ["Rollershutter"] {channel=""}
That the boxes of the Switch are unchecked after every click of the button, I made this rule:
rule "Rolladen Position anfahren"
when
Item GF_LivingRoom_ShutterLeftPosition received update or
Item GF_LivingRoom_ShutterMiddlePosition received update or
Item GF_LivingRoom_ShutterRightPosition received update
then
if(GF_LivingRoom_ShutterLeftPosition.state != NULL)
{
GF_LivingRoom_ShutterLeft.sendCommand(GF_LivingRoom_ShutterLeftPosition.state)
GF_LivingRoom_ShutterLeftPosition.state = NULL
}
if(GF_LivingRoom_ShutterMiddlePosition.state != NULL)
{
GF_LivingRoom_ShutterMiddle.sendCommand(GF_LivingRoom_ShutterMiddlePosition.state)
GF_LivingRoom_ShutterMiddlePosition.state = NULL
}
if(GF_LivingRoom_ShutterRightPosition.state != NULL)
{
GF_LivingRoom_ShutterRight.sendCommand(GF_LivingRoom_ShutterRightPosition.state)
GF_LivingRoom_ShutterRightPosition.state = NULL
}
end
My problem now is: Everything works fine but in the sitemap I always get the percentage of the item (marked yellow):
Can somebody explain why I get the %-value and is it possible to make it invisible?
Thanks in advance.
Rainer
What does your sitemap file look like?
Termineo
(Rainer)
October 8, 2019, 12:39pm
3
Here you can se an extract of the sitemap file:
Text label="Wohnzimmer" icon="sofa" {
Frame label="Licht" icon="light" {
Slider item=GF_LivingRoom_Light
}
Frame label="Steckdosen" icon="poweroutlet" {
Switch item=GF_LivingRoom_Power_TVRightLeft
Switch item=GF_LivingRoom_Power_TVRightRight
Switch item=GF_LivingRoom_Power_VitrineLeftLeft
Switch item=GF_LivingRoom_Power_VitrineLeftRight
Switch item=GF_LivingRoom_Power_TVMiddleMiddle
Switch item=GF_LivingRoom_Power_TVMiddleRight
Switch item=GF_LivingRoom_Power_VitrineMiddle
Switch item=GF_LivingRoom_Power_VitrineRight
Switch item=GF_LivingRoom_Power_Fensterfront_Vit
Switch item=GF_LivingRoom_Power_Fensterf_Freis
}
Frame label="Rolladen" icon="rollershutter" {
//Alle Rolläden
Switch item=GF_LivingRoom_ShutterAll
//Rolladen links
Switch item=GF_LivingRoom_ShutterLeft
Switch item=GF_LivingRoom_ShutterLeftPosition mappings=[25="25%", 50="50%", 75="75%"]
//Rolladen Mitte
Switch item=GF_LivingRoom_ShutterMiddle
Switch item=GF_LivingRoom_ShutterMiddlePosition mappings=[25="25%", 50="50%", 75="75%"]
//Rolladen rechts
Switch item=GF_LivingRoom_ShutterRight
Switch item=GF_LivingRoom_ShutterRightPosition mappings=[25="25%", 50="50%", 75="75%"]
}
Frame label="Heizungssteuerung" icon="flow" {
Default item=GF_LivingRoom_Temperature
Default item=GF_LivingRoom_SollTemperature //minValue=4.5 maxValue=30 step=0.5
Selection item=GF_LivingRoom_SollVerschTemperature mappings=[-3="-3°C", -2.5="-2.5°C", -2="-2°C", -1.5="-1.5°C", -1="-1°C", -0.5="-0.5°C", 0="keine", 0.5="+0.5°C", 1="+1°C", 1.5="+1.5°C", 2="+2°C", 2.5="+2.5°C", 3="+3°C"]
Selection item=GF_LivingRoom_Heating mappings=[1="Komfort", 2="Standby", 3="Nacht", 4="Frostschutz"]
Default item=GF_LivingRoom_Window
Text item=GF_LivingRoom_StatusStellwert
}
}
vzorglub
(Vincent Regaud)
October 8, 2019, 12:40pm
4
Add "[]"
as the label in the sitemap element:
Switch item=GF_LivingRoom_ShutterLeftPosition "[]" mappings=[25="25%", 50="50%", 75="75%"]
Switch item=GF_LivingRoom_ShutterMiddlePosition "[]" mappings=[25="25%", 50="50%", 75="75%"]
Switch item=GF_LivingRoom_ShutterRightPosition "[]" mappings=[25="25%", 50="50%", 75="75%"]
vzorglub
(Vincent Regaud)
October 8, 2019, 12:42pm
5
Also,
Why do you do that?
GF_LivingRoom_ShutterLeftPosition.state = NULL
For what purpose?
Termineo
(Rainer)
October 8, 2019, 12:47pm
6
Thank you for the reply.
I found no other way to uncheck the 25%, 50% and 75% buttons after clicking them.
vzorglub:
Switch item=GF_LivingRoom_ShutterLeftPosition "[]" mappings=[25="25%", 50="50%", 75="75%"]
Switch item=GF_LivingRoom_ShutterMiddlePosition "[]" mappings=[25="25%", 50="50%", 75="75%"]
Switch item=GF_LivingRoom_ShutterRightPosition "[]" mappings=[25="25%", 50="50%", 75="75%"]
When I do that on the sitemap the console says:
14:41:29.106 [WARN ] [del.core.internal.ModelRepositoryImpl] - Configuration model "myhouse.sitemap' has errors, therefore ignoring it: [52,63]: mismatched input '"[]"' expecting '}'
[55,65]: mismatched input '"[]"' expecting '}'
[58,64]: mismatched input '"[]"' expecting '}'
[60,13]: missing EOF at 'Frame'
vzorglub
(Vincent Regaud)
October 8, 2019, 12:51pm
7
My apologies:
Switch item=GF_LivingRoom_ShutterLeftPosition label="[]" mappings=[25="25%", 50="50%", 75="75%"]
Switch item=GF_LivingRoom_ShutterMiddlePosition label="[]" mappings=[25="25%", 50="50%", 75="75%"]
Switch item=GF_LivingRoom_ShutterRightPosition label="[]" mappings=[25="25%", 50="50%", 75="75%"]
vzorglub
(Vincent Regaud)
October 8, 2019, 12:53pm
8
GF_LivingRoom_ShutterLeftPosition.state = NULL
This would be a more correct syntax:
GF_LivingRoom_ShutterLeftPosition.postUpdate(NULL)
Why use Item type Switch
instead of type Rollershutter
?
Termineo
(Rainer)
October 8, 2019, 1:10pm
10
Because of historical reasons. Before I had the rule I used the KNX-Binding to move to the position directly with an own item instead of using the item.sendCommand() of the already existing rollershutter item.
But you’re right - now that I use .sendCommand() I can change it back to type ‘Rollershutter’.
1 Like
Termineo
(Rainer)
October 8, 2019, 1:17pm
11
vzorglub:
My apologies:
Switch item=GF_LivingRoom_ShutterLeftPosition label="[]" mappings=[25="25%", 50="50%", 75="75%"]
Switch item=GF_LivingRoom_ShutterMiddlePosition label="[]" mappings=[25="25%", 50="50%", 75="75%"]
Switch item=GF_LivingRoom_ShutterRightPosition label="[]" mappings=[25="25%", 50="50%", 75="75%"]
Thank you! That worked for me. Perfect
I now only have the problem that the alignment of all objects is different:
Is it possible to harmonize them?
rossko57
(Rossko57)
October 8, 2019, 1:59pm
13
I’m surprised you get any label text at all with sitemap label="[]"
You could give the label text in the sitemap, or put the null state formatter in your Item label and take away the sitemap parameter.
2 Likes
vzorglub
(Vincent Regaud)
October 8, 2019, 3:04pm
14
What about defining the label in the sitemap?
Switch item=GF_LivingRoom_ShutterLeftPosition label="Rolladen links - Hohe anfahren []" mappings=[25="25%", 50="50%", 75="75%"]
Sorry I don’t have the same characters
2 Likes
Another thing: You don’t need to postUpdate(NULL) to the Item Instead set the Item to autoupdate=“false”
Number GF_LivingRoom_ShutterRightPosition "Rolladen rechts - Höhe anfahren" <rollershutter> (GF_LivingRoom, gShutter) ["Rollershutter"] { channel="", autoupdate="false" }
This way the Item will not change its status when sending a command.
But in fact there is no reason for this rule and the proxy items.
1 Like