Is to possible to mix plain lua and dzevents routines ?
Posted: Monday 10 February 2025 6:34
Hi
I am investigating to port a lot of big lua scripts to dzevents...
As far as i can see dzeventis i basic lua in a different way formatted for optimum working with domoticz
Due to the amount of lines and complexity in my scripts i am looking for some hybrid solution.
My lua scripts are segmented in functions that are called from time and device scripts.
The way i would love to go is to port function by function. But for that i need to call dzevent functions from plain lua.
After some trial and error i have a couple of questions :
- Is it possible to call a dzevents routine from plain lua and if so how to do that the right way ?
- Would it be possible to get return values from dzevents into plain lua?
next : has anyone done the port to dzevents and are there some tips how to do this the right way ?
What i found is :
https://www.domoticz.com/wiki/DzVents:_ ... _functions
From those links i learned that it is possible to create a dz function (or a function file) from within dzevents, like i have now with require.
Will it be possible to call a dzevent script (like a function) from a plain lua script ?
Has anyone managed to do so and maybe some practical example to start from ?
(Of course i will try and error on a dummy instance, but during the port i will be forced to implement this to production env.)
ps. I am not a coder at all, and just learned lua over the years ... (I'll hope i am able to manage the transition)
Many thanks in advance.
I am investigating to port a lot of big lua scripts to dzevents...
As far as i can see dzeventis i basic lua in a different way formatted for optimum working with domoticz
Due to the amount of lines and complexity in my scripts i am looking for some hybrid solution.
My lua scripts are segmented in functions that are called from time and device scripts.
The way i would love to go is to port function by function. But for that i need to call dzevent functions from plain lua.
After some trial and error i have a couple of questions :
- Is it possible to call a dzevents routine from plain lua and if so how to do that the right way ?
- Would it be possible to get return values from dzevents into plain lua?
next : has anyone done the port to dzevents and are there some tips how to do this the right way ?
What i found is :
https://www.domoticz.com/wiki/DzVents:_ ... _functions
From those links i learned that it is possible to create a dz function (or a function file) from within dzevents, like i have now with require.
Will it be possible to call a dzevent script (like a function) from a plain lua script ?
Has anyone managed to do so and maybe some practical example to start from ?
(Of course i will try and error on a dummy instance, but during the port i will be forced to implement this to production env.)
ps. I am not a coder at all, and just learned lua over the years ... (I'll hope i am able to manage the transition)
Many thanks in advance.