Database policy retency Topic is solved

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
Harlock
Posts: 3
Joined: Sunday 04 February 2024 18:24
Target OS: Windows
Domoticz version:
Contact:

Database policy retency

Post 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)
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Database policy retency

Post 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.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Harlock
Posts: 3
Joined: Sunday 04 February 2024 18:24
Target OS: Windows
Domoticz version:
Contact:

Re: Database policy retency

Post 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!
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Database policy retency

Post 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.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
gizmocuz
Posts: 2350
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Database policy retency

Post 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.
Quality outlives Quantity!
Harlock
Posts: 3
Joined: Sunday 04 February 2024 18:24
Target OS: Windows
Domoticz version:
Contact:

Re: Database policy retency

Post by Harlock »

Thanks you for your answers, it's clear ! ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest