Menu

send every minute the time

Help
Ronny H
2009-01-14
2012-12-14
  • Ronny H

    Ronny H - 2009-01-14

    Hi

    i try to send every minute the current time to the bus. It is no problem with this

            <object id="cur_date" gad="0/1/0" forcewrite="true" type="EIS4" init="persist">Current Date</object>
            <object id="cur_time" gad="0/1/1" type="EIS3" init="persist">Current Time</object>

           <rule id="time_date">
                <condition type="timer" trigger="true">
                    <every>60</every>
                </condition>
                <actionlist>
                    <action type="set-value" id="cur_time" value="now" />
                    <action type="set-value" id="cur_date" value="now" />
                </actionlist>
            </rule>

    My problem is, i want to send this time exactly with the system time on the 0 second from the minute. The rule i wrote here send every 60 seconds, thats good. For example: when i start linknx at 17:24 and 44 seconds, linknx sends the time always on the 44 second of every minute. How can i change this to the first second?

    Ronny

     
    • jef2000

      jef2000 - 2009-01-14

      Hi,

      I have not tested, but looking at the code, I think that simply using this could work:
      <rule id="time_date">
      <condition type="timer" trigger="true">
      <at />
      </condition>
      <actionlist>
      <action type="set-value" id="cur_time" value="now" />
      <action type="set-value" id="cur_date" value="now" />
      </actionlist>
      </rule>

      This can look a little bit strange, but if you understand that all values not specified are considered as wildcard.
      The following is true every day at 7am, 0 minutes and 0 seconds
      <at hour="7" min="0" />
      The following is true every hour, 0 minutes, 0 seconds
      <at min="0" />
      The following is true every minute, 0 seconds
      <at />

      I hope it will work

      Regards,

      Jean-François

       
    • Ronny H

      Ronny H - 2009-01-14

      Yes it works!

      Here a dump from the logfile
      -------------------------------------
      PersistentStorage: writing '2009-01-14' for object 'cur_date'
      TimerCondition evaluated as '0'
      PeriodicTask: rescheduled at 2009-1-14 11:18:0 (1231928280)
      Execute ShellCommandAction: /var/www/knxweb/rrd/insert.sh

      PersistentStorage: writing '2009-01-14' for object 'cur_date'
      TimerCondition evaluated as '0'
      PeriodicTask: rescheduled at 2009-1-14 11:19:0 (1231928340)
      Execute ShellCommandAction: /var/www/knxweb/rrd/insert.sh

      PersistentStorage: writing '2009-01-14' for object 'cur_date'
      TimerCondition evaluated as '0'
      PeriodicTask: rescheduled at 2009-1-14 11:20:0 (1231928400)
      Execute ShellCommandAction: /var/www/knxweb/rrd/insert.sh

      and so on
      -------------------------------------

      Thanks,

      Ronny

       

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.