Announcement

Collapse
No announcement yet.

Issue understanding Laston and Firston.

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

    Issue understanding Laston and Firston.

    I'm trying to figure out why I haven't been able to get some of my udmc to trigger as expected. I'm trying to understand the sensor.firston, sensor.laston, sensor.lastoff relationship. My thought was that the first Firston would be reset once the sensor received an off command. And in fact sometimes it does appear that firston, laston are the same, but I have some debugging setup in a few devices and here is one example.

    The device received an off on the 13th at 10:03 am:
    2/13/2015 10:03:33 AM, Type=BLRF X10, Message=H5 (Garage Dads Car) OFF

    It didn't receive anything new until a couple days later when it received its next on. I assumed that the laston, firston would be the same time since the off had been received a few days earlier, but:

    2/15/2015 6:06:16 PM, Type=BLRF X10, Message=H5 (Garage Dads Car) ON
    2/15/2015 6:06:16 PM, Type=*** DEBUG ***, Message=DateDiff Last->First -56433
    2/15/2015 6:06:16 PM, Type=*** DEBUG ***, Message=DateDiff First->Last 56433
    2/15/2015 6:06:16 PM, Type=*** DEBUG ***, Message=LastOn=2/13/2015 9:54:14 AM
    2/15/2015 6:06:16 PM, Type=*** DEBUG ***, Message=LastOff=2/13/2015 10:03:33 AM
    2/15/2015 6:06:16 PM, Type=*** DEBUG ***, Message=FirstOn=2/12/2015 6:13:41 PM
    2/15/2015 6:06:16 PM, Type=*** DEBUG ***, Message=DateDiff laston & now 3372
    2/15/2015 6:06:16 PM, Type=*** DEBUG ***, Message=DateDiff last on, firston = -56433

    Also here is the debug code that created the above output:

    hs.Writelog("*** DEBUG ***", "DateDiff Last->First " & DateDiff("s", Sensor.LastOn, Sensor.FirstOn))
    hs.Writelog("*** DEBUG ***", "DateDiff First->Last " & DateDiff("s", Sensor.FirstOn, Sensor.LastOn))
    hs.WriteLog("*** DEBUG ***", "LastOn=" & Sensor.LastOn)
    hs.WriteLog("*** DEBUG ***", "LastOff=" & Sensor.LastOff)
    hs.WriteLog("*** DEBUG ***", "FirstOn=" & Sensor.FirstOn)
    hs.Writelog("*** DEBUG ***", "DateDiff laston & now " & Datediff(DateInterval.Minute, Sensor.laston, Datetime.now))
    hs.Writelog("*** DEBUG ***", "DateDiff last on, firston = " & Datediff(Dateinterval.second, Sensor.laston, Sensor.Firston))

    It shows that the Laston, firston show the times from when the sensor triggered several days previous and not the current event. Am I not understanding how and when laston, firston are getting updated and are supposed to be used. If anyone could shed some light on this it would be helpful.

    Thanks,
    Jeff

    #2
    FirstOn is the date/time of the first ON after an OFF
    LastOn is the date/time of the last ON

    FirstOn and LastOn would be the same after the first ON after an OFF

    I am also using BLRF and BLRadar and my UDMC code is running well for me. I rely on my UDMC a lot as it is main key to my HS3 system since it controls most of the lights going on and off based on motion.

    Are you running the newest builds from the HS3 updater?
    Cheers,
    Bob
    Web site | Help Desk | Feature Requests | Message Board

    Comment


      #3
      Thanks for responding. Yes I do have the most recent versions of BLRF and BLRadar installed. I just went through my logs again to make sure I had a more recent example. Here is one from a couple days ago:


      2/18/2015 4:40:09 PM, Type=BLRF X10, Message=H5 (Garage Dads Car) OFF

      2/18/2015 8:07:57 PM, Type=BLRF X10, Message=H5 (Garage Dads Car) ON
      2/18/2015 8:07:57 PM, Type=*** DEBUG ***, Message=DateDiff Last->First -89954
      2/18/2015 8:07:57 PM, Type=*** DEBUG ***, Message=DateDiff First->Last 89954
      2/18/2015 8:07:57 PM, Type=*** DEBUG ***, Message=LastOn=2/18/2015 4:31:51 PM
      2/18/2015 8:07:57 PM, Type=*** DEBUG ***, Message=LastOff=2/18/2015 4:40:09 PM
      2/18/2015 8:07:57 PM, Type=*** DEBUG ***, Message=FirstOn=2/17/2015 3:32:37 PM
      2/18/2015 8:07:57 PM, Type=*** DEBUG ***, Message=DateDiff laston & now 216
      2/18/2015 8:07:57 PM, Type=*** DEBUG ***, Message=DateDiff last on, firston = -89954

      Does the Firston, Laston get updated before the UDMC should run I assume? The debug code is the first thing that I have trigger in the UDMC. What's strange is here is another example where I don't have an Off coming from the H5 sensor and in this case the firston, laston match which is more in line of what I expected.

      2/18/2015 8:08:20 PM, Type=BLRF X10, Message=H5 (Garage Dads Car) ON

      2/19/2015 3:37:29 PM, Type=BLRF X10, Message=H5 (Garage Dads Car) ON
      2/19/2015 3:37:29 PM, Type=*** DEBUG ***, Message=DateDiff Last->First 0
      2/19/2015 3:37:29 PM, Type=*** DEBUG ***, Message=DateDiff First->Last 0
      2/19/2015 3:37:29 PM, Type=*** DEBUG ***, Message=LastOn=2/18/2015 8:07:57 PM
      2/19/2015 3:37:29 PM, Type=*** DEBUG ***, Message=LastOff=2/18/2015 4:40:09 PM
      2/19/2015 3:37:29 PM, Type=*** DEBUG ***, Message=FirstOn=2/18/2015 8:07:57 PM
      2/19/2015 3:37:29 PM, Type=*** DEBUG ***, Message=DateDiff laston & now 1169
      2/19/2015 3:37:29 PM, Type=*** DEBUG ***, Message=DateDiff last on, firston = 0

      I forgot to mention that I do have the "Sensor Recovery Time" turned off for these devices as they are used to track the car's being home or not.

      Jeff

      Comment


        #4
        Originally posted by cerjzc View Post
        Does the Firston, Laston get updated before the UDMC should run I assume?
        I will check this and let you know.
        It may be updating them after the UDMC code. Will confirm.
        Cheers,
        Bob
        Web site | Help Desk | Feature Requests | Message Board

        Comment

        Working...
        X