Disable log in some device

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.
Post Reply
jackslayter
Posts: 227
Joined: Tuesday 07 October 2014 11:00
Target OS: Raspberry Pi
Domoticz version: LastBeta
Location: France RA
Contact:

Disable log in some device

Post by jackslayter » Thursday 09 October 2014 10:37

Hi,
Its possible to add in roadmap an option for disable log in some device (virtual device or information device) ?

Thank you
RPi2 + RFLink, Domoticz
Chacon - micromodule 200w, remote 3b, 2x module 1000w, remote 16b, smoke detector, door contact, 2x 3500w plug
Oregon - 3x Thgr122Nx / OWL - CM180 / TRC02_2 RGB / Cheap - PiR, door contact, Temp Hum / 4x REVOLT NC5461

User avatar
Thyraz
Posts: 10
Joined: Friday 28 August 2015 13:45
Target OS: Raspberry Pi
Domoticz version: Beta
Contact:

Re: Disable log in some device

Post by Thyraz » Tuesday 01 September 2015 14:56

Would love to see that too. ;)

I like to keep temperature data as long as possible but other devices like motion sensors in every room are more sensible.
It just feels wrong if you try to avoid services that track you in the internet and then implementing your own tracking system at home. ;)

jackslayter
Posts: 227
Joined: Tuesday 07 October 2014 11:00
Target OS: Raspberry Pi
Domoticz version: LastBeta
Location: France RA
Contact:

Re: Disable log in some device

Post by jackslayter » Tuesday 24 November 2015 16:12

its possible to add this function , my memory card want it ;)
RPi2 + RFLink, Domoticz
Chacon - micromodule 200w, remote 3b, 2x module 1000w, remote 16b, smoke detector, door contact, 2x 3500w plug
Oregon - 3x Thgr122Nx / OWL - CM180 / TRC02_2 RGB / Cheap - PiR, door contact, Temp Hum / 4x REVOLT NC5461

User avatar
jannl
Posts: 955
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Geleen
Contact:

Re: Disable log in some device

Post by jannl » Tuesday 24 November 2015 16:17

You can set the log time to a very short period of time or is that not what you mean?

jackslayter
Posts: 227
Joined: Tuesday 07 October 2014 11:00
Target OS: Raspberry Pi
Domoticz version: LastBeta
Location: France RA
Contact:

Re: Disable log in some device

Post by jackslayter » Tuesday 24 November 2015 16:18

yes and no, I would like disable log in device you I choice
RPi2 + RFLink, Domoticz
Chacon - micromodule 200w, remote 3b, 2x module 1000w, remote 16b, smoke detector, door contact, 2x 3500w plug
Oregon - 3x Thgr122Nx / OWL - CM180 / TRC02_2 RGB / Cheap - PiR, door contact, Temp Hum / 4x REVOLT NC5461

roblom
Posts: 561
Joined: Wednesday 26 February 2014 16:28
Target OS: Raspberry Pi
Domoticz version:
Location: the Netherlands
Contact:

Re: Disable log in some device

Post by roblom » Thursday 26 November 2015 23:03

jackslayter wrote:its possible to add this function , my memory card want it ;)
mine too, there is a pulse counter with more than 2.400.000 log records where now the database is more than 120MB so also a lot of DB backups of more than 120MB so no space left on my SD. I try to remove the records but that takes about a day for 50.000 records... so yes i like this disable log functionality.

jackslayter
Posts: 227
Joined: Tuesday 07 October 2014 11:00
Target OS: Raspberry Pi
Domoticz version: LastBeta
Location: France RA
Contact:

Re: Disable log in some device

Post by jackslayter » Wednesday 02 December 2015 16:17

its possible to remove log by command (in script) ?
RPi2 + RFLink, Domoticz
Chacon - micromodule 200w, remote 3b, 2x module 1000w, remote 16b, smoke detector, door contact, 2x 3500w plug
Oregon - 3x Thgr122Nx / OWL - CM180 / TRC02_2 RGB / Cheap - PiR, door contact, Temp Hum / 4x REVOLT NC5461

olafmarcos
Posts: 11
Joined: Sunday 27 December 2015 2:09
Target OS: NAS (Synology & others)
Domoticz version: 6277
Location: Santander - Spain
Contact:

Re: Disable log in some device

Post by olafmarcos » Monday 05 December 2016 23:01

Up!

Any advance on disable logging?

Regards,

Olaf

Flopp
Posts: 354
Joined: Sunday 03 January 2016 15:55
Target OS: -
Domoticz version:
Location: Sweden
Contact:

Re: Disable log in some device

Post by Flopp » Monday 05 December 2016 23:37

I also would like to disable log for e.g. Pulse counter and other devices that sends data every minute or more often.
+1

User avatar
Egregius
Posts: 2713
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: Beta
Location: Beitem, BE
Contact:

Re: Disable log in some device

Post by Egregius » Monday 05 December 2016 23:43

You could opt to remove entries of devices you don't want.

I remove every night quite a lot. All unused device entries, all entries older than 1 day and for some tables everything.

Code: Select all

<?php
$db = new SQLite3('/volume1/@appstore/domoticz/var/domoticz.db');
$clean = strftime("%G-%m-%d %k:%M:%S",time()-86400);
$tables = array( 'MultiMeter',
                'MultiMeter_Calendar',
                'Percentage',
                'Percentage_Calendar',
                'Rain',
                'Rain_Calendar',
                'Temperature',
                'UV',
                'UV_Calendar',
                'Wind',
                'Wind_Calendar');
foreach($tables as $table)
{
    $query=$db->exec("DELETE FROM $table WHERE DeviceRowID not in (select ID from DeviceStatus where Used = 1)");
    if ($query)
    {
        $rows = $db->changes();
        if($rows>0)
            echo $rows." rows removed from $table<br/>";
    }
    $query=$db->exec("DELETE FROM $table WHERE Date < '$clean'");
    if ($query)
    {
        $rows=$db->changes();
        if($rows>0)
            echo $rows." rows removed from $table<br/>";
    }
}
$tables = array('Temperature_Calendar','Meter','Meter_Calendar','LightingLog');
foreach($tables as $table)
{
    $query=$db->exec("DELETE FROM $table");
    if ($query)
    {
        $rows=$db->changes();
        if($rows>0)
            echo $rows." rows removed from $table<br/>";
    }
}

$sql = 'VACUUM;';
if(!$result = $db->exec($sql))
{
    die('There was an error running the query [' . $db->error . ']');
}

 
Cleaning of specific devices:

Code: Select all

$query=$db->exec("DELETE FROM $table WHERE DeviceRowID in (10,20,30)");
if ($query)
{
    $rows = $db->changes();
    if($rows>0)
        echo $rows." rows removed from $table<br/>";
}
 
You're database will be lots smaller, faster, easier to handle, safer,...
Of course: use at your own risk, above removes a lot!

olafmarcos
Posts: 11
Joined: Sunday 27 December 2015 2:09
Target OS: NAS (Synology & others)
Domoticz version: 6277
Location: Santander - Spain
Contact:

Re: Disable log in some device

Post by olafmarcos » Thursday 07 June 2018 23:58

Umm, i think the question it isn't how to remove logs but disable them...

In my case, it is due a Hue lights system that is sync with the TV. Every change in tv light makes a log in the lights devices that are wasting my NAS disks.

Hoping this funcionality come to us in near future to extend the live of expensive disks/sd memories.

Regards,

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests