Announcement

Collapse
No announcement yet.

Simple Counter

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

    Simple Counter

    I would like to be able to count how many times various things have been used. Front Door lock, doorbell, shower etc.

    I thought it would be easy. But so far I have had no success. I wanted a virtual device to increase by 1 each time. Can someone please point me in the right direction.

    It would be really nice if this value was saved somewhere so after a restart it would continue counting from the previous value.

    Thanks

    Tim Warner

    #2
    Tim,
    I use several of these and if you set the setDeviceString function you should be able to keep count of any thing and not need to worry about storing it because HS keeps up with saving the device strings. So something like this :
    'This is for the first time that this is ran and it's zero...
    on error resume next
    iCurrCount = cint(hs.DeviceString ("A1"))
    iNewCount = cint(iCurrCount) + 1 ' or what ever you want to add...
    hs.setDeviceString "A1", iNewCount

    This is untested but should give you the idea.
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      You may have to put an initial value into A1 for this to function the first time.


      ~Bill

      Comment

      Working...
      X