[SOLVED] Persist group counter/number value

Hi all,
Wondering how to persist (with influxdb i’m running) a numeric value of the group.
So, I have a group All_LIghts and I am able to persist it’s state(ON/OFF), so i can have a graph about wheter light was used or not.
But then I realized it would be nice to have a graph about how many lights were used, as I can see the number of currently active lights in sitemap.
I found on the forum that I can add the group as text item in the sitemap, but I dont need it in sitemap, i need the item I can enable persistence on.
doable?

Create another group withe the same members, but using the COUNT aggregation function.

thanks.
created the group
Group:String:COUNT(“ON”) Count “Count All Lights [(%d)]”
but its value is date - 1970-01-01T00:00:00.000+0000
then when 2 lights is on changes to 1970-01-01T00:00:02.000+0000

how to change this to number, not datetime ?

Since you want a number, the type of the group should be Number… and the State would be ON, not “ON”… and I don’t know where those parenthesis came from…

Group:Number:COUNT(ON) Count “Count All Lights [%d]”

right, thx
parenthesis were in the example documentation

This should be corrected then. Would you please share a link?

its in your link you provided above. I actually tried with changing String to Number but it didnt work because of parenthesis :slight_smile:

this is the example:
Group:String:COUNT(“OFFLINE”) OfflineDevices “Offline Devices [%d]” // e.g. “2”

I think we might be referring to different parenthesis. I was meaning these, which I do not see in the documentation…