How to draw average graph


it is possible to draw a graph of the calculated average values of a group like this:

Group:Number:AVG gKeller_Temp "Temperatur Durchschnitt [%.2f °C]" <temperature> (All)

How do i do this?


You would have to persist the group itself, so use

gKeller_Temp : everyChange, everyMinute

as persistence strategy.

I tried this already.

The item is gKeller_Temp and as chart it draws all group members in one chart. This is pefect.
Now i want a different chart with only the calculated average.

Argh… that’s correct… You’ll have to copy the group state to another (proxy) item. just define an item:

Number aKeller_Temp

and a rule to update:

rule "update aKeller_Temp"
    Item gKeller_Temp changed
    aKeller_Temp.postUpdate(gKeller_Temp as DecimalType)

and persist the proxy item.


casting GroupItem to DecimalType does not work. I think tried also this a while ago :wink:

Error during the execution of rule 'update aKeller_Temp': Cannot cast org.openhab.core.items.GroupItem to org.openhab.core.library.types.DecimalType

OK, i get it.

The update function has to be:
aKeller_Temp.postUpdate(gKeller_Temp.state as DecimalType)

1 Like

Argh… yes, missed the .state …