[SOLVED] Group:Number:AVG not persisted?

Hello,
it does look like my Group:Number:AVG is not persisted by standard rules for some reason.
All “normal” items are persisted when belongs to the group

gStore10

which is persisted every 10minutes

But none of these are:

Group:Number:AVG    House_Pressure      "Avg. Pressure [%.1f hPa]"                  <pressure>      (gStatus, gStore10)
Group:Number:AVG    House_Temperature   "Avg. House Temperature [%.1f °C]"          <temperature>   (gStatus, gStore10)
Group:Number:AVG    House_Humidity      "Avg. House Humidity [%.0f %%]"             <humidity>      (gStatus, gStore10)
Group:Number:AVG    House_Quality       "Avg. House Air [%.1f %%]"                  <carbondioxide> (gStatus, gStore10)
Group:Number:AVG    FF_Temperature      "Avg. First Floor Temperature [%.1f °C]"    <temperature>   (gStatus, gStore10)
Group:Number:AVG    GF_Temperature      "Avg. Ground Floor Temperature [%.1f °C]"   <temperature>   (gStatus, gStore10)
gStore10* : strategy = every10Minutes, restoreOnStartup

Am I doing something wrong?
Thanks

gStore10* means to persist all members of a group named gStore10.
That’s ambiguous when a group is itself a member - here you want the group value, but its equally valid to interpret as all members of the “subgroup”.

I think you must specify each group individually (with no *).

well my thinking was House_Temperature is member of the group gStore10 so it would be stored as well.
So you are suggesting to specify those Group items separately in persistence?
But wouldnt this solution store each value in that average group (which is not wanted)? I would like to store that avg value somehow

Is there any reason why Group which is member of other group is not stored? Eg. This is kind of special group which has got value on top of it, which would be nice to be able to store

I don’t remember the reason but what rossko57 says is the case. The only way to persist the state of a Group Item is to list that Item individually in the .persist file.

so I’ve tried to put AVG group there and nothing.
I mean, I do have stored values which are in that group by having tham in gStore10 anyway, but I wanted to store AVG

Do I really need to compute it again from originals? It does not seem to be right
I can’t draw graph based on Group:Number:AVG then ;/

Please show us your Item definition and your xxx.persist entry for a group that doesn’t work.

Note that you will need to restart openHAB to pick up most persistence configuration changes (due to essentially being version 1.x legacy service)

I’ve tried variation with and without *

Home_Temperature : strategy = every10Minutes
Home_Humidity* : strategy = every10Minutes
gStore10* : strategy = every10Minutes, restoreOnStartup

I don’t think Item definition is somehow important but here it is

Group:Number:AVG    House_Pressure      "Avg. Pressure [%.1f hPa]"                  <pressure>      (gStatus, gStore10)
Group:Number:AVG    House_Temperature   "Avg. House Temperature [%.1f °C]"          <temperature>   (gStatus, gStore10, Outdoor_Indoor_Graph)

members of the AVG group are stored anyway already because of gStore10 membership
for example

Number  Workroom_Temperature "Workroom [%.1f °C]"   <temperature>  (gStore10, FF_Temperature, House_Temperature)     ["CurrentTemperature"]  { channel = "mqtt:topic:Climate_Workroom:temperature" }

I might try one more restart, sure … just to be on the safe side

I don’t see why. You already know that it will not store the group average with a * appended.

because why not as I haven’t have specific group in persistence, just gStore10* before.
Anyway, it’s not storing desired number even after restart sadly.
2.5.1 snap, influx

Works for me. OH2.4, rrd4j

Group:Number:AVG gIntTemps "Internal temp sensors" <thermometer>

rrd4j.persist

    gIntTemps : strategy = everyChange, everyMinute

REST query response

{
  "name": "gIntTemps",
  "datapoints": "5",
  "data": [
    {
      "time": 1564002360000,
      "state": "15.5"
    },

I doubt its a factor that your target group is also still a member of gStore10, where recording of it’s value will be rejected.
But maybe persistence only gives us one bite at the apple - I know it is clever enough to avoid duplicates.
Try removing target from other group (and sadly, once more reboot).

is there a quick way how to check rest api?

You’ll need the name of your persistence service, snap? influx?

influx

do i need to install that rest api something in addons?

Yes. It’s called “REST API Docs”. The actual API is always built in, but the “docs” are the interactive play-with-it utility.

influxdb

Don’t forget the “db” part or it won’t work.

Thinks: what is the name of the .persist file being edited here …

filename is influxdb.persist :wink: and all other persisted items simply works, but not those avg’s

anyway, my rest is taking shit probably
Can’t read swagger JSON from http://10.10.1.5:8080/rest/swagger.json

and… because I’m blind I’ve fixed it by naming those persistence groups correctly as they were Home instead of House … jeez
that dumb feeling

btw it’s not needed to restart OH, it refreshed persistence and worked without restart

We all looked at that and missed it :crazy_face:

That was a momentary bug that appeared somewhere around snapshot build #1638 and was fixed somewhere around build #1640. You just need to upgrade to a newer snapshot.