How to increase the logging time of temperature sensors in the Log History up to 500 days?

Moderator: leecollings

Post Reply
dallas
Posts: 11
Joined: Monday 04 January 2021 0:34
Target OS: Windows
Domoticz version: 14127
Location: Ukraine
Contact:

How to increase the logging time of temperature sensors in the Log History up to 500 days?

Post by dallas »

Hello to all members of the forum. I am a newbie user from Ukraine, although I have been using Domoticz for almost six months at the level of setting - searching for solutions.
Now I have the latest version of the program on my Windows server, the head unit is Xiaomi Hub 2 and so far there are 22 temperature and humidity sensors. I am trying to log the temperature in the warehouse with an interval of 5 minutes. I ask because it may be necessary to look at the logs 4 months ago or 25 days ago ...
I have already tried everything, I can not find a solution to increase the logging of sensors - maybe you can add it to me. There is a value from 1 to 7 days. I need more - 365 or even 500 or 1000. How can this be done without using specific programs like C ++ to change program files. If it is impossible to change a file with logging intervals without using such programs, then who can change and share the file with such data with me? :!: It is interesting to log with a 5-minute interval! Since I'm using a PC, the file size doesn't matter. Thanks a lot for the answers!!!
Attachments
123.jpg
123.jpg (71.45 KiB) Viewed 2145 times
plugge

Re: How to increase the logging time of temperature sensors in the Log History up to 500 days?

Post by plugge »

If you can read the device every five minutes, you could make a script to write the results to the domoticz.log file.
See https://www.domoticz.com/wiki/Windows#Windows_Log_files:
Windows Log files
Due to what seems to be a bug in the installation script the logging file entries are not created in startup commands.
So you need to add them manually.

When running as a service you need to change regkey HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Domoticz\Parameters Add value AppParameters with -log "<Path-to-logfile\domoticz.log>"

When running as an app define it in the target field of the properties window. Something like C:\Users\Public\Domoticz\domoticz.exe -www 8080 -sslwww 443 -log "C:\Users\Public\Domoticz\domoticz.log" -loglevel normal,status,error
User avatar
kiddigital
Posts: 435
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: How to increase the logging time of temperature sensors in the Log History up to 500 days?

Post by kiddigital »

Although Domoticz could be modified to support such long sensordata history, it is not advisable to do so.

Internally Domoticz uses SQLite3 as its internal database engine and this is meant for not too large databases.

But an easy solutions is available
Domoticz can push its measurements to external collectors. For example Influxdb. Look for ‘Data Push’ in the settings menu.

And on the Domoticz wiki for more information.

You can setup an InfluxDB server with a Grafama front-end and keep as much data as you like.

Hope that helps. Good luck and keep us posted.
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: How to increase the logging time of temperature sensors in the Log History up to 500 days?

Post by waaren »

plugge wrote: Monday 22 February 2021 8:28 If you can read the device every five minutes, you could make a script to write the results to the domoticz.log file.
The question is not about sending the values to the domoticz program log (domoticz.log) but about storing the values of sensors in the history tables of the database for a longer time with a granularity of one sample per 5 minutes.
Also the issue you refer to with regards to the domoticz.log is solved in a recent build. (see Domoticz versions / Commits Build 12928

I will add that as a comment in the wiki
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: How to increase the logging time of temperature sensors in the Log History up to 500 days?

Post by waaren »

kiddigital wrote: Monday 22 February 2021 8:29 Internally Domoticz uses SQLite3 as its internal database engine and this is meant for not too large databases.
From sqlite.org
The largest possible setting for SQLITE_MAX_PAGE_COUNT is 4294967294. When used with the maximum page size of 65536, this gives a maximum SQLite database size of about 281 terabytes.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
kiddigital
Posts: 435
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: How to increase the logging time of temperature sensors in the Log History up to 500 days?

Post by kiddigital »

waaren wrote:
kiddigital wrote: Monday 22 February 2021 8:29 Internally Domoticz uses SQLite3 as its internal database engine and this is meant for not too large databases.
From sqlite.org
The largest possible setting for SQLITE_MAX_PAGE_COUNT is 4294967294. When used with the maximum page size of 65536, this gives a maximum SQLite database size of about 281 terabytes.
Nice Image (now find an SD card to fit 281 Tera on Image)
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
dallas
Posts: 11
Joined: Monday 04 January 2021 0:34
Target OS: Windows
Domoticz version: 14127
Location: Ukraine
Contact:

Re: How to increase the logging time of temperature sensors in the Log History up to 500 days?

Post by dallas »

Thanks to everyone who answered me! And I apologize for not writing for a long time - I was busy with work and some hack ...
I decided to take advantage of the kiddigital advice and started installing Influx and Grafana. Played with them for a long time since I am not a programmer, but I did it! Used the following installation manuals - https://devconnected.com/how-to-install ... s-in-2019/ (but the InfluxDB service was not installed by autorun via NSSM, so I just copied it to Start-all autorun programs and now it starts, though not in the background ...)
Then I installed Grafana and then for another 3-4 days I compiled it all into a heap. Setting it all up somehow like this - https://grafana.com/docs/grafana/latest ... ata-source.
In an intermediate version, I used the article - viewtopic.php?f=21&t=35101&p=270521#p270521, but I was not satisfied with the data recording interval - all the same 7 days with overwriting the time exactly 7 days ago.
In the end, I came to the result that I wanted to have !!! Now my Domoticz database through Influx DB and Grafana is collected in tables and graphs + stored for a long time (as far as the computer allows). I attach a photo of the result below + learned how to make backups in Grafana so that you can restore everything!
The essence of my answer - who wants to find - will find, if he looks well !!! You can do it, read it - do it. But, of course, it would be nice if this was implemented in the program itself. On the other hand, I understand Waaren and thank you for such a good product-constructor Domoticz!
Grafana1.jpg
Grafana1.jpg (306.6 KiB) Viewed 2033 times
Grafana2.jpg
Grafana2.jpg (359.98 KiB) Viewed 2033 times
Grafana3.jpg
Grafana3.jpg (270.14 KiB) Viewed 2033 times
dallas
Posts: 11
Joined: Monday 04 January 2021 0:34
Target OS: Windows
Domoticz version: 14127
Location: Ukraine
Contact:

Re: How to increase the logging time of temperature sensors in the Log History up to 500 days?

Post by dallas »

Yes, and one more question :?: not in this topic, but very important and simple for you - Domotics shows that I do not have Python installed. I downloaded it separately and installed it successfully, but the program shows that it is not and is not present !!! And everything seems to work. What kind of glitch could it be? System - Windows. For some reason, I can't attach a photo anymore ...
About Domoticz
Version: 2020.2 (build 13051)
Build Hash: 4b7cd2a69
Compile Date: 2021-03-04 14:30:15
dzVents Version: 3.1.5
:? Python Version: None :shock:
Uptime: 18 Днів, 19 Годин, 31 Хвилин, 25 Секунди
Links
Website Forum Wiki Source Code Manual
Thanks for the help!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest