On the sitemap I can use this item as a switch and as group. I have seen some screenshots, where ppl display the number of members in the group, e.g. https://community.openhab.org/t/group-contact-vs-group-switch/12763. How to do this? (Besides I learned some Java in my apprenticeship, my Java-knowledge is nearly gone after 15 years and I bearly understand Java formatter class )
sitemap:
Switch item=gBM_Light_WZ icon=light
Group item=gBM_Light_WZ
rule "Garage"
when
Item gNetGarage received update
then
var Number numOnline = gNetGarage.members.filter(s | s.state == ON).size
var Number numAll = gNetGarage.members.size
var String retVal = numOnline.intValue + "/" + numAll.intValue
net_garage.postUpdate(retVal)
end
garage.sitemap:
sitemap garage label="Garage"
{
Frame {
Text item=net_garage {
Text item=net_garage_router
Text item=net_garage_server
Text item=net_garage_computer
}
}
}
Now it is working for me as described in the first post.
I did a second install of openHAB2 (this time on windows, the other one is openhabian on a RPi3), used the demo package. This uses the same code as I did in #1demo.items and demo.sitemap
Two things were faulty:
My Lightify Plug connect to Hue Bridge sometimes gets status NULL instead of ON or OFF - this gets the whole group gBM-Light-WZ faulty.
items and their state seem to stay in memory or something, so altering my item files did not change everything: I did remove the Lightify Plug item and it still did not work - only full restart of openHAB clears cache/memory
I’m sorry, but I probably do not understand how to help you, perhaps I do not understand correctly, it is very bad English I (or rather from Google translator ha ha ha)