Items are stored in InfluxDB, but are not present in any persist file, are also not persisted via rule

I noticed that some items are stored in my InfluxDB, but these items are not listed in any persist file. I use InfluxDB (version 1.x) as default DB. Furthermore there are 2 perist files: influxdb.persist and mapdb.persist. There are also no rules where the items are persisted. I don’t see any need to store these items at all.

Where does this behaviour come from? Can someone explain it?

OH 3.4.3
InfluxDB 1.8
Java: 11

image

What’s in those two .persist files? If you have a line in the second section that starts with * that means “all Items”.

influxdb.persist

Strategies {
   everyMinute    : "0 * * * * ?"
   every5Minute   : "0 0/5 * * * ?"
   every15Minutes : "0 0/15 * * * ?"
   everyHour      : "0 0 * * * ?"
   everyDay       : "0 0 0 * * ?"
   default = everyChange
}

Items {
  AMIS1_180EnergieA                                 : strategy = everyMinute, restoreOnStartup
  AMIS_Stromzaehler_kWh                             : strategy = everyChange, restoreOnStartup
  AMIS_Stromzaehler_Verbrauch_Tag_persist           : strategy = everyChange, restoreOnStartup
  AMIS_Stromzaehler_15min                           : strategy = everyChange, restoreOnStartup
  AMIS_StromVerbrauchStunde                         : strategy = everyChange, restoreOnStartup
  Aussenbereich_Taupunkt                            : strategy = everyChange, restoreOnStartup
  Aussenbereich_absFeuchte                          : strategy = everyChange, restoreOnStartup
  BUDERUS_aktuelleVorlauftemperatur            : strategy = everyChange, restoreOnStartup
  BUDERUS_aktuelleWarmwasserTemp                  : strategy = everyChange, restoreOnStartup
  BUDERUS_PumpeModulation                            : strategy = everyChange, restoreOnStartup
  BUDERUS_BrennerleistungModulation              : strategy = everyChange, restoreOnStartup
  BUDERUS_Aussentemperatur                       : strategy = every5Minute, restoreOnStartup
  BUDERUS_aktuelleRaumtemperatur                  : strategy = every5Minute, restoreOnStartup
  BUDERUS_SollwertRaumtemperaturbisEndedesTages          : strategy = every5Minute, restoreOnStartup
  BUDERUS_TemperaturniveauHeizen            : strategy = every5Minute, restoreOnStartup
  BUDERUS_Absenktemperatur            : strategy = every5Minute, restoreOnStartup
  BUDERUS_Heizenaktiviert                                 : strategy = everyChange, restoreOnStartup
  BUDERUS_Heizenaktiv                                 : strategy = everyChange, restoreOnStartup
  BUDERUS_Zundung                                 : strategy = everyChange, restoreOnStartup
  BUDERUS_Gas                                 : strategy = everyChange, restoreOnStartup
  BUDERUS_WarmwasseraktivDHW                      : strategy = everyChange, restoreOnStartup
  BUDERUS_Warmwasseraktiv                       : strategy = everyChange, restoreOnStartup
  BUDERUS_SollwertVorlauftemperatur             : strategy = everyChange, restoreOnStartup
  BUDERUS_Heizungspumpe             : strategy = everyChange, restoreOnStartup
  BUDERUS_Geblase             : strategy = everyChange, restoreOnStartup
  Gaszaehler_GaszahlerVerbrauch                     : strategy = everyChange, restoreOnStartup
  GaszaehlerVerbrauchStunde                         : strategy = everyChange, restoreOnStartup
  GaszaehlerVerbrauchTag                            : strategy = everyChange, restoreOnStartup
  Gaszaehler_Impuls                               : strategy = everyUpdate, restoreOnStartup
  Keller_absFeuchte                                 : strategy = everyChange, restoreOnStartup
  Keller_Taupunkt                                   : strategy = everyChange, restoreOnStartup
  LaCrosseSensor1_Luftfeuchtigkeit                  : strategy = every5Minute, restoreOnStartup
  LaCrosseSensor1_Temperatur                        : strategy = every5Minute, restoreOnStartup
  LaCrosseSensor2_Luftfeuchtigkeit                  : strategy = every5Minute, restoreOnStartup
  LaCrosseSensor2_Temperatur                        : strategy = every5Minute, restoreOnStartup
  LaCrosseSensor3_Luftfeuchtigkeit                  : strategy = every5Minute, restoreOnStartup
  LaCrosseSensor3_Temperatur                        : strategy = every5Minute, restoreOnStartup
  LaCrosseSensor4_Luftfeuchtigkeit                  : strategy = every5Minute, restoreOnStartup
  LaCrosseSensor4_Temperatur                        : strategy = every5Minute, restoreOnStartup
  LaCrosseSensor5_Luftfeuchtigkeit                  : strategy = every5Minute, restoreOnStartup
  LaCrosseSensor5_Temperatur                        : strategy = every5Minute, restoreOnStartup
  LaCrosseSensor6_Luftfeuchtigkeit                  : strategy = every5Minute, restoreOnStartup
  LaCrosseSensor6_Temperatur                        : strategy = every5Minute, restoreOnStartup
  LaCrosseSensor7_Luftfeuchtigkeit                  : strategy = every5Minute, restoreOnStartup
  LaCrosseSensor7_Temperatur                        : strategy = every5Minute, restoreOnStartup
  LaCrosseSensor8_Luftfeuchtigkeit                  : strategy = every5Minute, restoreOnStartup
  LaCrosseSensor8_Temperatur                        : strategy = every5Minute, restoreOnStartup
  OWM_WB_Druck                                      : strategy = every5Minute, restoreOnStartup
  OWM_WB_Luftfeuchtigkeit                           : strategy = every5Minute, restoreOnStartup
  OWM_WB_Temperatur                                 : strategy = every5Minute, restoreOnStartup
  Petrosilius_bme280_Temperatur                     : strategy = everyChange, restoreOnStartup
  Petrosilius_bme280_Druck                          : strategy = everyChange, restoreOnStartup
  Petrosilius_bme280_Luftfeuchtigkeit               : strategy = everyChange, restoreOnStartup
  Philips_SML002_BWM_001_Temp_Temperatur            : strategy = everyChange, restoreOnStartup
  Philips_SML002_BWM_001_Presence                   : strategy = everyChange, restoreOnStartup
  Philips_SML002_BWM_001_LightSensor_LuxIlluminance : strategy = everyChange, restoreOnStartup
  Philips_SML002_BWM_002_Temp_Temperatur            : strategy = everyChange, restoreOnStartup
  Philips_SML002_BWM_002_Presence                   : strategy = everyChange, restoreOnStartup
  Philips_SML002_BWM_002_LightSensor_Illuminance    : strategy = everyChange, restoreOnStartup
  Rtl_433_ch1_Luftfeuchtigkeit                      : strategy = every15Minutes, restoreOnStartup
  Rtl_433_ch1_Temperatur                            : strategy = everyChange, restoreOnStartup
  Rtl_433_ch2_Luftfeuchtigkeit                      : strategy = every15Minutes, restoreOnStartup
  Rtl_433_ch2_Temperatur                            : strategy = everyChange, restoreOnStartup
  TuYa_TS0201_01_Luftfeuchtigkeit                     : strategy = everyChange, restoreOnStartup
  TuYa_TS0201_01_Temperatur                           : strategy = everyChange, restoreOnStartup
  Xiaomi_GZCGQ01LM_Helligkeit_01_Illuminance : strategy = everyChange, restoreOnStartup
  Xiaomi_GZCGQ01LM_Helligkeit_01_IlluminanceLux : strategy = everyChange, restoreOnStartup
  Xiaomi_RTCGQ11LM_BWM_01_Illuminance                    : strategy = everyChange, restoreOnStartup
  Xiaomi_RTCGQ11LM_BWM_01_IlluminanceLux                 : strategy = everyChange, restoreOnStartup
  vXiaomi_RTCGQ11LM_BWM_01_Occupancy_Number              : strategy = everyChange, restoreOnStartup
  Xiaomi_WSDCGQ11LM_Temp_Hum_Pres_01_Druck               : strategy = everyChange, restoreOnStartup
  Xiaomi_WSDCGQ11LM_Temp_Hum_Pres_01_Luftfeuchtigkeit    : strategy = everyChange, restoreOnStartup
  Xiaomi_WSDCGQ11LM_Temp_Hum_Pres_01_Temperatur          : strategy = everyChange, restoreOnStartup
  ZWaveNode10_WindowDoor_Contact                    : strategy = everyChange, restoreOnStartup
  ZWaveNode14_Luftfeuchtigkeit                      : strategy = everyChange, restoreOnStartup
  ZWaveNode14_Temperatur                            : strategy = everyChange, restoreOnStartup
  ZWaveNode15_FussbodenHeizungEGbeiHaustuer         : strategy = everyChange, restoreOnStartup
  ZWaveNode15_WandheizungWohnzimmer                   : strategy = everyChange, restoreOnStartup
  ZWaveNode17_ZMNHADFlush1Relay_SwitchBinary         : strategy = everyChange, restoreOnStartup
  ZWaveNode17_ZMNHADFlush1Relay_SwitchBinary_Proxy   : strategy = everyChange, restoreOnStartup
  ZWaveNode2_PowerNode_ElectricMeterkWh             : strategy = every15Minutes, restoreOnStartup
  ZWaveNode2_PowerNode_ElectricMeterkwH_Day         : strategy = everyUpdate, restoreOnStartup
  ZWaveNode2_Switch_greenWAVE                       : strategy = everyChange, restoreOnStartup
  }

mapddb.persist

Strategies {
   everyMinute    : "0 * * * * ?"
   every5Minute   : "0 0/5 * * * ?"
   every15Minutes : "0 0/15 * * * ?"
   everyHour      : "0 0 * * * ?"
   everyDay       : "0 0 0 * * ?"
   default = restoreOnStartup
}

Items {
  AbsFeuchte_Differenz                        : strategy = everyChange, restoreOnStartup
  Chromecast_Audio1_RadioStation              : strategy = everyChange, restoreOnStartup
  Chromecast_Audio1_Lautstaerke               : strategy = everyChange, restoreOnStartup
  Chromecast_Audio2_RadioStation              : strategy = everyChange, restoreOnStartup
  Chromecast_Audio3_RadioStation              : strategy = everyChange, restoreOnStartup
  Chromecast_Audiogruppe_EG1_RadioStation     : strategy = everyChange, restoreOnStartup
  Chromecast_TV2_Lautstaerke                  : strategy = everyChange, restoreOnStartup
  Dehumitification_Bottom                     : strategy = everyChange, restoreOnStartup
  Dehumitification_Top                        : strategy = everyChange, restoreOnStartup
  Entfeuchter_Kosten_Euro                     : strategy = everyChange, restoreOnStartup
  Keller_Ventilation_Interval                 : strategy = everyChange, restoreOnStartup
  Keller_absHumid_Gap_Min                     : strategy = everyChange, restoreOnStartup
  Keller_Temperatur_Min                       : strategy = everyChange, restoreOnStartup
  LueftungsprogrammSchalter                   : strategy = everyChange, restoreOnStartup
  SchwellwertWintergartenlueftung             : strategy = everyChange, restoreOnStartup
  Sonoff3                                     : strategy = everyChange, restoreOnStartup
  Sonoff3_Online                              : strategy = everyChange, restoreOnStartup
  Sonoff4_Online                              : strategy = everyChange, restoreOnStartup
  vChromecastVisibility_Audiogruppe_EG1       : strategy = everyChange, restoreOnStartup
  vLaCrosseSensor1_Online                     : strategy = everyChange, restoreOnStartup
  vLaCrosseSensor2_Online                     : strategy = everyChange, restoreOnStartup
  vLaCrosseSensor3_Online                     : strategy = everyChange, restoreOnStartup
  vLaCrosseSensor4_Online                     : strategy = everyChange, restoreOnStartup
  vLaCrosseSensor5_Online                     : strategy = everyChange, restoreOnStartup
  vLaCrosseSensor6_Online                     : strategy = everyChange, restoreOnStartup
  vLaCrosseSensor7_Online                     : strategy = everyChange, restoreOnStartup
  vLaCrosseSensor8_Online                     : strategy = everyChange, restoreOnStartup
  LaCrosseSensor1_Batterie_Niedrig            : strategy = everyChange, restoreOnStartup
  LaCrosseSensor2_Batterie_Niedrig            : strategy = everyChange, restoreOnStartup
  LaCrosseSensor3_Batterie_Niedrig            : strategy = everyChange, restoreOnStartup
  LaCrosseSensor4_Batterie_Niedrig            : strategy = everyChange, restoreOnStartup
  LaCrosseSensor5_Batterie_Niedrig            : strategy = everyChange, restoreOnStartup
  LaCrosseSensor6_Batterie_Niedrig            : strategy = everyChange, restoreOnStartup
  LaCrosseSensor7_Batterie_Niedrig            : strategy = everyChange, restoreOnStartup
  LaCrosseSensor8_Batterie_Niedrig            : strategy = everyChange, restoreOnStartup
  vWeihnachstbeleuchtungsregelSwitch          : strategy = everyChange, restoreOnStartup
  WintergartenlueftungSchalter                : strategy = everyChange, restoreOnStartup
  ZWaveNode2_PowerNode_ElectricMeterkwH_Month : strategy = everyChange, restoreOnStartup
  ZWaveNode2_PowerNode_ElectricMeterkWhSum    : strategy = everyChange, restoreOnStartup
  ZWaveNode3_Gartentor_Switch                 : strategy = everyChange, restoreOnStartup
  ZWaveNode3_Gartentor_Switch_Proxy           : strategy = everyChange, restoreOnStartup
  ZWaveNode10_WindowDoor_Contact              : strategy = everyChange, restoreOnStartup
  ZWaveNode10_WindowDoor_Batterie_Prozent     : strategy = everyChange, restoreOnStartup
  ZWaveNode11_Steckdose_Automatik             : strategy = everyChange, restoreOnStartup
  ZWaveNode11_Switch_NEOCoolcam               : strategy = everyChange, restoreOnStartup
  ZWaveNode020_NASDS01Z_DoorWindowSensor_Contact  : strategy = everyChange, restoreOnStartup
  ZWaveNode020_NASDS01Z_DoorWindowSensor_Batterie_Prozent : strategy = everyChange, restoreOnStartup
  ZWaveNode023_ZMNHHD_MiniDimmer_SwitchDimmer : strategy = everyChange, restoreOnStartup
  vSMTP_Server_KLFat_Online                 : strategy = everyChange, restoreOnStartup
  vTelegrammBot_Online      : strategy = everyChange, restoreOnStartup
  vLocalAirQuality_Lambach_Online  : strategy = everyChange, restoreOnStartup
  vAstroMonddaten_Online          : strategy = everyChange, restoreOnStartup
  vAstroSonnendaten_Online         : strategy = everyChange, restoreOnStartup
  vNTP_Online                      : strategy = everyChange, restoreOnStartup
  vJeeLink_Bridge_Online             : strategy = everyChange, restoreOnStartup
  vMosquittoHotzenplotz_Bridge_Online : strategy = everyChange, restoreOnStartup
  vOpenWeatherMap_Bridge_Online      : strategy = everyChange, restoreOnStartup
  vHue1_Bridge_Online      : strategy = everyChange, restoreOnStartup
  vZWaveNode01_Online      : strategy = everyChange, restoreOnStartup
  vZWaveNode2_Online      : strategy = everyChange, restoreOnStartup
  vZWaveNode3_Online      : strategy = everyChange, restoreOnStartup
  vZWaveNode4_Online      : strategy = everyChange, restoreOnStartup
  vZWaveNode5_Online      : strategy = everyChange, restoreOnStartup
  vZWaveNode6_Online      : strategy = everyChange, restoreOnStartup
  vZWaveNode9_Online      : strategy = everyChange, restoreOnStartup
  vZWaveNode10_Online      : strategy = everyChange, restoreOnStartup
  vZWaveNode11_Online      : strategy = everyChange, restoreOnStartup
  vZWaveNode12_Online      : strategy = everyChange, restoreOnStartup
  vZWaveNode13_Online      : strategy = everyChange, restoreOnStartup
  vZWaveNode14_Online      : strategy = everyChange, restoreOnStartup
  vZWaveNode15_Online      : strategy = everyChange, restoreOnStartup
  vZWaveNode17_Online      : strategy = everyChange, restoreOnStartup
  vZWaveNode18_Online      : strategy = everyChange, restoreOnStartup
  vZWaveNode19_Online      : strategy = everyChange, restoreOnStartup
  vZWaveNode20_Online      : strategy = everyChange, restoreOnStartup
  vZWaveNode21_Online      : strategy = everyChange, restoreOnStartup
  vZWaveNode22_Online      : strategy = everyChange, restoreOnStartup
  vZWaveNode23_Online      : strategy = everyChange, restoreOnStartup
  vZWaveNode24_Online      : strategy = everyChange, restoreOnStartup
  ZWave_Node_025_FGD212_Dimmer_2_Dimmer_1	: strategy = everyChange, restoreOnStartup
  Chromecast_TV2_Online      : strategy = everyChange, restoreOnStartup
  dimpflmoser_backupstatus           : strategy = everyChange, restoreOnStartup
  dimpflmoser_backupstatus_LastUpdate : strategy = everyChange, restoreOnStartup
  petrosilius_backupstatus           : strategy = everyChange, restoreOnStartup
  petrosilius_backupstatus_LastUpdate : strategy = everyChange, restoreOnStartup
  hotzenplotz_backupstatus            : strategy = everyChange, restoreOnStartup
  hotzenplotz_backupstatus_LastUpdate  : strategy = everyChange, restoreOnStartup
  }

During OH startup do you see a log line showing both files are loaded? All persistence add-ons have a default strategy which is usually applies to every item, everyChange, and restoreOnStartup.

the last start was yesterday and here is an excerpt from the logfile:

2023-04-19 14:18:35.467 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'Europe/Vienna'.
2023-04-19 14:18:35.501 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Location set to 'xxxxxxx'.
2023-04-19 14:18:35.503 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'de_AT'.
2023-04-19 14:18:35.504 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Measurement system set to 'SI'.
2023-04-19 14:18:41.734 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'zwave.items'
2023-04-19 14:18:42.431 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'test.items'
2023-04-19 14:18:42.449 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'chromecast.items'
2023-04-19 14:18:42.585 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'lacrosse.items'
2023-04-19 14:18:42.687 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'mqtt.items'
2023-04-19 14:18:42.727 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'meinHaus.items'
2023-04-19 14:18:42.991 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'wetter.items'
2023-04-19 14:18:43.361 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'mapdb.persist'
2023-04-19 14:18:43.480 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'influxdb.persist'
...

each item in the DB has only one entry, I assume that this is entered when oh is started … I will test further

If there is no <persistence-service>.persist file, all Items will be persisted for the specific persistence Service (* : strategy = everyChange afaik is default behavior)
So either that values are old values which were persisted before you created your influxdb.persist file or there is an issue that the file is loaded too late in the startup process.

Unfortunately, things are independent of a restart, independent of the restart of the OH service and also independent of the computer restart. Last start of the system was this morning at 09:15.
This morning I deleted also all not needed measurements from InfluxDB. Today at noon suddenly the first unexpected value appears again. The .persist files already exist for years.

Extract from the event.log, only the value at 12:08:03 (local time) was saved in the InfluxDB, the others were not.

2023-04-21 12:07:11.058 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Hotzenplotz_Storage_Available' changed from 95420.416 MB to 95419.367424 MB
2023-04-21 12:07:42.035 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Hotzenplotz_Storage_Available' changed from 95419.367424 MB to 95418.318848 MB
2023-04-21 12:08:03.376 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Hotzenplotz_Storage_Available' changed from 95418.318848 MB to 95417.270272 MB
2023-04-21 12:08:30.822 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Hotzenplotz_Storage_Available' changed from 95417.270272 MB to 95416.221696 MB

There is a third possibility where Items start changing and updating before the .persist files are loaded. Any changes in Items prior to that will be handled with the default strategies.

Well, yes, that’s what I meant :slight_smile:

I think there is a subtle difference though.

I think what you are saying is that the entries are from some past time before the .persist file were created. In that case all the entries from that time would have been saved.

I’m thinking shorter term and wonder if it might not even be a regression.

If Persistence starts saving values before it reads the .persist files during a boot it will save based on the default strategy. Even worse, it will restoreOnStartup based on the default strategy so there would be no way to specify that you don’t want some items to be restored. It will restore them all. Later, when the .persist files are loaded will anything other than the default will apply and by then it’ll be too late.

yes, that was the first option :slight_smile:

Of course I meant the influxdb.persist file, so InfluxDB persistence would be active and persisting before reading the file (given the asynchronous way that openHAB starts up that wouldn’t be no surprise :wink: ).

1 Like

correct, I have more than 850 items and the problem concerns about 30 items (some in items files and some created via UI)

But the values in my example above

have been persisted long after the start and only 1 value is affected in between!?!!

Now I have discovered the backgrounds!

I have edited the file ‘influxdb.persist’ with VSCode and then saved, the file was reloaded (here local time):

2023-04-23 19:17:38.334 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'influxdb.persist'

Pretty much at this time again 3 items (measurements) appeared in the influxdb, all 3 entries have the same timestamp:

From my point of view there is clearly an error loading the ‘influxdb.persist’ file here?

The best I can offer is to file an issue on the InfluxDB add-on.

Thanks for the support, i will open an issue on github!

I have the same issue with InfluxDB after doing the upgrade in ‘openhabian-config’ yesterday.
The database is now rapidly growing.
Can you post also here if there are any updates?
Is it possible to revert back to a previous version of the software that is responsible?

Kind Regards, Hans

I opened an issue on github: https://github.com/openhab/openhab-addons/issues/14889

If it’s rapidly growing I’m not sure it’s the same problem. As far as I can tell, @miwok’s problem is that some Items not in the .persist file get saved, creating new tables in the database and such. However, they are saved intermittently, not all the time.

If your database is growing that implies the Items are being saved all the time.

I guess this is a (probably bad) design decision. If no .persist file is present, the default strategy is used and that is “everyChange”. So I would guess that when the file is unloaded, the default strategy is applied and until the file is parsed that is active. So there is a short time between unloading the old model and loading the new model with the default strategy in place. That would explain why only very few values are persisted.

This does not explain the problem with the rapidly growing database. But I also think that this is not add-on related but a core issue.

1 Like

I think almost all my items showed-up in the database and are starting to log at default which is at every change. There are a lot of items which are changing and I do not want to log… this explains the growing.
I see in my log when I change something small to reload (adding a space)

2023-04-28 07:34:50.763 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘influxdb.persist’ has errors, therefore ignoring it: [118,48]: no viable alternative at input ‘stragegy’

I never had a problem with the .persist file