Announcement

Collapse
No announcement yet.

Any chance of a trigger based on "last change" field?

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

    Any chance of a trigger based on "last change" field?

    I have been looking around the forums for a solution to trigger an event based on the 'last change' field, as opposed to a timer that is triggered by the 'value' or 'string' fields.

    Let me explain. It seems that the EasyTrigger "This device's value has NOT changed for exactly" trigger uses an internal timer in the plugin based on the value field.
    So if the device is updated with the exact same value logically it has not changed and the trigger condition remains true. But in actual fact the device has been updated.

    There are a few posts on people wanting to know if a device is not being updated or dead, irrespective of the value. Basically they want to use it as a heartbeat? The solutions all require writing scripts and conditions based on hs.devicelastchangeref(deviceRef). Although some of them work they are not as elegant as using a plugin trigger.

    Of course the "Do not update device last change time if device value does not change" property needs to be unchecked.

    What would be great is if easy trigger had a trigger based on 'last change'. Something like "if LAST CHANGE timestamp has NOT changed for XX". It would solve a few problems for a number of people.

    Thanks, Marty.
    iCore5 Win 10 Pro x64 SSD

    HS3 Pro Edition 3.0.0.435 Windows

    BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

    #2
    Dredging up an old post (one of many similar discussions):

    I just did some searching on the forum and EasyTrigger is frequently posed as the answer to "Trigger on device not updated" when in reality NOT CHANGED and NOT UPDATED (TIMESTAMP) are two very different things. I had setup an event a couple of days ago with EasyTrigger to monitor a Light Sensor device and send a Pushover message when (I thought) the device wasn't "updating". I received several Pushover messages within the days after and it finally dawned on me the message was being sent when the value was going to 0 at night. The value stays at 0 all night but is updated every 60 seconds by MQTT. The NOT CHANGED trigger just doesn't work in this scenario.

    An EasyTrigger timestamp based trigger would be nice as well.

    Until that might occur I'll have to use Randy's scripting example using hs.DeviceTime() which is perfect because it returns an integer in minutes since last update.

    Thanks for considering this trigger. I'm guessing other people have used the Not Changed trigger thinking it's the same and have had "gremlins" like me when a value stays stagnent for some time.

    Comment


      #3
      Originally posted by mterry63 View Post
      Until that might occur I'll have to use Randy's scripting example using hs.DeviceTime() which is perfect because it returns an integer in minutes since last update.
      Here's the scripting example.

      Comment


        #4
        That thread discusses both an Easy Trigger solution and the script that @rprade posted. They are not the same solution; just pointing that out. Easy Trigger only triggers if the value never changes. Randy's solution triggers if the update timestamp on a device doesn't change for xx minutes.

        Comment

        Working...
        X