Announcement

Collapse
No announcement yet.

Enhanced Maximum Uptime Discussion

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

    Enhanced Maximum Uptime Discussion

    The ZIP containing the script is located here:
    http://board.homeseer.com/showthread.php?t=151139
    Real courage is not securing your Wi-Fi network.

    #2
    I've completely re-written this script from scratch.
    The resulting file is one third the size of the previous version and runs much more quickly. Recurring triggers down to 5 seconds have been successfully tested.

    Includes all of the options and functions of previous versions as well as adds a few more.
    - Tracks Current Uptime in real time
    - Optionally tracks Previous run Uptime per session
    - Optionally tracks Overall maximum uptime in real time
    - Optionally tracks Maximum no fault uptime in real time
    - Optionally tracks Maximum faulted uptime per session
    - Optionally tracks Average Homeseer runtime (Real time or per session)
    - Optionally records session logs for analysis (perhaps with Excel)
    - Current time device status can be used to delay triggering of events after Homeseer startup for a predefined period of time
    Real courage is not securing your Wi-Fi network.

    Comment


      #3
      For the benefit of anyone using this, I've just realized there may be a small error in my calculations when using the Running Average (dynamic) option.
      I've either got to simulate a few sessions or wait until HS crashes on me to be sure. If history repeats itself, HS won't last much longer before I need to restart anyway.
      If I prove to be right about this I'll fix the problem in the next day or so.
      Session averaging (the original method) is not affected.
      Also, I didn't like the "(running average)" text in the string so I'll be removing that.
      Real courage is not securing your Wi-Fi network.

      Comment


        #4
        Couldn't sleep last night knowing the problem existed, so I stayed up and fixed my faux pas. I found a possibility of writing to non existent devices when certain combinations of devices were selected as well.
        It's all fixed.
        If you downloaded this script in the last couple of days, all you need do is replace the Maximum Uptime.vb file in your scripts directory. This can be done while HS is running without interruption.

        The dynamic average uptime will now be accurate.
        Real courage is not securing your Wi-Fi network.

        Comment


          #5
          Will it never end?
          A forced shutdown revealed a problem with Maximum No Fault time.
          Fixed as of now. Simply replace the .vb file and you're good.
          Real courage is not securing your Wi-Fi network.

          Comment


            #6
            Done and Thank you Greg!
            - Pete

            Auto mator
            Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
            Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
            HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

            HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
            HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

            X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

            Comment


              #7
              The script currently updates the Max NoFault time when the current time manages to exceed it. I realized today this might not actually be desirable, as, when HS subsequently crashes, this max no fault time will not actually be accurate any longer. In effect Faulted and NoFault times would end up being the same value on restart. I've fixed this and will likely post tomorrow. Other than that, I think it's a done deal.
              Real courage is not securing your Wi-Fi network.

              Comment


                #8
                Yes; I had a reboot at 3 AM this morning and the up time was not recorded. Not an issue.

                Today disabling HSTouch server on a lark to see what my run time will be with V.60.

                Side note:

                We had temps here down to around 33F over night. That said though we moved the two larger plants (in > 100lb pots) indoors around midnight last night.

                I still have one ladder endeavor that I want to complete before we start to get snow here. This is moving the Davis weather station up to roof level.
                - Pete

                Auto mator
                Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
                Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
                HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

                HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                Comment


                  #9
                  Which time wasn't recorded? The previous or the max faulted? I've had many restarts lately and haven't noticed that type of problem.
                  The more info the better because I want to be sure this is working properly before I move on to other projects.
                  Do you have the required lines in startup.txt and shutdown.txt?
                  Real courage is not securing your Wi-Fi network.

                  Comment


                    #10
                    It looks like the current up time and previous up time didn't update when HS rebooted at 3 AM.

                    Sorry Greg; just noticed everything is configured in the INI now. Will update. I didn't read the readme and had all of about 3 minutes to install yesterday (WAF thing).
                    Updated the two machines just now. I also just disabled HSTouch on machine #1 and restarted it to test out V.60 without HS Touch server running.

                    Yes I left everything the same just dropping the new script in place. (per your instructions earlier and I was in a rush yesterday?)

                    Attached is a snapshot of the variables, INI file and start/shutdown scripts.

                    Maxuptime ini file shows: (BTW current is correct but not reflected in variable).

                    [Data]
                    Current=0 Days 4 Hours 36 Minutes 8 Seconds
                    CurrentTime=10/6/2012 7:46:10 AM
                    MaxOverall=1 Day 16 Hours 32 Minutes 56 Seconds
                    MaxNoFault=1 Day 16 Hours 32 Minutes 56 Seconds
                    HSVersion=2.5.0.60
                    Faulted=True
                    Edited INI file such that it shows:

                    [Configuration]
                    CurrentDC = Y40
                    PreviousDC = Y41
                    MaxOverallDC = Y42
                    MaxNoFaultDC = Y43
                    MaxFaultDC = Y44
                    MeanTimeDC = Y45
                    EnableHSLog = False
                    EnableHistLog = True
                    RunsToAverage = 5
                    MinSaveTime = 180
                    EnableTime = 5
                    RunningMean = True

                    [Data]
                    Current=0 Days 4 Hours 51 Minutes 26 Seconds
                    CurrentTime=10/6/2012 8:01:28 AM
                    MaxOverall=1 Day 16 Hours 32 Minutes 56 Seconds
                    MaxNoFault=1 Day 16 Hours 32 Minutes 56 Seconds
                    HSVersion=2.5.0.60
                    Faulted=True
                    Attached Files
                    Last edited by Pete; October 6, 2012, 08:16 AM.
                    - Pete

                    Auto mator
                    Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
                    Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
                    HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

                    HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                    HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                    X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                    Comment


                      #11
                      I think perhaps something is missing. Perhaps you updated from an earlier version than intended. My config looks like:
                      Code:
                      [Configuration]
                      CurrentDC = S1 
                      PreviousDC = S2
                      MaxOverallDC = 
                      MaxNoFaultDC = S3
                      MaxFaultDC = S4
                      MeanTimeDC = S5
                      EnableHSLog = False
                      EnableHistLog = True 
                      RunsToAverage = 10
                      MinSaveTime = 180
                      EnableTime = 10
                      RunningMean = True
                      [Data]
                      HSVersion=2.5.0.60
                      CurrentTime=10/6/2012 10:11:29 AM
                      Faulted =True
                      Current =0 Days 18 Hours 12 Minutes 54 Seconds
                      MaxOverall =5 Days 13 Hours 34 Minutes 21 Seconds
                      MaxFAULT =5 Days 13 Hours 34 Minutes 21 Seconds
                      MaxNoFault=0 Days 17 Hours 23 Minutes 24 Seconds
                      MeanUpTime =2 Days 11 Hours 58 Minutes 19 Seconds
                      NumRuns =5
                      The original file from the zip:

                      Code:
                      [Configuration]
                      CurrentDC = S1 
                      PreviousDC = S2
                      MaxOverallDC = 
                      MaxNoFaultDC = S3
                      MaxFaultDC = S4
                      MeanTimeDC = S5
                      EnableHSLog = False
                      EnableHistLog = True 
                      RunsToAverage = 5
                      MinSaveTime = 180
                      EnableTime = 5
                      RunningMean = True
                      [Data]
                      HSVersion=
                      CurrentTime=
                      Faulted =
                      Current =
                      MaxOverall =
                      MaxNoFault =
                      MaxFAULT =
                      MeanUpTime =
                      NumRuns =1
                      You also need in startup.txt:
                      Code:
                        ' Max Uptime
                        hs.Transmit "System Performance Current UpTime","Off"  
                        hs.RunScriptEX "Maximum Uptime.vb","FirstRun",""
                      and in shutdown.txt

                      Code:
                        'MaxUptime
                        hs.RunScriptEX "Maximum Uptime.vb","LastRun",""
                      .
                      .
                      EDIT:
                      AND I've just noticed another problem. In startup, use the device code, not the device name. In my case, this will be hs.Transmit("S1","Off)
                      I'll update the docs on that. Sorry.
                      .
                      .
                      Attached Files
                      Real courage is not securing your Wi-Fi network.

                      Comment


                        #12
                        Changed startup script to read:

                        'Wadenut Uptime

                        hs.Transmit ("Y40","Off")
                        hs.RunEX "MaximumUptime.vb","FirstRun",""
                        Changed INI (using old data still) to:

                        [Configuration]
                        CurrentDC = Y40
                        PreviousDC = Y41
                        MaxOverallDC = Y42
                        MaxNoFaultDC = Y43
                        MaxFaultDC = Y44
                        MeanTimeDC = Y45
                        EnableHSLog = False
                        EnableHistLog = True
                        RunsToAverage = 5
                        MinSaveTime = 180
                        EnableTime = 5
                        RunningMean = True

                        [Data]
                        HSVersion=2.5.0.60
                        CurrentTime=10/6/2012 8:32:20 AM
                        Faulted =
                        Current=0 Days 0 Hours 15 Minutes 32 Seconds
                        MaxOverall=1 Day 16 Hours 32 Minutes 56 Seconds
                        MaxNoFault=1 Day 16 Hours 32 Minutes 56 Seconds
                        MaxFAULT =
                        MeanUpTime =
                        NumRuns =1
                        Shut down HS, edited startup.txt and INI and restarted HS.

                        Got an error with startup txt on boot:

                        10/6/2012 8:44:13 AM Error Running script, script run or compile error in file: startup.txt1044:Cannot use parentheses when calling a Sub in line 49 More info: Cannot use parentheses when calling a Sub
                        I will remove parentheses and restart.

                        'Wadenut Uptime

                        hs.Transmit "Y40","Off"
                        hs.RunEX "MaximumUptime.vb","FirstRun",""
                        - Pete

                        Auto mator
                        Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
                        Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
                        HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

                        HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                        HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                        X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                        Comment


                          #13
                          OK. Look at the config while HS is running. The "Faulted" key should be reading "True"

                          Note, the MinSaveTime key will prevent the Max and average devices being updated until HS has been running for at least, in this case, 180 minutes.

                          Re: The error. That's a bad habit of mine too. I seldom if ever use VB. I'm strictly vb dot net.
                          Last edited by Wadenut; October 6, 2012, 08:58 AM.
                          Real courage is not securing your Wi-Fi network.

                          Comment


                            #14
                            OK.

                            Rebooted

                            startup Log shows:

                            10/6/2012 8:53:02 AM - Device Control - Command sent to Virtual - Performance Current Up Time: Y40 Off Dimval: 0 Data: 0
                            10/6/2012 8:53:02 AM - Device Control - Command sent to Virtual - Performance Current Up Time: Y40 Off Dimval: 0 Data: 0
                            and INI file shows:

                            [Configuration]
                            CurrentDC = Y40
                            PreviousDC = Y41
                            MaxOverallDC = Y42
                            MaxNoFaultDC = Y43
                            MaxFaultDC = Y44
                            MeanTimeDC = Y45
                            EnableHSLog = False
                            EnableHistLog = True
                            RunsToAverage = 5
                            MinSaveTime = 180
                            EnableTime = 5
                            RunningMean = True

                            [Data]
                            HSVersion=2.5.0.60
                            CurrentTime=10/6/2012 8:52:49 AM
                            Faulted =True
                            Current=0 Days 0 Hours 0 Minutes 45 Seconds
                            MaxOverall=1 Day 16 Hours 32 Minutes 56 Seconds
                            MaxNoFault=1 Day 16 Hours 32 Minutes 56 Seconds
                            MaxFAULT =
                            MeanUpTime =
                            NumRuns =1
                            Variables show:

                            0 Days 0 Hours 0 Minutes 45 Seconds Virtual - Performance Current Up Time Y40 Status Only Today 8:53:02 AM
                            0 Days 0 Hours 0 Minutes 45 Seconds Virtual - Performance Previous Up Time Y41 Status Only Today 8:52:49 AM
                            4 Days 15 Hours 30 Minutes 29 Seconds Virtual - Performance Maximum Overall Up Time Y42 Status Only 8/31/2012 9:09:38 PM
                            4 Days 15 Hours 30 Minutes 29 Seconds Virtual - Performance Maximum No Fault Up Time Y43 Status Only 8/31/2012 9:09:38 PM
                            4 Days 15 Hours 30 Minutes 29 Seconds Virtual - Performance Maximum Faulted Up Time Y44 Status Only 8/31/2012 9:09:38 PM
                            0 Days 0 Hours 0 Minutes 45 Seconds Virtual - Performance Average Up Time Y45 Status Only Today 8:52:49 AM
                            Need to update HS box #2. Think I will add the rest of the maxuptime variables to the status page.
                            - Pete

                            Auto mator
                            Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
                            Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
                            HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

                            HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                            HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                            X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                            Comment


                              #15
                              Just noticed that I also had an uptime.ini file in config directory. I want to save my old max uptime numbers.

                              BTW I have kept the old script name of: MaximumUptime.vb instead of using the newer script name of: Maximum Uptime.vb (non issue eh?)

                              Copied over the data from that INI file to the new ini file first; then removed it.

                              [Configuration]
                              CurrentDC = Y40
                              PreviousDC = Y41
                              MaxOverallDC = Y42
                              MaxNoFaultDC = Y43
                              MaxFaultDC = Y44
                              MeanTimeDC = Y45
                              EnableHSLog = False
                              EnableHistLog = True
                              RunsToAverage = 5
                              MinSaveTime = 180
                              EnableTime = 5
                              RunningMean = True

                              [Data]
                              HSVersion=2.5.0.60
                              CurrentTime=10/6/2012 8:32:20 AM
                              Faulted =
                              Current=0 Days 0 Hours 15 Minutes 32 Seconds
                              MaxOverall=13 Days 15 Hours 41 Minutes 26 Seconds
                              MaxNoFault=13 Days 15 Hours 41 Minutes 26 Seconds
                              MaxFAULT =13 Days 15 Hours 41 Minutes 26 Seconds
                              MeanUpTime =2 Days 10 Hours 33 Minutes 25 Seconds
                              NumRuns =7
                              Going back to HSPro box and doing the same; IE: copying the data from uptime.ini file over to maxuptimeini file.

                              Shut down HSPro box and edited INI file and restarted.

                              [Configuration]
                              CurrentDC = Y40
                              PreviousDC = Y41
                              MaxOverallDC = Y42
                              MaxNoFaultDC = Y43
                              MaxFaultDC = Y44
                              MeanTimeDC = Y45
                              EnableHSLog = False
                              EnableHistLog = True
                              RunsToAverage = 5
                              MinSaveTime = 180
                              EnableTime = 5
                              RunningMean = True

                              [Data]
                              HSVersion=2.5.0.60
                              CurrentTime=10/6/2012 9:08:05 AM
                              Faulted =False
                              Current=0 Days 0 Hours 16 Minutes 1 Second
                              MaxOverall=4 Days 15 Hours 30 Minutes 29 Seconds
                              MaxNoFault=4 Days 15 Hours 30 Minutes 29 Seconds
                              MaxFAULT =4 Days 15 Hours 30 Minutes 29 Seconds
                              MeanUpTime =0 Days 17 Hours 22 Minutes 16 Seconds
                              NumRuns =47
                              Last edited by Pete; October 6, 2012, 09:24 AM.
                              - Pete

                              Auto mator
                              Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
                              Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
                              HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

                              HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                              HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                              X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                              Comment

                              Working...
                              X