dzVents 2.0 just got integrated into Domoticz (beta v3.8023)

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

Moderator: leecollings

dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzVents 2.0 just got integrated into Domoticz (beta v3.8023)

Post by dannybloe »

Don't worry about that. I see you have debug mode enabled. That does slow things down though.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
jeanclic
Posts: 68
Joined: Saturday 28 January 2017 11:32
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France / Burgundy
Contact:

Re: dzVents 2.0 just got integrated into Domoticz (beta v3.8023)

Post by jeanclic »

dannybloe wrote:Don't worry about that. I see you have debug mode enabled. That does slow things down though.
Yes, it is enabled on my test VM, but disabled on my Pi (not possible to used anyway if I enable dzVents...

-> I do not use any version of dzVents: no "dzVents" folder in my "lua" folder...
-> "dzVents_settings_example.lua" is back inside "/scripts/dzVents" when I force a beta update via ./updatebeta, and I have errors if I have dzVents enabled on the web interface and no "dzVents_settings.lua" file in "/scripts/dzVents".

PS: did you see my post on the other topic ? http://www.domoticz.com/forum/viewtopic ... 20#p140066
RPI3B (Domoticz 4.9700 + ~60 scripts) + RFXtrx433E (fw1020) + Z-Stick Gen5 + MySensors / RPI2B+ (RasPlex)
x1 Eth. wired tablet
x8 T/H Oregon / x1 T/H Bresser
x7 heaters / x2 QUBINO "Flush 1 relay"
x10 plugs / x15 contacts
x4 fibaro / x1 PIR
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzVents 2.0 just got integrated into Domoticz (beta v3.8023)

Post by dannybloe »

That's totally weird as in the repo there is no such file in that folder.
Screen Shot 2017-07-02 at 16.37.09.png
Screen Shot 2017-07-02 at 16.37.09.png (123.3 KiB) Viewed 3159 times
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
jeanclic
Posts: 68
Joined: Saturday 28 January 2017 11:32
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France / Burgundy
Contact:

Re: dzVents 2.0 just got integrated into Domoticz (beta v3.8023)

Post by jeanclic »

dannybloe wrote:That's totally weird as in the repo there is no such file in that folder.
Just tested it again : I moved the incriminated file into a "old" folder, and then redo the ./updatebeta.

this time it did not came back, and my dzVents script is still working... (on my test VM). I do not understand what this file was doing there at the first place, because I will never have thought about creating it ! -> now I will try to remove it on my RPI and see what happen *crossing fingers*
RPI3B (Domoticz 4.9700 + ~60 scripts) + RFXtrx433E (fw1020) + Z-Stick Gen5 + MySensors / RPI2B+ (RasPlex)
x1 Eth. wired tablet
x8 T/H Oregon / x1 T/H Bresser
x7 heaters / x2 QUBINO "Flush 1 relay"
x10 plugs / x15 contacts
x4 fibaro / x1 PIR
Derik
Posts: 1602
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: dzVents 2.0 just got integrated into Domoticz (beta v3.8023)

Post by Derik »

dear...
What is status of Dzvents???
When i enable the option my CPU is running +10%...
Is this normal?
Or is there a thing that i do wrong?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
SweetPants

Re: dzVents 2.0 just got integrated into Domoticz (beta v3.8023)

Post by SweetPants »

Fixed in latest Beta
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzVents 2.0 just got integrated into Domoticz (beta v3.8023)

Post by dannybloe »

We are preparing some more updates that will bring down cpu usage a lot more. Stay tuned...
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Derik
Posts: 1602
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: dzVents 2.0 just got integrated into Domoticz (beta v3.8023)

Post by Derik »

ok... hope i learn some scripting with Dzvents...
Thanks for the great work
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
User avatar
heggink
Posts: 979
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: dzVents 2.0 just got integrated into Domoticz (beta v3.8023)

Post by heggink »

Just upgraded as well to latest version. putting any dzVent script in scripts makes CPU go up/down violently (from few %% to 100% and back), removing the script calms it down again. Updated OS to the latest version as well so fully updated jessie.
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzVents 2.0 just got integrated into Domoticz (beta v3.8023)

Post by dannybloe »

Yes, we know. We are currently optimizing this. Gathering the data being handed over to the scripts takes quite some time right now. We are currently testing some optimization schemes to make this a fast as possible without having to rewrite parts of Domoticz significantly. But it will take cpu time no matter what. But then again.. what good is a cpu if it is never tickled to do what it was designed for? But you will see the spikes mostly on slower machines (like Pi1, P2) with many devices that are updated very frequently.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
User avatar
heggink
Posts: 979
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: dzVents 2.0 just got integrated into Domoticz (beta v3.8023)

Post by heggink »

Agree as long as it is workable. On my pi3, the web frontend became quite unresponsive.
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
User avatar
heggink
Posts: 979
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: dzVents 2.0 just got integrated into Domoticz (beta v3.8023)

Post by heggink »

Strange tho that direct integration (v2) draws so much more than this was a lua addon (v1). Never saw that kind of load previously.
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzVents 2.0 just got integrated into Domoticz (beta v3.8023)

Post by dannybloe »

It's not strange. Previously with 1.x, dzVents relied on having a pre-fetched json table ready to be loaded every time dzVents was invoked. That json data had to be fetched on a regular interval (also done by a kind of internal dzVents script that runs every so many minutes as defined in the dzvents_settings.lua file). The problem with that was that this prefetched data was alway old unless you had it updated every minute (even then). But that is very costly cpuwise. This old solution had other problems as well as this data had to be streamed to the filesystem every time and then read by dzVents again into memory, parsed and processed. So now it is integrated, Domoticz prepares this data using live data. So now, all devices you can access in your scripts have live data which is what you want of course.
And also, 2.0 has changed in how you access these devices in such a way that only queried devices(devices you really use in your script) are processed instead of all devices at dzVents startup. All this made sure that your script can now run in way less milliseconds than before. Alas, the preparation of the data that is fed to dzVents is something that we are now optimizing as that takes most of the time.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
simonrg
Posts: 329
Joined: Tuesday 16 July 2013 22:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8807
Location: North East England
Contact:

Re: dzVents 2.0 just got integrated into Domoticz (beta v3.8023)

Post by simonrg »

dannybloe wrote:And also, 2.0 has changed in how you access these devices in such a way that only queried devices(devices you really use in your script) are processed instead of all devices at dzVents startup. All this made sure that your script can now run in way less milliseconds than before. Alas, the preparation of the data that is fed to dzVents is something that we are now optimizing as that takes most of the time.
Would it be possible to take a different approach of turning otherdevices tables into functions so that only the required information is retrieved in realtime when needed in the Lua script, perhaps as a look up from the database.

The original idea of filling otherdevices tables was I presume to reduce load by only doing it occasionally, but sending all realtime data will result in a lot of unnecessary information being collected multiple times, hence reducing the information collected will help. Isn't the logical extension of this the function in Lua to retrieve the information when needed?

Information in many of my scripts will be difficult, as the devices that are queried are calculated based in the script, so very many values would need to be prefetched to account for all circumstances.
Raspberry Pi 2 B - 2A@5V PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266
simonrg
Posts: 329
Joined: Tuesday 16 July 2013 22:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8807
Location: North East England
Contact:

Re: dzVents 2.0 just got integrated into Domoticz (beta v3.8023)

Post by simonrg »

dannybloe wrote:Yes, we know. We are currently optimizing this.
Has this optimisation now been done?

I have installed 3.8063 on my Domoticz systems and had to disable DzVents on my slave(Raspberry Pi B version 1, only 4 devices and 2 Lua scripts active), however while the normal CPU load is 1.5%, when I attempt to access the web frontend with DzVents active CPU load goes to 98%. Attempting to disable DzVents wasn't initially possible as even when the settings page displayed there was no option for DzVents, despite multiple forced refreshed (Ctrl-R Firefox Win7), it was only when I disabled all scripts that CPU usage dropped and refreshing brought up the DzVents options. So I have now disabled DzVents and restarted enabled scripts, the web frontend is now responsive as before.

Any suggestions?
Raspberry Pi 2 B - 2A@5V PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzVents 2.0 just got integrated into Domoticz (beta v3.8023)

Post by dannybloe »

yeah, we are preparing a pull request that should solve this. On some systems we see this happening.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
simonrg
Posts: 329
Joined: Tuesday 16 July 2013 22:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8807
Location: North East England
Contact:

Re: dzVents 2.0 just got integrated into Domoticz (beta v3.8023)

Post by simonrg »

dannybloe wrote:yeah, we are preparing a pull request that should solve this. On some systems we see this happening.
Great, thanks.
Raspberry Pi 2 B - 2A@5V PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266
User avatar
heggink
Posts: 979
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: dzVents 2.0 just got integrated into Domoticz (beta v3.8023)

Post by heggink »

Interested to hear how this is progressing. Any feel around an ETA?
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzVents 2.0 just got integrated into Domoticz (beta v3.8023)

Post by dannybloe »

The pull request was ready yesterday :)
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
User avatar
heggink
Posts: 979
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: dzVents 2.0 just got integrated into Domoticz (beta v3.8023)

Post by heggink »

So waiting for Giz to accept and build into new beta
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest