cyril21 wrote: ↑Thursday 06 May 2021 22:37
I share with you a project that I am developing in lua/dzvents.
This is another scripting system. The code (a basic like language) is put in the description field of the device (see screenshot below). It is interpreted every minute and every time the device is triggered.
@cyril21,
Thx for sharing, It looks like you spend a lot of time and thoughts on it.
I am probably not in the best position to comment if this scripting approach is easier to understand compared to dzVents or Lua because the experience I gained of these languages / framework by coding and supporting them; so I leave that to others.
However I am in a position to comment on aspects like performance, repsonse-times and resource usage.
I installed your scripts on my relatively quiet test and development system and notice the script is executed > 10 times a minute even now at the most quiet period of the day. In every execution the script reads and interprets all description fields of every device to see if any action needs to be taken.
My system is heavily oversized for what it is intended for but I see that the average execution time of your script without any action to be taken is 0.19 seconds so I expect this to be no less on a Raspberry with a similar amount of devices. On average my other dzVents scripts execution time on this system (with actions performed) is 0.004 seconds.
When this script is executing any other Blockly, Lua or dzVents script needs to wait until it is finished.
Have you looked at the additional CPU and memory usage on a system with a reasonable amount of devices?
btw. It would have been nice if you gave the appropriate credits to @dannybloe (creator of the dzVents framework)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>>
dzVents wiki