Page 1 of 1

Database policy retency

Posted: Wednesday 07 February 2024 9:31
by Harlock
Hello!

I'm new in the comunity and i have installed domoticz for my home !

I would like to know if there is a way to change the retency policy of the database on GUI on domoticz. i don't want to keep data sensors forever, but just for some week, i'm pushing these data in another database (influxdb) because i like use graphana for graphs.

The only solution that i found is that for deleting data on domoticz database i should connect on the db manually and with a query delete them (sqllite)

Re: Database policy retency

Posted: Wednesday 07 February 2024 9:42
by waltervl
Domoticz maintains 2 types of tables for storing device data. The short log table which stores 5 minutes update values for 1 to 7 days. This retention time can be set in the Log settings page (menu Setup - Settings - tab Log History)
The second table is the calendar table where only the daily average data is stored (one record per day). This is calculated every day at 0:00 hrs. It has no retention time so it will grow over the years.

There is also a table for switch log (on/off/dimlevel) and text logs. The retention of this table can also be set in menu Setup - Settings - tab Log History

So to keep your database small put the short log to 1 day.

https://www.domoticz.com/wiki/Applicati ... og_History

In my case I have now 5 years of history with 200+ devices, 4 days short log and my database is approx 20 MB so not something to worry about.

Re: Database policy retency

Posted: Wednesday 07 February 2024 12:34
by Harlock
Thanks a lot for all these informations !!
I was afraid about database size but seems that it's ok!
Thank you also for the link to doc domoticz.

I have another question, if MySensors data sent by arduino each 10 seconds, Domoticz store only the last current value each 5 minutes? Not all datas that it received?

I know that it received data each 10 seconds because i can see in influxdb the datas pushed by domoticz.

Have a good day!

Re: Database policy retency

Posted: Wednesday 07 February 2024 13:35
by waltervl
Now you are overasking me. Could be that it is stored in some other temporary table. But basic 5 min sensor data is stored in the device log tables.

Re: Database policy retency

Posted: Wednesday 07 February 2024 17:52
by gizmocuz
I have another question, if MySensors data sent by arduino each 10 seconds, Domoticz store only the last current value each 5 minutes? Not all datas that it received?
That is correct. It depends per device type is it stores the min/max/average or last value.

Re: Database policy retency

Posted: Wednesday 07 February 2024 19:24
by Harlock
Thanks you for your answers, it's clear ! ;)