in your LUA code.
Be careful that lua conditions doesn't trigger the evaluation of the rule, so you'll have to combine the lua condition to another condition (object, timer, io-port, …) that has trigger='true'
If you have used LUA and have some feedback on it, please tell me because I didn't have much time to use it since I implemented the lua support. I feel that there's still something missing, especially regarding the lua condition triggering, but don't see very clearly what would be the best solution.
Regards,
Jean-François
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm still testing date time condition in linknx rules…
But linknx crashes each time I try using sunrise and sunset conditions.
I think it's exactly the same problem described by "fivesails" in a previous topic.
According you, is it possible to manipulate sunrise and sunset values in LUA scripting ? I'm qui interesting to test it !
Thanks again for your job.
Ben
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
How could I do a rule condition like this "if time is greater than 6 pm then…" ?
Thanks,
Ben
I do it like that:
<condition type="timer" trigger="true" >
<at hour="18" min="0" />
<until hour="23" min="59" />
</condition>
Ok, thanks.
Is it possible using LUA scripting (linknx 1.26) ?
Yes, I think so. I've compiled without so I have no experience with it.
Hi,
You can use:
if os.date("*t").hour >= 18 then
in your LUA code.
Be careful that lua conditions doesn't trigger the evaluation of the rule, so you'll have to combine the lua condition to another condition (object, timer, io-port, …) that has trigger='true'
If you have used LUA and have some feedback on it, please tell me because I didn't have much time to use it since I implemented the lua support. I feel that there's still something missing, especially regarding the lua condition triggering, but don't see very clearly what would be the best solution.
Regards,
Jean-François
Hi Jean-François,
I'll give you my feedback about LUA conditions.
Thanks for your help.
Ben
Hi Jean-François,
I'm still testing date time condition in linknx rules…
But linknx crashes each time I try using sunrise and sunset conditions.
I think it's exactly the same problem described by "fivesails" in a previous topic.
According you, is it possible to manipulate sunrise and sunset values in LUA scripting ? I'm qui interesting to test it !
Thanks again for your job.
Ben
Hi Jean-François,
Adding "<logging format="simple" />" configuration do not solve the problem…
I use the linknx synoware version on my ds207+.
I keep testing…
Regards,
Ben