Announcement

Collapse
No announcement yet.

Virtual Device for Battery Replacement

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

    Virtual Device for Battery Replacement

    I am not a coder, but think I can tackle this, but wanted to get some ideas from others that might have already done this. I want to create a virtual device with just one button that updates the date when pressed. I can use this to know and keep track of the last time I replaced a battery in a device.

    Is there anyone already doing this that could share, or is there a better way of dealing with this? I really just want to see if I am truly getting the battery life I think and this would be an easy way to deal with it i think.

    #2
    This is simple and dirty, but how about a virtual device with a control of Reset and Not coupled with an event that changes it back to Not whenever you click or press on Reset. That would update the last change date each time you press Reset.

    You possibly could eliminate the Not control by using an immediate script to set the device value back to Not.
    .
    Attached Files
    HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

    Comment


      #3
      Not a script or separate device, but I use the Battery's Notes section to track battery replacement. Here's one Multisensor Battery device I have:
      Attached Files
      Last edited by rmasonjr; January 27, 2016, 03:36 PM. Reason: added screenshot
      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
        Thanks Guys, I didn't even know there was a notes section .

        Randy, I think I will do your idea that way I can just do it from my phone when doing the change.

        Thanks again.

        Comment


          #5
          Yeah, what I was going to suggest is a virtual device, along with a timer. When you click reset on the virtual device, it sets the virtual device to "OK" and sets the timer. As the timer gets closer to the date when it needs to be replaced, it'll set the virtual device to "low," etc.

          I'm going to be adding a similar virtual device for a filter changeover for the HVAC.

          Comment


            #6
            Ok so I combined a couple ideas with a script, I put together what I wanted. Again, I just wanted to have a button to click when I replaced a battery in a device so that I know when I did it last. I also wanted to be able to do this from HSTouch on my phone, and be able to view it from HSTouch (without having to use #script as it creates so many issues, and that is the only way to get last updated to show). I am not a coder at all, so be gentle as I hacked this together from other scripts , but it is working.

            I created this script (not sure if you can call it a script... just a couple of lines):
            Code:
            Sub Main(ByVal Parms As String)
            
            Dim ParmArray() As String = Split(Parms,",")
            
            Dim Device_ID As String = ParmArray(0)
            
            hs.SetDeviceString(Device_ID, Now, True)
            
            End Sub
            From there I created a virtual device with only a button called reset. I then created an event that passes the reference ID to the script whenever the reset button is pressed. You would have to create an event for each device you wanted to update this way and just change the device ID that gets passed in the parm section.

            There may be a cleaner way of doing this, but this worked with my limited skills and I can easily work with this from HSTouch.
            Attached Files

            Comment


              #7
              Seems a little complicated[emoji28]. I have been entering the new battery install date in the "notes" box for the device. It's pretty easy. I have about 40 battery operated devices. I don't think I want to add 40 more devices to HS3.


              Sent from my iPad using Tapatalk
              HomeSeer Version: HS3 Pro Edition 3.0.0.368, Operating System: Microsoft Windows 10 - Home, Number of Devices: 373, Number of Events: 666, Enabled Plug-Ins
              2.0.83.0: BLRF, 2.0.10.0: BLUSBUIRT, 3.0.0.75: HSTouch Server, 3.0.0.58: mcsXap, 3.0.0.11: NetCAM, 3.0.0.36: X10, 3.0.1.25: Z-Wave,Alexa,HomeKit

              Comment


                #8
                Yea it probably is, but part of my HA stuff is for me to learn new things. I also don't have that many devices (just 12 roughly). Also you can't touch the notes from HSTouch... I try to make it so I don't have to get into the web interface as much as possible to do things.

                Comment


                  #9
                  Wayne, I like the idea and thought process. This can be used for other things too like my chlorinator, salt for water softener, Ac filter, etc. Nice work!


                  Sent from my iPhone
                  Tom
                  baby steps...starting again with HS3
                  HS3Pro: Z-NET & 80 Z wave Devices,
                  HSTouch: 4 Joggler (Android Kitkat), 2 iPhone, 3 iPads
                  Whole House Audio: 5 SqueezePlay Jogglers w Bose Speakers
                  In The Works: 10 Cameras Geovision, new Adecmo/Envisalink Alarm, Arduinos
                  System: XP on Fanless Mini-ITX w/ SSD

                  Comment

                  Working...
                  X