Announcement

Collapse
No announcement yet.

Graceful shutdown of HomeSeer - Solved!

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

    Graceful shutdown of HomeSeer - Solved!

    I thought I read something in one of the threads about gracefully stopping HomeSeer, but I cannot find it. On a Window device (HomeTroller Plus Smart Home Hub), how do I stop the HomeSeer application?

    #2
    Using Blade's BLShutdown here on HS3. Works great.

    Comment


      #3
      mcsMQTT also provides this capability and also handles the case of HS4 running as a service. It will also do a HS restart as well as the enable/disable/restart control of any plugin. As a bonus it reports the CPU utilization of HS and the plugins as HS devices so decision triggers or data logging can be done.

      Comment


        #4
        To gracefully shut down HS4 on Windows you can click on the close button on the HS4 GUI as well if you have a monitor and keyboard connected. You can also Remote Desktop into the unit if you do not have a monitor and keyboard connected.
        💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

        Comment


          #5
          I use this in my UPS shutdown script:
          Code:
          curl -X POST -F "scriptcmd=hs.shutdown()" -F "runscript=Execute Command" "http://localhost:80/ControlPanel"

          Comment


            #6
            I was hopeful there is a simple cmd command. I wanted something simple to use while on the device before I do Windows updates. I also want to add it to the Power Restart and Shut down actions in a cmd file.

            Comment


              #7
              There's the &hs.shutdown which you can run from a script or the script command window.
              Click image for larger version

Name:	hsshutdown.jpg
Views:	878
Size:	15.5 KB
ID:	1528740

              💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

              Comment


                #8
                Well... &hs.shutdown works from the runscript.html page without any issues, but I could not figure out where else to use &hs.shutdown. Therefore, I did something a little kludgy. I ended up creating a program that adds &hs.shutdown to the runscript.html page and automatically runs it. Not sure I like it. Probably won't use it, but it give me a bit more insite to how it works.

                * 465623 2022-02-22 11:49:37 Warning HomeSeer Request from UI to shutdown
                465624 2022-02-22 11:49:37 Shutdown HomeSeer Application shutdown at 2/22/2022 12:39:37 PM
                465625 2022-02-22 11:49:37 Shutdown HomeSeer Running shutdown script ...
                465626 2022-02-22 11:49:37 Shutdown HomeSeer Shutdown Script Completed
                465627 2022-02-22 11:49:37 Shutdown HomeSeer Shutting down plug-ins ...
                465628 2022-02-22 11:49:37 Shutdown HomeSeer Shutting down all plug-ins.

                Thanks for everybody's help and suggestions.

                Comment


                  #9
                  You could just call this from a HS4 event and run that manually.
                  💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                  Comment


                    #10
                    How can I call an HS4 event from the command line without having a browser or other window open to HS4? With the app I created, I can just double click it and it stops HS4. Using the app, I can setup the hub so if a windows restart or shutdown occurs outside of HS4, it will first shutdown HS4 then proceed with the Windows event.

                    Comment


                      #11
                      Yours is fine. There are other ways. I run events from short cuts on my desk top by running a HS JSON command:
                      PHP Code:
                      https://myhs.homeseer.com/JSON?request=runevent&id=EVENT_ID&user=myHSUserName&pass=myHSUserPassword 
                      I double click on the shortcut.
                      💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                      Comment


                        #12
                        I like your idea better. It is much cleaner and logical. It will take me a bit to figure it out, but I will give it a go. Thanks!

                        Comment


                          #13
                          Originally posted by Coz View Post
                          I like your idea better. It is much cleaner and logical. It will take me a bit to figure it out, but I will give it a go. Thanks!
                          If your system is set to not require login for the local network (and you are running this locally), you can leave out the user id and password.

                          You might also look into this for the Windows Update issue: https://forums.homeseer.com/forum/3r...r-3-homeseer-4

                          Comment


                            #14
                            Originally posted by joegr View Post
                            You might also look into this for the Windows Update issue: https://forums.homeseer.com/forum/3r...r-3-homeseer-4
                            I'm impressed with Jon's creations, but the update monitor is not useful for me (but I do like it). My patching and maintenance activities are decades old. For me, a monitor for these activities is a waste of desktop space. I would rather get an email if something is amiss. On the other hand, some day way off in the future... I might try creating some of those plugins Jon does so well. Currently I'm still in the newbie stage of figuring this stuff out.

                            Comment


                              #15
                              Originally posted by Coz View Post

                              I'm impressed with Jon's creations, but the update monitor is not useful for me (but I do like it). My patching and maintenance activities are decades old. For me, a monitor for these activities is a waste of desktop space. I would rather get an email if something is amiss. On the other hand, some day way off in the future... I might try creating some of those plugins Jon does so well. Currently I'm still in the newbie stage of figuring this stuff out.
                              Your comment intrigues me! Whilst virtual devices do show status, they are also used to trigger Homeseer events. Those events can be used to send emails, Pushover, Telegram, turn on lights, other events...whatever! In terms of my Windows Update Monitor, you have triggers for the number of updates available, Severity, Number of Critical updates available and even if a reboot is required. There is also a control to shutdown Homeseer gracefully (if installed) and restart the PC.
                              Jon

                              Comment

                              Working...
                              X