I’m kind of new in OpenHAB2 (V2.3) and i have a question/problem.
I would like to show the temperatur of my groups in the BasicUI. For the group with only types of “Number” it’s working. When I mix “Number” and e.g “Switch” in BasicUI if have only “- °C”.
Sitemap
Frame label="Zimmer" icon="groundfloor" {
Group item=Bedroom
Group item=Kids_Bedroom
Group item=Office
Group item=Play_Room
}
With a switch in the “Group Kids_Bedroom” there may be a problem with transformation of [%.1f C].
Have you tried to remove the switch from the group by deleting (Kids_bedroom) from the switch line and just add it to sitemap like Switch item=Kids_Bedroom_Switch?
Frame label="Zimmer" icon="groundfloor" {
Group item=Bedroom
Group item=Kids_Bedroom
Group item=Office
Group item=Play_Room
Switch item=Kids_Bedroom_Switch
}
and items
Number Kids_Bedroom_Temperature "Temperatur" <temperature> (Kids_Bedroom) { channel="mihome:sensor_weather_v1:xyz2:temperature" }
Number Kids_Bedroom_Humidity "Feuchtigkeit" <humidity> (Kids_Bedroom) { channel="mihome:sensor_weather_v1:xyz2:humidity" }
Number Kids_Bedroom_Pressure "Luftdruck" <pressure> (Kids_Bedroom) { channel="mihome:sensor_weather_v1:xyz2:pressure" }
Number Kids_Bedroom_Battery "Batterie" <battery> (Kids_Bedroom) { channel="mihome:sensor_weather_v1:xyz2:batteryLevel" }
Switch Kids_Bedroom_Switch "(Ein / Aus)" { channel="tradfri:0210:gwb8f2bdfgdd2f:65545:color" }
Not being nosy but is there a reason the switch must be in that group? I can see having all temps in a group so they can be averaged, or all switches in a group so all can be turned on/off with one command.
There is nothing to stop you having Items in both of two groups, one for the temperature/number work and one for whatever purpose you need the switch as well.
If you are using the group as a convenience for display in a UI, you’ll probably find like many before you that you will abandon that - it doesn’t give you much control over display order etc.
@rossko57: yes, I thought Groups would be the right thing to build my UI . But in that case I have to rethink it and have to search another approach.
@H102: hmmm… actually I thought it would be nice to have a Group by Room. And then in each Room all that devices as tempsensors, hue lamp, smart power adapter etc.
Groups do give you a quick and easy way to start a UI. There aren’t many quick and easy things in OpenHAB!
It just doesn’t offer the flexibility of display many people eventually require - ordering items, visibility options etc. To get that you have to build your sitemap in the tedious line by line way.
Grouping by room is fairly standard practice. Don’t forget you can do things like have an Item both in a room group and in a sensors group.
thank’s all for your help!! i was somwhow not aware, that i can also “group” text item / switch item e.g. in sitemap. I did it now without groups and it works like a charm.
Text item=Kids_Bedroom_Temperature icon="girl_1" label="Kinderzimmer [%.1f °C]" {
Text item=Kids_Bedroom_Temperature
Text item=Kids_Bedroom_Humidity
Text item=Kids_Bedroom_Pressure
Text item=Kids_Bedroom_Battery
Switch item=Kids_Bedroom_Switch
Default item=Kids_Bedroom_Brightness
Default item=Kids_Bedroom_Lamp
}