So in the OH Sitemap definition I get a quick overview how many windows are opened and when I click on it i get the detailed list.
In OH3 I’d go for a label cell:
- component: oh-label-cell
config:
item: gKontakte
title: Fenster
Then I think defining a pop up action where the status of all windows in gKontakte is shown would be the way.
However, I don’t know how to achieve that.
Hi Greg,
thank you very much for your quick reply.
The lights is a another issue I have and your widget example helps a lot.
I have created a labeled cell with a popup action defined:
gLicht is defined: Group:Switch:OR(ON, OFF) gLicht "Lichter an: [(%d)]"
Is there a more elegant way than defining a separate item and process the group gLicht within a rule?
What also would be nice to have a button in the popup “alloff”.
The case were I want to switch all lights on in one go are rare.
Thanks
Marco
Are you using the UI or editing files?
I think if you use both then things don’t work properly.
I use the UI only. I don’t edit any files.
The widgets don’t show real time (or I can’t work out how to do it) but the properties tab is real time and that was the screen shot I posted.
I want to use text files only but it is hard to achieve (reason: Versioning with git). The MQTT things for example only work (at least I couldn’t achieve it) when using the UI.
I got a bit closer
09:04:37.406 [INFO ] [nhab.event.GroupItemStateChangedEvent] - Item ‘gKontakte’ changed from CLOSED to OPEN through Fenster_OG_Buero
09:04:37.408 [INFO ] [nhab.event.GroupItemStateChangedEvent] - Item ‘gKontakteOffen’ changed from CLOSED to OPEN through Fenster_OG_Buero
09:04:40.678 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘Fenster_OG_Buero’ changed from OPEN to CLOSED
Group:Contact::OR(OPEN,CLOSED) someGroup "my label [%d]"
had magical properties. The basic state of the Group would be OPEN or CLOSED, as seen by rules or (usefully) by dynamic icons, but the [%d] state presentation gave a sitemap display of a count of ‘active’ members.
So far as I know this hidden count still exists in OH3, but is not accessible in MainUI. Has anyone fathomed it out?
Don’t count when using this approach for lights. With the OH2 mechanism this was possible, just all light and dimmer items were through into the same group and also an active dimmer item was counted.
Well yes, these have state 0-100 so SUM obviously will give results like 456 while COUNT( >0) just doesn’t work.
You can put Dimmers into Switch flavoured Group, and the OR function will recognise >0 as ON, but that doesn’t help because of the regression losing %d functionality.
COUNT is documented as working with ‘regular expression’. I wonder if is possible to work out what not-“0” would look like. That would mess up with 0.0, but that’s not usually seen in Dimmers.
Not-0 isn’t quite the same as ON, remembering NULL etc. but it’s close.
No.
I had a look around for COUNT expression uses, found this
I could not get Group:Number:COUNT("^[1-9]*$") to work as used there.
I stole a “test for non-zero” expression from somewhere else, tried Group:Number:COUNT("^[1-9]\\d*(?:\\.\\d+)?$")
and that seems to work pretty well. Non-zero dimmers are counted, decimal or integer.
0 NULL or UNDEF are not counted.
Quirk - decimals less than 1 e.g. 0.9 not counted, treated as OFF - do you care? Decimals are rare but allowed in Dimmers.
Don’t ask me how it works or how it could be improved to handle Switch members in the same group, that would be useful.