[SOLVED] Group:switch:SUM possible

All,

I thought the following SUM would work (show sum of all connected mobile phones).

Group:Switch:SUM G_Mobiles "Mobiltelefone [%d]" <phone>

Actually I am sure that it worked before (on OH1).
Now with OH2 it’s noch working anymore.
Any suggestion?

What happens with Group:Number:SUM ? Not sure if that works with switch members.

I guess this is for Number only (adding power consumption and such!?).
It might be possible that it worked on OH1, but not on OH2 anymore!?

Because in OH1 all the switches were handled like (0/1) and could be stored in rrd4j (and displayed in graphs based on that).
In OH2 switches are just handled like ON / OFF - so this might be the root cause (just a guess)!?

Group:Switch:SUM should only result in ON or OFF
Does Group:Number:SUM not work?

No, that doesn’t work either.
The group’s state is just 1, regardless of the active (online) devices.

Going to have to count 'em in a rule then

Counting them is of course an option, but the previous solution within a group item using SUM was much more straightforward.

I wonder if this function to sum up switches might come back…

I just experimented with Group:Number:SUM in OH 1.8.3, with a group of Switch items. (edit - in fact it was group of groups, the subgroups contain the Switches and are themselves switch-type groups)
This does indeed count the number of Switches that are ON.

Assuming that is intended behaviour (and it does seem a reasonable thing to do) then if that doesn’t work under OH2 it is a regression failure. You should create an issue in Github.

I do not have OH2 to test with.

Thanks for your help and your findings!

I removed all related items and the according group.
Did a restart and created them new.

Now it works as desired!

Again, thanks for your help!

aaargh another case of “ghost” items? Glad it is now working for you.

:smiley:
Thanks