Domoticz Hangs on read sensor's logs.

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!
Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post

Please mark your topic as Solved when the problem is solved.
Post Reply
boe666
Posts: 24
Joined: Thursday 19 January 2017 17:14
Target OS: Raspberry Pi
Domoticz version:
Contact:

Domoticz Hangs on read sensor's logs.

Post by boe666 » Tuesday 15 May 2018 10:27

Version:3.9439
Platform:Pi2

If digital sensor (on/off) has many logs(changes), web application hang up (when try show), because web read all datas from log, before show page.
It's a problem - there is no procedure to delete this log by one click, so after some time - prowse logs of this sensors is unusable.
I suggest to provide partial reading of this log (by page), no all in one pass.

SweetPants
Posts: 2178
Joined: Friday 12 July 2013 21:24
Target OS: Linux
Domoticz version: V4.9913
Location: The Netherlands
Contact:

Re: Domoticz Hangs on read sensor's logs.

Post by SweetPants » Tuesday 15 May 2018 19:59

boe666 wrote:
Tuesday 15 May 2018 10:27
Version:3.9439
Platform:Pi2

If digital sensor (on/off) has many logs(changes), web application hang up (when try show), because web read all datas from log, before show page.
It's a problem - there is no procedure to delete this log by one click, so after some time - prowse logs of this sensors is unusable.
I suggest to provide partial reading of this log (by page), no all in one pass.
I assume you are using a PIR or something like that? Maybe you could let the PIR stay on for a longer time when detecting a movement. I had the same problem and clean the log (using SQL command directly into the database) every day using cron

Code: Select all

#!/bin/bash

DAYS=1

/usr/bin/sqlite3 /home/pi/domoticz/domoticz.db "DELETE FROM lightinglog WHERE DeviceRowID IN (88,113,114,129) AND Date <= datetime(  'now', '-$DAYS day' );"
Ubuntu 16.04.3 LTS, Intel NUC, MySensors 2.3.0-alpha, Pro Mini 3.3/8M RFM69(HW), ESP8266 (SDK2.2.0), Sonoff, RFLink, RFXcom, MQTT, NodeRed, Domoticz Beta (from source)

boe666
Posts: 24
Joined: Thursday 19 January 2017 17:14
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Domoticz Hangs on read sensor's logs.

Post by boe666 » Wednesday 16 May 2018 9:56

ok. But why we save the logs and then we must delete them ? Why domoticz can;t read this logs by page ?

SweetPants
Posts: 2178
Joined: Friday 12 July 2013 21:24
Target OS: Linux
Domoticz version: V4.9913
Location: The Netherlands
Contact:

Re: Domoticz Hangs on read sensor's logs.

Post by SweetPants » Wednesday 16 May 2018 18:03

boe666 wrote:
Wednesday 16 May 2018 9:56
ok. But why we save the logs and then we must delete them ? Why domoticz can;t read this logs by page ?
Don't shoot the messenger :mrgreen: :mrgreen: :mrgreen:
Ubuntu 16.04.3 LTS, Intel NUC, MySensors 2.3.0-alpha, Pro Mini 3.3/8M RFM69(HW), ESP8266 (SDK2.2.0), Sonoff, RFLink, RFXcom, MQTT, NodeRed, Domoticz Beta (from source)

User avatar
heggink
Posts: 483
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi
Domoticz version: V3.9530
Location: NL
Contact:

Re: Domoticz Hangs on read sensor's logs.

Post by heggink » Wednesday 16 May 2018 19:19

I have seen domoticz struggle with history if there are many device updates but, for me, it eventually always came back and I could delete. May take a bunch of minutes tho.
Pi3, latest beta
RFXCOM, z-wave (AEOTEC, switches, temhum, pir, contacts),
Plugwise2py, P1 'smart'meter & solar panel
Alexa, Wifi Cams motion detection
ESP: relays, PIR & Temp/TempHum
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest

boe666
Posts: 24
Joined: Thursday 19 January 2017 17:14
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Domoticz Hangs on read sensor's logs.

Post by boe666 » Wednesday 16 May 2018 21:38

ok,ok. But i ask twice: Why domoticz can't read this logs page by page ? It's simple to change and problem will be solved.

User avatar
heggink
Posts: 483
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi
Domoticz version: V3.9530
Location: NL
Contact:

Re: Domoticz Hangs on read sensor's logs.

Post by heggink » Thursday 17 May 2018 13:18

Because it's open source and someone needs to build it (I have a list of things that could be better but no time to do it myself). You can open a 'bug' on github and see if anyone picks it up but the fastest route is if you make the change yourself. That said, most of us have regular jobs, including the regular contributors for domoticz. Nobody is on any domoticz pay roll last time I looked. The joys of open source...
Pi3, latest beta
RFXCOM, z-wave (AEOTEC, switches, temhum, pir, contacts),
Plugwise2py, P1 'smart'meter & solar panel
Alexa, Wifi Cams motion detection
ESP: relays, PIR & Temp/TempHum
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest

boe666
Posts: 24
Joined: Thursday 19 January 2017 17:14
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Domoticz Hangs on read sensor's logs.

Post by boe666 » Thursday 17 May 2018 19:42

I wonder why nobody have problem with this ? especially after disable access to global tables in LUA_PARSERS scripts...... One PIR sensors can kill domoticz in 1 day!.

User avatar
heggink
Posts: 483
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi
Domoticz version: V3.9530
Location: NL
Contact:

Re: Domoticz Hangs on read sensor's logs.

Post by heggink » Thursday 17 May 2018 20:05

Dunno really. I have MANY PIRs (like 16 or so) but they just don't generate that many interrupts. What causes yours to generate so much data?
All my PIRs are zwave.
Pi3, latest beta
RFXCOM, z-wave (AEOTEC, switches, temhum, pir, contacts),
Plugwise2py, P1 'smart'meter & solar panel
Alexa, Wifi Cams motion detection
ESP: relays, PIR & Temp/TempHum
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest

boe666
Posts: 24
Joined: Thursday 19 January 2017 17:14
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Domoticz Hangs on read sensor's logs.

Post by boe666 » Thursday 17 May 2018 20:44

My alarm system is wired and independent. I have only one signal - zone is clear or not - DO. But i have no standard communication with domoticz. I made this by indirect way - I have a http module to read state of zone and invoke http url (i use LUA_PARSERS script). This module invoke url with 5s interval - independently from actual state of zone. So domoticz have 17200 readings by one day. I use this method with all my digital sensors (i.e. Error state of Heating instalation)

Old vesion of domoticz has eanbled access to global tables in LUA_Parsers script, so before I use the domotcz_updatedevice i checked actual state of device in domoticz database (otherdevice_svalues['name']). Few weeks ago i noticed access to this tables are disabled (tables are empty) so logs of my sensors are huge! I can't read this besause web interfaces hang up.

I ask on forum about this changes - but i have no answer yet.
I deleted this logs direct in databeses but is not a solution...

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests