Announcement

Collapse
No announcement yet.

How to know HS3 has restarted

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

  • How to know HS3 has restarted

    I'm working on some status messaging via email and HSTouch for a remote site.

    Couple of questions:

    How can I tell that HS3 has just restarted?
    1. What is the life of counters, timers and global variables in terms of a restart? Do they hold their value or reset? My initial testing seems to indicate they retain their value.
    2. Are there any replacement variables that contain:
      • CPU Usage
      • System Uptime
      • Memory usage


    Thanks.

  • #2
    For restart, edit the scripts/startup.vb and send yourself an email. This will let you know it has started.

    Sent from my SM-G935U using Tapatalk
    HS3Pro Running on a Raspberry Pi3
    64 Z-Wave Nodes, 168 Events, 280 Devices
    UPB modules via OMNI plugin/panel
    Plugins: Z-Wave, BLRF, OMNI, HSTouch, weatherXML, EasyTrigger
    HSTouch Clients: 3 Android, 1 Joggler

    Comment


    • #3
      Jon00 has some scripts that are very useful for the tasks you are thinking of.
      https://forums.homeseer.com/showthread.php?t=123313
      I'd recommend you consider his PerfMon script in particular.
      There is a scripting function, 'hs.SystemUpTime', that reports uptime, but I'm not aware of a replacement variable. There is a script, 'Startup.vb' that runs when the system starts. That will give you an opportunity to run an event to carry out tasks such as sending you an alert message, or start a timer that will keep track of how long the system has been run.
      Mike____________________________________________________________ __________________
      HS3 Pro Edition 3.0.0.500

      HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF, Rain8Net+ | RFXCOM | QSE100D | Vantage Pro | Green-Eye | X10: XTB-232, -IIR | Edgeport/8 | Way2Call | Ecobee3

      Comment


      • #4
        To add onto what rmasonjr said: I have an event called "Boot" that waits about 20 seconds (for HS to finish starting up) then sends me a notification telling me HS started up successfully.

        To run the event at startup, I just added this line near the bottom of startup.vb

        Code:
        hs.TriggerEvent ("Boot")

        Comment


        • #5
          bphillips,

          I can handle that. It makes sense and I prefer using events.

          Thanks!

          Comment


          • #6
            I have a line at the beginning of my startup.vb which I renamed to RAPstartup.vb so that new installs do not overwrite the script - it has happened.

            hs.triggerevent("Startup Occurred")

            Code:
            ' This is the startup script
            ' It is run once when HomeSeer starts up
            ' 
            ' You may also have Startup.vb and it will be run instead of this script.
            '
            Sub Main(Parm As Object)
            
                hs.WriteLog("Startup", "(RAPStartup.vb script) Scripting is OK and is now running RAPStartup.vb")
                   hs.triggerevent("StartupCleanup")

            I also use a script at shutdown that takes care of some other tasks. it can be configured in setup under the Custom tab.

            Click image for larger version  Name:	image_58872.png Views:	1 Size:	6.4 KB ID:	1188541

            Within that event I take care of any housekeeping I need after boot up. It is easy to add actions, other events with conditions honored, timer controls, counter controls, etc. I send myself a Pushover message telling me HomeSeer restarted and at what time, restart an uptime counter, get my lights synchronized with the time of day, poll a couple of critical devices to make sure they didn't change state while HomeSeer was down, etc. It is a one stop repository for startup events.

            I ended up putting the delay in to give HomeSeer a chance to settle down before proceeding with cleanup.

            Click image for larger version  Name:	image_58873.png Views:	1 Size:	123.3 KB ID:	1188542
            Last edited by rprade; March 10th, 2019, 11:32 AM.
            Randy Prade
            Aurora, CO
            Prades.net

            PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino

            Comment


            • #7
              Originally posted by bphillips View Post
              To add onto what rmasonjr said: I have an event called "Boot" that waits about 20 seconds (for HS to finish starting up) then sends me a notification telling me HS started up successfully.

              To run the event at startup, I just added this line near the bottom of startup.vb

              Code:
              hs.TriggerEvent ("Boot")
              @bphillips

              Just did this and it worked great. I like that it is an event that I can easily change.

              Thanks again.

              Comment

              Working...
              X