Announcement

Collapse
No announcement yet.

hs.DeviceLastChange help

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

    hs.DeviceLastChange help

    Hi all,

    I have a script that's calling hs.DeviceLastChange, but it seems to only return the time as 12:00AM, if I look at the properties of the device it correctly shows the date/time of the last change.

    Using the example in the HS Doco below, any idea how to return the correct date/time?

    Code:
    Dim last_change As Date
    last_change = hs.DeviceLastChange("living room lamp")
    Cheers

    #2
    We discussed this last week. It appears that hs.DeviceLastChange("living room lamp") isn't working and should be reported as a bug. You can however use hs.DeviceLastChangeRef(5678) where 5678 is the reference ID of the device.
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Is this happening on the latest version? There was a change to optionally update the device's time on a poll?

      Sent from my SCH-R970X using Tapatalk
      HS4Pro on a Raspberry Pi4
      54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
      Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

      HSTouch Clients: 1 Android

      Comment


        #4
        Originally posted by Rupp View Post
        We discussed this last week. It appears that hs.DeviceLastChange("living room lamp") isn't working and should be reported as a bug. You can however use hs.DeviceLastChangeRef(5678) where 5678 is the reference ID of the device.
        Thanks Rupp!

        Comment


          #5
          Still not working

          It appears this is still not working with build 3.0.0.368. Both DeviceLastChange and DeviceLastChangeRef are still returning Monday, January 1, 0001 12:00 AM.

          Comment


            #6
            I just tested it in a script and it works for me correctly

            Comment


              #7
              Originally posted by prsmith777 View Post
              I just tested it in a script and it works for me correctly
              I was using it in a script too. The device was created by the UltraWeatherWU plug-in. Maybe that's the issue.

              Comment


                #8
                Does the device show the device last change time correctly in the homeseer webpage?

                Comment


                  #9
                  Normal devices OK - UltraWeather3WU NSM

                  Originally posted by prsmith777 View Post
                  Does the device show the device last change time correctly in the homeseer webpage?
                  Yes it does. It appears to be the UltraWeatherWU plugin-created devices that is causing this. Other devices are fine.

                  Comment


                    #10
                    Maybe try changing this setting under device configuration and see if that helps:

                    Do not update device last change time
                    if device value does not change:

                    Comment


                      #11
                      My fault

                      Originally posted by prsmith777 View Post
                      Maybe try changing this setting under device configuration and see if that helps:

                      Do not update device last change time
                      if device value does not change:
                      Just found the issue. Was using hs.GetDeviceRef instead of hs.GetDeviceRefByName. Didn't complain but probably should have.

                      Sorry for all the confusion.

                      Comment

                      Working...
                      X