Announcement

Collapse
No announcement yet.

Trigger event on no change on device timestamp not changed for x minutes

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

  • rprade
    replied
    Originally posted by mikee123 View Post
    Sometimes my motion sensor stops working and needs a power cycle to start working again. I noticed that very often when it stops detecting motion, it also has stopped reporting luminance. So I could use a trigger where if the timestamp has not been changed for x minutes... then I can use a on/off module to power cycle automatically (I do that manually now). I had a look in easytrigger, I thought there was a condition there but cant find it. I cannot use if the value hasnt changed for x time, as at night its stuck on 2 Lux for a long time, but I think the time stamp still changes
    I use a simple script to monitor the temperature sensors for my heating system. If the timestamp updates even if the value is not changed, this should work.
    Code:
    Sub Main(ByVal Parm As Object)
    
        Try
            Dim ListOfDevices() As Integer = {280, 278, 270, 269, 137, 89, 136, 134, 122, 125, 134, 133, 124}
        'Boiler Supply, Boiler Return, BP S, BP R, LR S, LR R, MBR S, MBR R, RO S, RO R, MO S, MO R
    
            For Each Device As Integer In ListOfDevices
                If hs.DeviceTime(Device) > 45 Then
                     hs.triggerevent("Bump heating valves")
                End If
    
                If hs.DeviceTime(Device) > 50 Then
                     hs.writelog("Sensor Error", “”& hs.DeviceName(Device) & " has not updated in over " & hs.DeviceTime(Device) & " minutes")
                End If
            Next
    
        Catch ex As Exception : hs.writelog("DeviceLastChange", "Error: " & ex.message)
        End Try
    
    End Sub
    At the top ListOfDevices is an array of the RefIDs I want to check. If the device time stamp has not updated in 45 minutes, I trigger an Event. If it has been over 50 minutes, I write a log message. The script runs once a minute on a recurring Trigger. You should be able to modify this to do what you need.

    Leave a comment:


  • Michel
    replied
    Nice sensor. First time I see it.
    - Could it be a parameter that you have set differently on the Garden unit as opposed to the Garage one?
    - Do both unit have the same Firmware? Maybe there is a newer firmware available?

    Leave a comment:


  • mikee123
    replied
    The motion sensor is a mains powered Steinel IS140 Z-Wave. I have the same sensor not far away on my garage, never had an issue. I thought it was a faulty sensor, so I swapped it for a new one. Stuck after just a day... weird.
    Even more strange. The sensor has a z-wave controllable switch. That still reacts. Just the motion sensor does not report any movement any more until I power cycle.

    Attached Files

    Leave a comment:


  • Michel
    replied
    Originally posted by mikee123 View Post
    Now I need to try to find out what time of no change I should use to reboot the sensor. At the moment I am only sending notifications on 10 minutes no change.
    Of course finding the root cause of your device freezing would be even better. Just curious... what brand and model?

    As far as "what time..." I'm not clear about what you mean for "I am only sending notifications on 10 minutes no change".

    The one I use is an Aeon Multi-sensor 6 (Powered). It report every few seconds so let's say the time stamp changes +/- every 5 Sec. I would probably start to worry if the timer reaches >15 Sec. It depends on how critical the application is.

    Leave a comment:


  • tenholde
    replied
    I run a script every ten minutes that check all kinds of things and perform automation tasks. This allows me to simulate events that do not exist in HS3. If cheap RF temp sensor enters a range, turn floor heat on, etc. If garage door has been open for more than 30 minutes, announce message on sonos speakers and leave notification on Alexa speakers. You could do same here, checking if the datetime of device is older than xxx seconds.

    Leave a comment:


  • mikee123
    replied
    Yes that should work. Then trigger the timer. My brain is not switched on today I think

    It does work. Just set up the event and timer. Now I need to try to find out what time of no change I should use to reboot the sensor. At the moment I am only sending notifications on 10 minutes no change. Lets see how that works. Trial and error now trying to find the sweet spot

    Leave a comment:


  • Michel
    replied
    Originally posted by mikee123 View Post
    The problem is at night (2 Lux) or when its bright during the day (2000 lux) the device value does not change. But the time stamp updates.
    But it is still perceived as a "Change" I would try the regular HS "If A device value is... / This device just had its value set or changed" Just tried it with my Aeon UV reading and even if it is sitting at zero, the event is triggered every few seconds

    Leave a comment:


  • mikee123
    replied
    The problem is at night (2 Lux) or when its bright during the day (2000 lux) the device value does not change. But the time stamp updates.

    Leave a comment:


  • Michel
    replied
    Others may come-up with a shorter path but what if you used a Timer and reset it every-time the Device changes. If your sensor stops updating then your timer will keep incrementing beyond a per-determined value based on your reporting times.

    Leave a comment:


  • Trigger event on no change on device timestamp not changed for x minutes

    Sometimes my motion sensor stops working and needs a power cycle to start working again. I noticed that very often when it stops detecting motion, it also has stopped reporting luminance. So I could use a trigger where if the timestamp has not been changed for x minutes... then I can use a on/off module to power cycle automatically (I do that manually now). I had a look in easytrigger, I thought there was a condition there but cant find it. I cannot use if the value hasnt changed for x time, as at night its stuck on 2 Lux for a long time, but I think the time stamp still changes
Working...
X