Page 2 of 2

Re: How to do reduce log interval

Posted: Tuesday 08 March 2016 17:47
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).

Re: How to do reduce log interval

Posted: Wednesday 09 March 2016 8:30
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....

Re: How to do reduce log interval

Posted: Monday 14 March 2016 14:42
by delchrys
I maybe have about 10 devices so it will not be a problem I think.

Re: How to do reduce log interval

Posted: Monday 14 March 2016 16:49
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.

Re: How to do reduce log interval

Posted: Friday 18 March 2016 21:24
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????

Re: How to do reduce log interval

Posted: Saturday 19 March 2016 13:09
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

Re: How to do reduce log interval

Posted: Saturday 19 March 2016 21:04
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.

Re: How to do reduce log interval

Posted: Wednesday 19 April 2017 21:44
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.

Re: How to do reduce log interval

Posted: Monday 26 June 2017 23:25
by strebor
Worked like a charm, except can a get Firefox to let go of the old page noooo
S

Re: How to do reduce log interval

Posted: Saturday 15 July 2017 18:59
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

Re: How to do reduce log interval

Posted: Saturday 09 February 2019 16:46
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.

Re: How to do reduce log interval

Posted: Tuesday 24 September 2019 10:41
by Twoink
Where can i find SQLServer.cpp ?

Re: How to do reduce log interval

Posted: Tuesday 24 September 2019 11:24
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 ?

Re: How to do reduce log interval

Posted: Tuesday 07 April 2020 12:18
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...

Re: How to do reduce log interval

Posted: Tuesday 07 April 2020 13:38
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.

Re: How to do reduce log interval

Posted: Wednesday 08 April 2020 23:24
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

;)

Re: How to do reduce log interval

Posted: Saturday 02 May 2020 16:56
by Jufo
This option (html) has been withdrawn, must be added manually :cry:

Re: How to do reduce log interval

Posted: Saturday 16 January 2021 12:48
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 !

Re: How to do reduce log interval

Posted: Sunday 28 February 2021 14:42
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).