How to do reduce log interval

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

Moderator: leecollings

delchrys
Posts: 51
Joined: Wednesday 02 March 2016 20:52
Target OS: -
Domoticz version:
Contact:

Re: How to do reduce log interval

Post by delchrys »

gizmocuz wrote:Did you also made a change in the database as mentioned ?
No i didn't how do i do that if i may ask?

edit:

Yes i got it working after a lot of googling (my best friend)
I have changed the database also and now i have interval of 1 minute.
I look in to it for a day and test it, maybe the rpi2 is fast enough to keep working properly(fast).
User avatar
gizmocuz
Posts: 2352
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: How to do reduce log interval

Post by gizmocuz »

Please tell us your findings after maybe a week ?
Also the database size before, and after a week...
How many sensors do you have in the devices tab... like i got 470....
Quality outlives Quantity!
delchrys
Posts: 51
Joined: Wednesday 02 March 2016 20:52
Target OS: -
Domoticz version:
Contact:

Re: How to do reduce log interval

Post by delchrys »

I maybe have about 10 devices so it will not be a problem I think.
delchrys
Posts: 51
Joined: Wednesday 02 March 2016 20:52
Target OS: -
Domoticz version:
Contact:

Re: How to do reduce log interval

Post by delchrys »

gizmocuz wrote:Please tell us your findings after maybe a week ?
Also the database size before, and after a week...
How many sensors do you have in the devices tab... like i got 470....
Is it possible that the database.db preferences reset when updating to new beta release??
Because when i updated to new Beta the shortlog preference was reset to 5 minutes.
I changed it back to 1 min, and now it is working again with 1 min intervals.
delchrys
Posts: 51
Joined: Wednesday 02 March 2016 20:52
Target OS: -
Domoticz version:
Contact:

Re: How to do reduce log interval

Post by delchrys »

gizmocuz wrote:you have to remove 2 lines in the SQLServer.cpp and then you can change it in the database (actually the html code is also there but hidden)

Code: Select all

	if (!GetPreferencesVar("ShortLogInterval", nValue))
	{
		nValue = 5;
		UpdatePreferencesVar("ShortLogInterval", nValue);
	}
then underneed remove these two lines

Code: Select all

	if (nValue < 1)
		nValue = 5;
i probably must have some good reason not to expose this yet ?
Gizmocuz??
Can you tell me where to find the html code where i can change the shortlog settings????
ricard
Posts: 11
Joined: Sunday 24 January 2016 17:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to do reduce log interval

Post by ricard »

It is the WebServer.cpp in the "main" folder not the SQLServer.cpp

I only had to change the code as below:

int iShortLogInterval = atoi(request::findValue(&req, "ShortLogInterval").c_str());
if (iShortLogInterval < 1)
iShortLogInterval = 1;
m_sql.UpdatePreferencesVar("ShortLogInterval", iShortLogInterval);
m_sql.m_ShortLogInterval = iShortLogInterval;

And then rebuild it
delchrys
Posts: 51
Joined: Wednesday 02 March 2016 20:52
Target OS: -
Domoticz version:
Contact:

Re: How to do reduce log interval

Post by delchrys »

ricard wrote:It is the WebServer.cpp in the "main" folder not the SQLServer.cpp

I only had to change the code as below:

int iShortLogInterval = atoi(request::findValue(&req, "ShortLogInterval").c_str());
if (iShortLogInterval < 1)
iShortLogInterval = 1;
m_sql.UpdatePreferencesVar("ShortLogInterval", iShortLogInterval);
m_sql.m_ShortLogInterval = iShortLogInterval;

And then rebuild it
Strange both options seem to work, or SQLhelper.cpp or webserver.cpp.
But also changing the database works. In preferences--> shortlog interval.

Now only a selectable option, and it would be perfect.
Two days running now and 1150Kb database size.
fleinze
Posts: 1
Joined: Wednesday 19 April 2017 21:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to do reduce log interval

Post by fleinze »

There has been no post for a year in this thread but I found a new comfortable solution I want to share:
The settings-value for the shortlog-interval is present throughout the source code. It is just missing in the html, not just "invisible" as suggested above.
You can changed that by editing www/views/setup.html
Search for "shortlogtable" and add the following before the </table>-tag:

Code: Select all

<tr>
	<td align="right" style="width:60px"><label><span data-i18n="Interval"></span>Interval: </label></td>
	<td><select id="comboshortloginterval" name="ShortLogInterval" style="width:60px" class="combobox ui-corner-all">
		<option value="1">1</option>
		<option value="5">5</option>
		<option value="10">10</option>
		<option value="15">15</option>
	</select>&nbsp; Minutes
</tr>
Save it, delete your browser-cache and refresh your browser. I had problems with chrome keeping the old setup page even after deleting the cache, but using incognito mode worked to display the new page.
The new settings-value is fully functional.
strebor
Posts: 10
Joined: Thursday 18 December 2014 17:41
Target OS: Raspberry Pi / ODroid
Domoticz version: 8007
Location: France
Contact:

Re: How to do reduce log interval

Post by strebor »

Worked like a charm, except can a get Firefox to let go of the old page noooo
S
MasterCATZ
Posts: 11
Joined: Friday 14 July 2017 21:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to do reduce log interval

Post by MasterCATZ »

Thanks heaps editing www/views/setup.html worked a treat

Code: Select all

<div class="tab-pane" id="tablog">
						<!-- Log History
						================================================== -->
						<section id="loghistory">
						  <div class="page-header-small">
							<h1 data-i18n="Log History">Log History</h1>
						  </div>
							<h2><span data-i18n="Light/Switches"></span>:</h2>
							<table class="display" id="lightlogtable" border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td align="right" style="width:60px"><label><span data-i18n="Days"></span>: </label></td>
								<td><input type="text" id="LightHistoryDays" name="LightHistoryDays" style="width: 50px; padding: .2em;" class="text ui-widget-content ui-corner-all" /></td>
							</tr>
							</table>
							<br>
							<h2><span data-i18n="Short Log Sensors"></span>:</h2>
							<table class="display" id="shortlogtable" border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td align="right" style="width:60px"><label><span data-i18n="Days"></span>: </label></td>
								<td><select id="comboshortlogdays" name="ShortLogDays" style="width:60px" class="combobox ui-corner-all">
									<option value="1">1</option>
									<option value="2">2</option>
									<option value="3">3</option>
									<option value="4">4</option>
									<option value="5">5</option>
									<option value="6">6</option>
									<option value="7">7</option>

								</select>&nbsp;&nbsp;<button data-i18n="Clear" class="btn btn-danger" ng-click="CleanupShortLog()">Clear</button></td>
							</tr>
							<tr>

   								<td align="right" style="width:60px"><label><span data-i18n="Minutes"></span>: </label></td>
   								<td><input type="text" id="comboshortloginterval" name="ShortLogInterval" style="width:60px" class="text ui-widget-content ui-corner-all" /></td>
      
							</tr>
							</table>
						</section>
					</div>
This lets you manually type in the minutes for better tweaking

shame I could not get it to work in seconds
MaikelK
Posts: 41
Joined: Saturday 01 November 2014 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to do reduce log interval

Post by MaikelK »

Cant we get this as a standard in the Settings instead of manually have to add it again after an update?
Maybe a warning stating that for example 1 minute will make your database quite big?

It would even be better to be able to select it per sensor if you want it in minutes or 5 minutes for example.
Twoink
Posts: 8
Joined: Monday 16 July 2018 11:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to do reduce log interval

Post by Twoink »

Where can i find SQLServer.cpp ?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: How to do reduce log interval

Post by waaren »

Twoink wrote: Tuesday 24 September 2019 10:41 Where can i find SQLServer.cpp ?
SQLServer.cpp is not part of the domoticz source. Maybe you are looking for ./main/WebServer.cpp or ./main/SQLHelper.cpp ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
pizzulicchio
Posts: 15
Joined: Wednesday 24 April 2019 14:01
Target OS: Linux
Domoticz version: beta
Location: Italy
Contact:

Re: How to do reduce log interval

Post by pizzulicchio »

MaikelK wrote: Saturday 09 February 2019 16:46 Cant we get this as a standard in the Settings instead of manually have to add it again after an update?
Maybe a warning stating that for example 1 minute will make your database quite big?

It would even be better to be able to select it per sensor if you want it in minutes or 5 minutes for example.
Any update about this ?
How is possible to submit a sort of "feature request" to dev team ?

I have edited the html code and ... i know... it's not "funny" to edit again at every update...
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: How to do reduce log interval

Post by waaren »

pizzulicchio wrote: Tuesday 07 April 2020 12:18 How is possible to submit a sort of "feature request" to dev team ?
You can submit a pull request on github. If it would be accepted it will be merged in a future Beta.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
pizzulicchio
Posts: 15
Joined: Wednesday 24 April 2019 14:01
Target OS: Linux
Domoticz version: beta
Location: Italy
Contact:

Re: How to do reduce log interval

Post by pizzulicchio »

waaren wrote: Tuesday 07 April 2020 13:38
pizzulicchio wrote: Tuesday 07 April 2020 12:18 How is possible to submit a sort of "feature request" to dev team ?
You can submit a pull request on github. If it would be accepted it will be merged in a future Beta.
DONE!

https://github.com/domoticz/domoticz/pull/4063

;)
Jufo
Posts: 28
Joined: Friday 17 February 2017 13:24
Target OS: Linux
Domoticz version: 3.9389
Location: Poland
Contact:

Re: How to do reduce log interval

Post by Jufo »

This option (html) has been withdrawn, must be added manually :cry:
pbraspi
Posts: 1
Joined: Saturday 16 January 2021 12:42
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to do reduce log interval

Post by pbraspi »

Hi all, I am a newcomer with Domoticz. Got my RaspPi to read the electricity and gas from the P1 port of my digital meter. Would now like to display the 15 minute interval data. Does this last posting mean that changing setup.html does not work anymore ? As I made the setup.html change but cannot see the changes (deleted cache, used private/incognito windows on different browsers). Thanks for any help !
Tees
Posts: 1
Joined: Sunday 28 February 2021 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to do reduce log interval

Post by Tees »

The solution of changing the setup.html still works perfectly fine on the last version of Domoticz.
I would wish however that we would be able to set the interval per device, I have my power meter that updates every minute (and now also shows that in the graph thanks to this tweak!), but my solar panel converter updates every 5 minutes, so I now get a stepped graph for that one...

Even better would be to update the graph for every new value, with the possibility to set a minimum time (1 or 5 minutes or whatever one likes).
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest