Menu

Date time comparaison

Help
Ben
2009-12-12
2012-12-14
  • Ben

    Ben - 2009-12-12

    Hi all,

    How could I do a rule condition like this "if time is greater than 6 pm then…" ?

    Thanks,
    Ben

     
  • Othmar

    Othmar - 2009-12-12

    I do it like that:

            <condition type="timer" trigger="true" >
              <at hour="18" min="0" />
              <until hour="23" min="59" />
            </condition>

     
  • Ben

    Ben - 2009-12-13

    Ok, thanks.

    Is it possible using LUA scripting (linknx 1.26) ?

     
  • Othmar

    Othmar - 2009-12-13

    Yes, I think so. I've compiled without so I have no experience with it.

     
  • jef2000

    jef2000 - 2009-12-13

    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

     
  • Ben

    Ben - 2009-12-14

    Hi Jean-François,

    I'll give you my feedback about LUA conditions.

    Thanks for your help.

    Ben

     
  • Ben

    Ben - 2009-12-18

    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

     
  • Ben

    Ben - 2009-12-19

    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

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.