Open Kopierwichtel opened 2 years ago
Hm ... The InfluxDB adapter has a "host unavailable memory caching" and if I would add something like this I would add that.
Sorry but f you decide to log into a Database then this database should be available ... Caching several hours of data for such a case is a very special usecase
I don't know this feature. If it stores the values over night it fine for me ;-) Basically i agree that the DB should be online all time, but considering the energy prices i can't tel lmy parents to run the PC 24/7.
I calculated that the space consumtion is approx 2 MB per state for 8 hours assuming a new value every sec. Maybe it would be possible to define the states which shall be buffered. In my case value are only written every 10 sec and only 3 values are needed.
As aworkaround I was thinking if I can use the normal history adapter to store the value additionaly just for one day and then use a script to read those value and send them to the SQL adapter once the postgre DB is back. But i don't know if this would work.
If it stores the values over night it fine for me ;-)
In fact it depends on your available RAM because the values are only stored in RAM and pot. lost if it crashed because of "out of memory" ... As said ... This feature is planned to handle a DB restart or such or cases with updates, so short timeframes - not a whole night.
ah, understood. I think in my or my parents use case it would work, because there are only 3 states which are being updated every 10 sec. If there's no coded limit it could work
Is your feature request related to a problem? Please describe. For my parents i'm using a raspberrypi for the iobroker instance incl. the sql adapter. The db (postgresql) is stored on their windows PC to have a high performance incl. a Grafana instance. During the night the pc is turned off, leading to the problem, that no data is logged durng that period.
Describe the solution you'd like If the DB cannot be reached the statements are saved e.g. in a sql file. Once the DB is back online again all missed changes / the SQL file is imported. After the successful import, the SQL file deleted again. My goal is to have a 24/7 protocol of all data, e.g. energy data, ... but without having to run the normal PC all night
Describe alternatives you've considered Maybe not an alternative, but a MVP: Initially the SQL file could be stored (one file per day). The file is stored on the raspi where i can copy and import it regularly
Additional context