Average of open sensors in sitemap


I can easly taken an average of numbers (fe lux, temperature…) with sitemaps.

Group:Number:AVG ALL_hel “Helderheid [%.1f Lux]”
Group:Number:AVG ALL_tem “Temperatuur [%.1f C]”

Is there a way that I can do the same with open/close status of all my windows?
Fe I would like to have to have a global status that’s telling me how many things are open (fe 2).

Group:Number:AVG ALL_con “Open/Dicht”

You simply have to use a contact Group:

Group:Contact:OR(OPEN, CLOSED) ALL_con "Number of open contacts [%d]"

This will count OPEN contacts. If you wish to count CLOSED contacts, you would have to change the order in the brackets. This group will state OPEN, if any Contact in the group is OPEN.

Is working great this way.
I’m seeing how many devices are open, and when I click it, a nice list of them all…


Group:Contact:OR(OPEN, CLOSED) ALL_con “Deuren/Vensters [%d open]”

Contact Deur_Bureau “Bureau Deur [%s]” (ALL_con,AT_con) { zwave=“8:command=SENSOR_BINARY,sensor_type=10,respond_to_basic=true” }

Contact Deur_Hal “Hal Achterdeur [%s]” (ALL_con,WO_con) { zwave=“5:command=sensor_binary,parameter=10,respond_to_basic=true” }


Text item=ALL_con {

Frame {

Text item=Deur_Inkom
Text item=Venster_Bibliotheek
Text item=Venster_Keuken
Text item=Venster_L_Leefruimte


Even more… I use this snippet:

Group item=GLights icon="switch" {
            Switch item=GLights mappings=[OFF="Off"]
            Slider item=Light_FF_Parents_Planets    visibility=[Light_FF_Parents_Planets!=0]        sendFrequency=400 switchSupport
            Slider item=Light_FF_Parents_Stars        visibility=[Light_FF_Parents_Stars!=0]            sendFrequency=400 switchSupport
            Switch item=Light_FF_Balkon                visibility=[Light_FF_Balkon=="ON"] 

The superior item shows the number of Lights switched ON, when clicking this item, it will render only light items, that are not OFF, plus a button to switch them all OFF at once :slight_smile:

1 Like

I see.
But in my case, we’re just talking about door/window sensors.
So not really a possibility to close them through openhab. (Yet :wink: )

No, but to only show the open ones :slight_smile: would shorten the list…