Announcement

Collapse
No announcement yet.

tenHsPower plugin request

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

  • tenHsPower plugin request

    tenholde,

    I really like your tenHsPower plugin but was wondering if the value of "Last Power Restore" could be the retained value of when Power was last restored after a Power outage, rather than resetting after every Restart of Homeseer. In other words, retain the date and time just like "Last Power Failure" behaves.

    It's nice to keep the pairing so the duration of the outage can be determined, and for those of us that Restart Homeseer on a regular basis, that pairing is lost.

    Thank you in advance

    Dan

  • #2
    I'll try to look at it this week.

    tenholde
    tenholde

    Comment


    • #3
      http://www.tenholder.net/tenWare2/te...Downloads.aspx

      Version 3.2 is now available. Please let me know if it satisfies your request.

      tenholde
      tenholde

      Comment


      • #4
        Thank you tenholde!

        I've installed , but since I can't get to the plug for my UPC, I'll have to wait for a power outage (or flip my circuit breaker).I'll let you know...

        Comment


        • #5
          just unplug the UPS when you can.

          tenholde
          tenholde

          Comment


          • #6
            tenHolde, Version 3.2 is behaving the same. My Homeseer program is restarted at 2:22 AM every day, and as you can see that is the time showing for Power restored.
            Attached Files
            Last edited by ameridan; November 9th, 2010, 11:42 AM.

            Comment


            • #7
              Sorry about version 3.2 not working, ends up it is more complicated than you would think. Version 3.3 should work. Please let me know.

              http://www.tenholder.net/tenWare2/te...Downloads.aspx

              tenholde
              tenholde

              Comment


              • #8
                Thank you again tenholde! I installed 3.3 last night and will let you know the outcome next time my power is interupted.

                just unplug the UPS when you can.
                As I said before

                since I can't get to the plug for my UPC, I'll have to wait for a power outage (or flip my circuit breaker).

                Comment


                • #9
                  tenholde, the latest version appears to be perfect! Thank you.

                  [slightly off-topic] Can I ask what used to control the device string for "Last Power Restore", as I have another device that indicates when "Homeseer Restart" was last activated and would love for it to update itself when a Restart occurs without being manually triggered by my Restart Event

                  Comment


                  • #10
                    The plugin, before the current release, was initializing the internal variable for the UPS status to undefined, and then the next time it checked the UPS status, it was updating it to the actual value -- and therefore detecting that the value changed and updated the device holding the last change time. I changed the code to not initialize to undefined upon startup, but instead to obtain the current status during initialization, and avoiding setting the change time device every time HS started.

                    tenholde
                    tenholde

                    Comment


                    • #11
                      Thanx for the reply. So if I understand you, to the following Restart script:

                      sub main ()
                      hs.SetDeviceLastChange "z12", now
                      hs.SetDeviceString "z12", now
                      hs.Launch "Jon00RestartHS.exe"
                      end sub
                      I could simply add hs.DeviceStatus "z12", "17" ? Or do I need to modify the SetDeviceString some more? z12 is my "Last HomeSeer Restart" virtual device.

                      Comment


                      • #12
                        tenHsPower is a plugin that creates its own specific devices, and manages the value, status, and device string of each of the devices it creates. There is a tenHsPower device that contains within its Device String the last time the UPS was placed offline and another device that contains the last time the UPS was placed online. The references I made in my prior post were to internal processing within the plugin -- not sure how that might relate to what you are trying to accomplish.

                        tenholde
                        tenholde

                        Comment


                        • #13
                          Thank you tenholde,

                          It dawned on me that I could get the desired result (update for ALL restarts) by adding
                          hs.SetDeviceString "z12", now
                          to the startup script.

                          [end of off-topic]

                          Comment


                          • #14
                            log of power failures

                            Thank you again tenholde for the great plugin!

                            I decided it would be great to keep a log of what I consider to be too many power outages, so I wrote 3 small scripts to supplement this plugin.

                            For instance, the power failure event triggers the following:

                            ' This scripts is used to populate ini file with power failure events
                            ' Just fill in the HomeSeer "event_string" & "source_device" devicecode you want to use.
                            Const event_string = "POWER OFFLINE"
                            Const source_device = "\8" 'log string provided by tenHSpower plugin
                            Sub Main(Optional ByVal dummy As String = "")
                            dim new_name as String
                            ' Get the most recent event
                            new_name = hs.DeviceString(source_device)
                            ' Put the new event in the list
                            hs.SaveIniSetting("power_interupts",new_name,event_string,"p ower_interupts.ini")

                            End Sub
                            and another very similar for power restore.

                            the 3rd script simply writes the contents of the ini file to a device string every time the AC Line status comes back ONLINE:

                            ' This scripts is used to populate a device string with the power failure events
                            ' Just fill in the HomeSeer "destination_device" you want to use.
                            Const destination_device = "z22"
                            Sub Main(Optional ByVal dummy As String = "")
                            dim dev_string as String
                            dim section_items() as String
                            dim section as String
                            dim I as Integer
                            ' Get the current list of events from the INI file
                            section = hs.GetIniSection("power_interupts","power_interupts.ini")
                            section_items = Split(section,chr(0))
                            dev_string = ""
                            For I=0 to UBound(section_items)
                            Dim the_date_time As String
                            Dim the_name As String
                            the_date_time = hs.StringItem(section_items(I),1,"=")
                            the_name = hs.StringItem(section_items(I),2,"=")
                            if the_name = "POWER OFFLINE" then
                            dev_string = dev_string & "[img src=led-red.gif]" & the_name & " @ " & the_date_time & " [br]"
                            else
                            dev_string = dev_string & "[img src=led-green.gif]" & the_name & " @ " & the_date_time & " [br]"
                            end if
                            Next
                            hs.SetDeviceString(destination_device,dev_string)
                            End Sub
                            Sharing this in case someone else wants to add. The city is asking me to provide a log to present the problem to Detroit Edison, as they feel their generator for the city's water supply is kicking in too often and they can't generate a log.

                            already this week:
                            POWER OFFLINE @ 8/7/2011 10:29:00 PM
                            POWER ONLINE @ 8/8/2011 1:46:48 AM
                            POWER OFFLINE @ 8/9/2011 11:37:55 AM
                            POWER ONLINE @ 8/9/2011 11:38:00 AM

                            Comment


                            • #15
                              Another request - tenHsPower

                              The control box for AC Line Status device doesn't do anything when changed. My Status seems to stay on Offline when coming Online from a full discharge, and I was wondering whether you could have the Control box pulldown actually trigger a refresh or change to the status selected. The other alternative request would be to replace the status pulldown in the Control column with a simple Refresh button that would manually trigger the Refresh routine. Using the eval tool, I confirmed that the PC is reporting Online status, but the Status shown remains at Offline until a short power interuption triggers the Refresh.

                              Comment

                              Working...
                              X