Announcement

Collapse
No announcement yet.

Insert the time a device changed state into body of email

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

    Insert the time a device changed state into body of email

    I am looking for the command to insert the time a device has changed its state, into the body of an email message.
    Using the command $$DSR:31:adds the 'State' of the device, but not sure how i can extract its time.
    Any advice would be great

    #2
    I use $date and $time in my emails. It's not the instant the device changes state but it is the second the event fires.
    Click image for larger version

Name:	Screen Shot 11-03-22 at 05.18 PM.png
Views:	119
Size:	30.0 KB
ID:	1573955

    Comment


      #3
      Thanks racerfern for your advice.
      I have come up with what I was after, but in a roundabout way:-

      Created a global variable 'device_time'
      Used the hs.SaveVar ("device_time",hs.DeviceLastChangeRef(31)) command to fill the variable with device last 'changed state' time
      Then place $$GLOBALVAR:device_time: within the email.
      It successfully reports the devices changed state time.​

      Comment


        #4
        gadget70 What is the time difference between the script and the event if you were to run both?

        Comment


          #5
          It wiil be several minutes or hours.
          The issue I have is the email is not sent on one device change state.
          Also I can incorporate several device state change times in one email.​

          Comment


            #6
            Got it, thanks.

            Comment

            Working...
            X