Announcement

Collapse
No announcement yet.

How can I use the time stamp on a device in an event ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How can I use the time stamp on a device in an event ?

    I am using virtual devices to track some battery powered devices wake up time. Their wake up interval is set to 6 minutes. I am turning a virtual device on on wake up ( I am catching this with Ultralog), the turning the virtual device off again. If the virtual device has been off for 1 hour, I send a pushover message.
    What I have now is the virtual devices are normally off, and I have to look at the time stamp when the last wake up was. I want the virtual devices to be on, and only go off after no wake up for 1 hour. But its not as easy as it first sounds. I cannot configure anything where I could say if last timestamp is older than 1 hour... or is there somewhere ?

    This is my current solution:
    Attached Files

    #2
    Its probably simpler to use scripting if you have a lot of devices to deal with but could you make use of delayed event actions?

    If Node "X" wakes up
    THEN
    Remove delayed events for Virtual Awake Device "Y"
    THEN
    Set Virtual Awake Device"Y" to ON
    THEN
    Set Virtual Awake Device"Y" to OFF after a delay of 1 hour

    Paul..

    Comment


      #3
      I understand the logic and that would work. At the moment I only have 6 devices I am monitoring but I want to extend that to all my battery devices. HOW would I do that with a script ?

      Comment


        #4
        Originally posted by mikee123 View Post
        I understand the logic and that would work. At the moment I only have 6 devices I am monitoring but I want to extend that to all my battery devices. HOW would I do that with a script ?
        I do something similar with a script that I run every hour via a recurring event that calculates the elapsed time since last change of about 25 devices. If any are over "N" time then it constructs a string message of all such devices which is then emailed, although I suppose it could also be sent as a pushover message.

        The script is quite bespoke (or should that me messy?) but I could make it more generic if you're interested.

        Paul..

        Comment


          #5
          Yes I would be interested as I could extend it at a later stage to include more devices I could have the Script send emails instead of pushover messages, whatever is easier. You did configure a script for me to send camera pictures via email, so it's probably easier to recycle that instead of trying to configure pushover.

          Comment

          Working...
          X