dzVents errors

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzVents errors

Post by waaren »

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?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
roblom
Posts: 408
Joined: Wednesday 26 February 2014 15:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: the Netherlands
Contact:

Re: dzVents errors

Post by roblom »

Like I said in my previous post, when I remove all DzEvents scripts the CPU lowers to 10-15%.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzVents errors

Post by waaren »

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.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
roblom
Posts: 408
Joined: Wednesday 26 February 2014 15:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: the Netherlands
Contact:

Re: dzVents errors

Post by roblom »

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.

Code: Select all

sudo npm -g remove node-red
sudo npm -g remove node-red-admin
rm -R ~/.node-red
CPU logging
CPU logging
Screenshot_20201129_204912.jpg (200.36 KiB) Viewed 783 times
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzVents errors

Post by waaren »

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.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
roblom
Posts: 408
Joined: Wednesday 26 February 2014 15:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: the Netherlands
Contact:

Re: dzVents errors

Post by roblom »

When I turn on the consumption.lua debug logging I see this.

Code: Select all

2020-11-29 22:02:04.101 Status: dzVents: Info: Consumption: ------ Start external script: consumption.lua: Device: "Energie (P1) (P1-poort)", Index: 175
2020-11-29 22:02:04.358 Status: dzVents: Debug: Consumption: Processing device-adapter for Opgewekt (Script): kWh device adapter
2020-11-29 22:02:04.372 Status: dzVents: Debug: Consumption: Processing device-adapter for Consumptie: kWh device adapter
2020-11-29 22:02:04.373 Status: dzVents: Debug: Consumption: EnergyImportLow = 8102.796 kWh
2020-11-29 22:02:04.373 Status: dzVents: Debug: Consumption: EnergyImportHigh = 9677.027 kWh
2020-11-29 22:02:04.374 Status: dzVents: Debug: Consumption: EnergyExportLow = 2817.23 kWh
2020-11-29 22:02:04.374 Status: dzVents: Debug: Consumption: EnergyExportHigh = 6196.051 kWh
2020-11-29 22:02:04.383 Status: dzVents: Debug: Consumption: EnergyGeneration = 2098800.0 Wh
2020-11-29 22:02:04.384 Status: dzVents: Debug: Consumption: Not enough data points yet to produce something useful
2020-11-29 22:02:04.384 Status: dzVents: Debug: Consumption: PowerImportHistory entries = 30
2020-11-29 22:02:04.385 Status: dzVents: Debug: Consumption: PowerGeneration entries = 0
2020-11-29 22:02:04.430 Status: dzVents: Info: Consumption: ------ Finished consumption.lua
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.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzVents errors

Post by waaren »

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.

Code: Select all

2020-11-29 22:02:04.385 Status: dzVents: Debug: Consumption: PowerGeneration entries = 0
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.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
roblom
Posts: 408
Joined: Wednesday 26 February 2014 15:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: the Netherlands
Contact:

Re: dzVents errors

Post by roblom »

The calculation and update of the consumption device must also take place when there is no generation. And that did work before.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzVents errors

Post by waaren »

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
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
Copitano
Posts: 50
Joined: Friday 28 June 2019 1:26
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: NL
Contact:

Re: dzVents errors

Post by Copitano »

@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².
roblom
Posts: 408
Joined: Wednesday 26 February 2014 15:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: the Netherlands
Contact:

Re: dzVents errors

Post by roblom »

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.
User avatar
Copitano
Posts: 50
Joined: Friday 28 June 2019 1:26
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: NL
Contact:

Re: dzVents errors

Post by Copitano »

Okay then, thanks for your reply ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest