New groups not persisted in influxdb

Platform information:

  • Hardware: Raspberry Pi 3B+
  • OS: Raspbian 9.13
  • Java Runtime Environment: Java™ SE Runtime Environment (build 1.8.0_65-b17)
  • openHAB version: 2.5.10 Release Build

Two groups in items file, old one is E5AveragePriceLocal, added one is IndoorTemperature:

Group:Number:AVG E5AveragePriceLocal "E5 Durchschnitt hier [%.3f €]" <piggybank> (Statistics)
Group:Number:AVG IndoorTemperature "Innentemperatur [%.1f °C]" <temperature_inside> (Statistics)

influxdb.persist:

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

Items {

    DefaultPersistenceRestore*               : strategy = everyMinute, everyChange
    DefaultPersistenceNoRestore*             : strategy = everyMinute, everyChange


    E5AveragePriceLocal                      : strategy = everyMinute, everyChange
    E5AveragePriceNationwide                 : strategy = everyMinute, everyChange
    IndoorTemperature                        : strategy = everyMinute, everyChange
}

Both groups receive frequent updates, and their current value shows up in the basicui. However, even after cache cleaning and reboot, IndoorTemperature does not get written to influxdb. An

log:set TRACE org.openhab.persistence.influxdb

lets me see storing of E5AveragePriceLocal, but nothing whatsoever about IndoorTemperature - no warnings, no errors, nothing.

I’m quite puzzled as to why IndoorTemperature does not get persisted, but another group does. Any ideas?

Rolf

Given they are being persisted using the same strategies, what if you copy the two Groups that are not work to the line that is working?

E5AveragePriceNationwide, E5AveragePriceLocal, IndoorTemperature: strategy = ....

There are rare occasions where somehow unprintable characters sneak into these files causing all sorts of problems.

Also watch events.log to verify that IndoorTemperature is receiving updates for sure.

Finally, are any of the members of IndoorTemperature of type Number:Temperature? Are any NULL or UNDEF?

Rich,

Thanks, these were really good ideas that I tried out:

  • Putting it all groups in one line didn’t change anything (I even re-typed the whole influxdb.persist, to exclude weird characters, as a possibility)
  • Same with changing group members to Number:Temperature (and back)
  • The temperatures haven’t been NULL or UNDEF for the past 14 days (according to the database)

However, I suddenly remembered that E5AveragePriceLocal was a normal, persistent item, a long time ago, that I updated via a rule, according to some calculations. I only changed it to a group a few days later. That’s the only difference. Could that be an issue? I wonder why it still gets updated.

I wouldn’t rely on the database to confirm whether or not an Item is NULL or UNDEF. There is a lot of stuff between the Item and the database. And NULL and UNDEF don’t get saved to the database. Look at the Item on your sitemap, or through the REST API or the Karaf console to confirm it’s current state.

There are sometimes cases where the Group’s aggregation function fails when one or more of the members are NULL or UNDEF.

If you confirm that the Items are not NULL and the Group’s state is updating/changing all I can offer is to have you file an issue on github. I’ve no other ideas.

If you recycle an Item name that was previously persisted, the persistence service does not have the wit to go and delete old db table and make new table for a different kind of Item.