Graph a group item in grafana?

Strategies {
    everyHour   : "0 0 * * * ?"
    everyDay    : "0 0 0 * * ?"

    default = everyChange
}

Items {
// persist all members of gInfluxDB Group on: everyChange, everyHour, everyDay
    gInfluxDB*,gSpeedtest*,gSpotify*  : strategy = everyChange, everyHour, everyDay
    gPowerUsage*,gPowerConsumption*   : strategy = everyChange, everyHour, everyDay
    gPowerUsage : strategy = everyChange, everyHour, everyDay
    * : strategy = restoreOnStartup
}```

PS: you don’t need the everyday if you are already doing the everyhour…

1 Like

True :slight_smile:

So do you have the gPowerUsage item in Grafana?

Groups dont display, only the individual items @psyciknz

It looks like none of your items are attached to groups. It should be like this.

Number LivingRoomNum2 "Living Room - Usage [%.1f kW]" (gPowerUsage)                                     { channel="zwave:device:d4900ba9:node2:meter_kwh" }

and the group should be like this

Group:Number:SUM gPowerUsage
1 Like

In Grafana you could use a bar chart and then stack the values. this would then show you the individual values and the sum at the same time.

this is a temperature chart so it doesn’t make sense to do that, but it shows the options

Thanks Dan ill try that!

Hi David, ill see how Dans suggestion goes failing that, ill try the bar chart

@dastrix80, just a quick FYI, it will only start tracking the group totals after you make the changes. But this should get it going from that point on. You may want to read up on groups as they are very helpful in processing. There are two areas that come to mind full of information.

Official Group Documentation

and

Design Patterns: Group Based Persistence

Also, if you’re like me and have devices with multi-channels, they may have an energy consumption for the whole device and each individual channel. You don’t want to put both in the group or you will double your consumption for that device. I personally use the individual channels for more precise reporting.

I use @david method as well, depending on what I want to do.

Influx hasn’t updated yet with the group i defined as a selectable graphing item

/* Group Definitions
Group gPowerConsumption
Group:Number:SUM gPowerUsage

/* Reset ZWave Usage
switch LivingRoomReset  { channel="zwave:device:d4900ba9:node2:meter_reset" }
switch KitchenReset     { channel="zwave:device:d4900ba9:node4:meter_reset" }

/* ZWave Switches*/
Switch LivingRoomSw1  "Living Room"                                                       { channel="zwave:device:d4900ba9:node2:switch_dimmer1" }
Dimmer LivingRoomDim1 "Living Room [%d %%]"                                               { channel="zwave:device:d4900ba9:node2:switch_dimmer1" }
Number LivingRoomNum1 "Living Room - Current Consumption [%.1f W]"                        { channel="zwave:device:d4900ba9:node2:meter_watts" }
Number LivingRoomNum2 "Living Room - Usage [%.1f kW]" (gPowerUsage)                       { channel="zwave:device:d4900ba9:node2:meter_kwh" }

Switch KitchenSw1 "Kitchen"                                                               { channel="zwave:device:d4900ba9:node4:switch_dimmer1" }
Dimmer KitchenDim1 "Kitchen [%d %%]"                                                      { channel="zwave:device:d4900ba9:node4:switch_dimmer1" }
Number KitchenNum1 "Kitchen - Current Consumption [%.1f W]"                               { channel="zwave:device:d4900ba9:node4:meter_watts" }
Number KitchenNum2 "Kitchen - Usage [%.1f kW]" (gPowerUsage)                              { channel="zwave:device:d4900ba9:node4:meter_kwh" }

And my persistance file


Strategies {
    everyHour   : "0 0 * * * ?"
    everyDay    : "0 0 0 * * ?"

    default = everyChange
}

Items {
// persist all members of gInfluxDB Group on: everyChange, everyHour, everyDay
    gInfluxDB*,gSpeedtest*,gSpotify*  : strategy = everyChange, everyHour, everyDay
    gPowerUsage*,gPowerConsumption*   : strategy = everyChange, everyHour, everyDay
    * : strategy = restoreOnStartup
}

/* Group Definitions
Group gPowerConsumption
Group:Number:SUM gPowerUsage

/* Reset ZWave Usage
switch LivingRoomReset  { channel="zwave:device:d4900ba9:node2:meter_reset" }
switch KitchenReset     { channel="zwave:device:d4900ba9:node4:meter_reset" }

/* ZWave Switches*/

These are all commented out
You need to add */ at the end of your title lines

1 Like

Thanks Vincent :slight_smile: Seems i need to learn to comment. Ive made the change and will see if the Groups are not present in Grafana when some data is visible.

To comment 1 line use // at the beginning of the line

To comment a block use /* at the beginning and */ at the end.

1 Like

Now that the items definition are uncommented, the items are created (live) so it should work
Did you modify the persistence file as I suggested?

gGroup* for the group members
and
gGroup for the group itself

I have this:



Strategies {
    everyHour   : "0 0 * * * ?"
    everyDay    : "0 0 0 * * ?"

    default = everyChange
}

Items {
// persist all members of gInfluxDB Group on: everyChange, everyHour, everyDay
    gInfluxDB*,gSpeedtest*,gSpotify*  : strategy = everyChange, everyHour, everyDay
    gPowerUsage*,gPowerConsumption*   : strategy = everyChange, everyHour, everyDay
    * : strategy = restoreOnStartup
}

Add this line:

    gPowerUsage,gPowerConsumption   : strategy = everyChange, everyHour, everyDay

Roger!


Strategies {
    everyHour   : "0 0 * * * ?"
    everyDay    : "0 0 0 * * ?"

    default = everyChange
}

Items {
// persist all members of gInfluxDB Group on: everyChange, everyHour, everyDay
    gInfluxDB*,gSpeedtest*,gSpotify*  : strategy = everyChange, everyHour, everyDay
    gPowerUsage*,gPowerConsumption*   : strategy = everyChange, everyHour, everyDay
    gPowerUsage : strategy = everyChange, everyHour, EveryDay
    * : strategy = restoreOnStartup
}

Is that influxdb?

Use mapdb for restore on startup instead
It only stores the last value so doesn’t grow in size
This way you can restrict you storage in inlux to the stuff you really want to store over time

Yes, its influx.

I just want to have the gPowerUsage graphed for the month, so I think I need Influx. I dont need gPowerConsumption

Yes you need influx but think about what you want to store overtime and build your persistence file and groups accoringly

For example I have a group called Persist
And I persist all the items in the group (including groups…)

All my items go in mapdb for the restore on startup