roblom wrote: ↑Sunday 29 November 2020 17:03
Since 21 November the CPU is really high, average is about 92%.
When I use "top" it shows Domoticz is taking up 90%.
I use a Raspberry 3B, storage is 16Gb SanDisk sd-card which is 17% in use. Maximum memory usage is also risen since the 21th.
CPU usage of domoticz is much higher then usual so something seems to be wrong.
I don't expect something from it but can you try to suspend the consumption script for a couple of minutes to see if that is related?
roblom wrote: ↑Sunday 29 November 2020 18:07
Like I said in my previous post, when I remove all DzEvents scripts the CPU lowers to 10-15%.
Can you please share (a zip) of your dzVents scripts (via wetransfer) Maybe I can see something that could explain the high CPU usage.
You can send the link via PM.
Of course I can send it, but it also does it with the consumption script I gave above.
DzEvents on.
No scripts in DzEvents script folder.
CPU ~20%
DzEvents on.
Consumption script in DzEvents script folder
CPU ~55%
Also note that I didn't change the DzEvents scripts for months and they all where working fine before the 21th.
I now also uninstalled mosquito and used the lines below to disable node-red but it doesn't seems to make any difference.
roblom wrote: ↑Sunday 29 November 2020 17:29
When DzEvents is on and no scripts in the script folder, CPU is about 10-15%. As soon as I put one script in the DzEvents script folder the CPU usage raises to a 50-60%. Which script doesn't seems to make any difference.
OK. Could it be that these high values started around the moment you switched dzVents and/or domoticz to use debug mode?
These modes are very resource hungry on IO and memory.
Where the "Not enough data points yet to produce something useful" is strange because it keeps repeating it and therefore the consumption device isn't updated.
roblom wrote: ↑Sunday 29 November 2020 22:09
Where the "Not enough data points yet to produce something useful" is strange because it keeps repeating it and therefore the consumption device isn't updated.
The "generation" record in persistent data does not contain any value yet. So either no energy generated since the script was started with a new name or - after the data file was deleted.
roblom wrote: ↑Monday 30 November 2020 0:03
The calculation and update of the consumption device must also take place when there is no generation. And that did work before.
True but only after the generation has been filled with at least 3 measurements before. It is now (stil) empty
@roblom: Was a long time ago, but I'm interested if this problem was ever solved.
That's because I want to use the script as an example to build a script that calculates the 10 min average solar radiation of my SEM228T pyranometer. The pyranometer gives a value every 10 sec. I can't adjust that. So I want to calculate the arithmetic mean of 60 values and send it to a domoticz sensor. When calculating J/cm² from W/m² reading it now gives about 6% overstatements in J/cm² due to slight delays of the clock while calculating. So I want to eliminate that by using a 10-minute average of Watts/m².
Yes it does work. The problem was that there needs to be at least 3 values and the values where only there when there was power generated. So out took tool the next day before the values where added. Since then it worked perfect.