Announcement

Collapse
No announcement yet.

Power and UPS Management

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

    #16
    I run apcupsd (rather than PowerChute) to monitor my APC UPS's. This can be configured to send a 'killpower' command, which shuts down the UPS after a short delay. This eliminates the 'no-man's land' time where the UPS is still running after the computer shuts down, during which AC is restored.

    [Note this doesn't utilize the 3rd party apcupsd plugin. I have that; its nice but I haven't found much use for it].

    apcupsd runs on Windows and Linux. My HS server (Windows7) runs apcupsd, which monitors/controls the UPS via the UPS port. My Z-Net like device also runs apcupsd; this monitors the UPS via the Windows machine. Both are configured to start their shutdown when the remaining battery time reaches three minutes.

    On the Windows machine, apcupsd is installed at C:\apcupsd. Config files reside at C:\apcupsd\etc\apcupsd. The shutdown sequence is customized by adding a batch file 'doshutdown.bat' to this folder. I copied the :doshutdown section from the apccontrol.bat file and modified it as suggested in the comments.

    Also added a curl command to shutdown HomeSeer. Note that curl is provided with Windows 10; for Windows 7 I installed from https://curl.haxx.se/windows/

    C:\apcupsd\etc\apcupsd\doshutdown.bat
    Code:
    @echo off
    rem doshutdown command override
    
    rem
    rem  If you want to try to power down your UPS, uncomment
    rem    out the following lines, but be warned that if the
    rem    following shutdown -h now doesn't work, you may find
    rem    the power being shut off to a running computer :-(
    rem  Also note, we do this in the doshutdown case, because
    rem    there is no way to get control when the machine is
    rem    shutdown to call this script with --killpower. As
    rem    a consequence, we do both killpower and shutdown
    rem    here.
    rem  Note that Win32 lacks a portable way to delay for a
    rem    given time, so we use the trick of pinging a
    rem    non-existent IP address with a given timeout.
    rem
       curl -X POST -F "scriptcmd=hs.shutdown()" -F "runscript=Execute Command" "http://localhost:80/ControlPanel"
       %APCUPSD% /kill
       ping -n 1 -w 5000 10.255.255.254 > NUL
       %POPUP% "Doing %APCUPSD% --killpower"
       %APCUPSD% --killpower
       ping -n 1 -w 12000 10.255.255.254 > NUL
    
       %SHUTDOWN% -h now
    
       exit /b 99

    Comment


      #17
      Originally posted by zwolfpack View Post
      I run apcupsd (rather than PowerChute) to monitor my APC UPS's. This can be configured to send a 'killpower' command, which shuts down the UPS after a short delay. This eliminates the 'no-man's land' time where the UPS is still running after the computer shuts down, during which AC is restored.
      I also use apcupsd but do it a little differently.
      My auto startup of HS4 is by a task in Task Scheduler which triggers 30 seconds after startup. In settings this is set to 'not start a new instance if the task is already running'. In apcupsd I have an offbatter.exe which triggers the same task.
      This way, whenever the ups switches from battery to mains the task is triggered and, if HS4 is not running it is started. This covers the situation where power is restored after HS4 has been shut down but before the battery runs out and the ups shuts down.
      I think your method might be easier though

      Steve

      Comment


        #18
        Originally posted by Corvl1 View Post
        How does your android tablet know when to start with starting everything up?
        Does your tablet automatically start up after a power loss and the battery has drained, and than start up everything via tasker?

        My android tablet stayed off when the battery was drained and power was applied again.

        Cor
        That all depends on your setup. My systems are so involved that I use mini UPS's to manage the small devices like Raspberry PI
        Everyone's system is layed out differently but in the image below : A is a Mini UPS

        Click image for larger version  Name:	IMG_20201106_175149.jpg Views:	0 Size:	155.9 KB ID:	1431454


        EX So in your senario the intiation should come from Node-RED as the detector (on start == > wait ==> send mqtt == the Tablet sends WoL)

        But because my system are interconnected (they self-manage themselves)

        Note : The package can then be pluged into a much larger UPS


        Eman
        TinkerLand : Life's Choices,"No One Size Fits All"

        Comment


          #19
          Originally posted by Eman View Post

          A is a Mini UPS

          EX So in your senario the intiation should come from Node-RED as the detector (on start == > wait ==> send mqtt == the Tablet sends WoL)
          Eman

          Looks nice that "box" 👍
          Only thing which I would like of it's the case, does MQTT need internet or is it completely stand alone and can work without the internet?

          Can you give me more info about the mini UPS.
          I want to power my thermostats which should have 2AA batteries via the mains , I have them now connected with a 3V power source , the issue is when there is an power outage and the power comes back on , the thermostat go to 21degreesC and first needs to physically be reset before being able to be controlled via homeseer again. So.....looking for a very small UPS for 3-4Volts.

          Cor

          Comment


            #20
            yess mqtt is local.

            You can use it with internet too.

            Comment


              #21
              Originally posted by Corvl1 View Post


              Looks nice that "box" 👍
              Only thing which I would like of it's the case, does MQTT need internet or is it completely stand alone and can work without the internet?

              Can you give me more info about the mini UPS.
              I want to power my thermostats which should have 2AA batteries via the mains , I have them now connected with a 3V power source , the issue is when there is an power outage and the power comes back on , the thermostat go to 21degreesC and first needs to physically be reset before being able to be controlled via homeseer again. So.....looking for a very small UPS for 3-4Volts.

              Cor
              Most of the stuff including the boxs are on Amazon : https://www.amazon.co.uk/Closet-350x...90196&sr=8-180


              I use MQTT locally and the Mini UPS's I already a posted a link :https://www.amazon.co.uk/s?k=mini+up...s_ts-oa-p_10_8 and the device marked B can regulate voltage but there are other versions on Amazon.
              That particular Mini UPS seems no longer listed but other versions especially for the modem and other small devices

              More devices for projects here : https://www.amazon.co.uk/s?k=volt+re...86&ref=sr_pg_2



              For the terminal blocks they don't get any better than these : https://www.wago.com/global/installa...-box/p/821-120


              I also bought these : LM2596 DC to DC High Efficiency Voltage Regulator 3.0-40V to modify the door Zwave sensors to stop them from drinking the batteries but never got myself to the task. (on the Shelf!)


              Eman.
              TinkerLand : Life's Choices,"No One Size Fits All"

              Comment


                #22
                I think what we are discussing in shutdown and power restore procedures. Intelligent power managment.

                Eman I appreciate the links to various pieces of hardware (UPS, PI HAT boards, voltage regulators etc). But I would like to understand the sequence of events during various scenarios: power failure, power restore, power restore during shutdown etc. What happens when you are away from home and the power is out for several hours? How does your system come back up, in the right order, if all the mini UPSs are drained? Bearing in mind that some UPS won't go live until the battery is charged to a minimum level.
                iCore5 Win 10 Pro x64 SSD

                HS3 Pro Edition 3.0.0.435 Windows

                BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

                Comment


                  #23
                  Originally posted by mminehan View Post
                  So how does all this manage an orderly startup and graceful shutdown? I'm just not talking about extending run times of various devices. How do ensure that when the power is restored things boot up in the right order? And how do you handle a power restore during the shutdown procedure?
                  Someone else interested asked but to sum it up nothing critical shuts down !

                  But for the more descriptive nature of your stitualion I refer you to post # 16 and post # 17 (they are the kind of the techinical knowledge you may be seeking)
                  I have already mentioned before that everyone's system is different. That's my style! May luck substance but works.

                  Note : If you step back to all my posts you will find that I have been consistent


                  Eman
                  TinkerLand : Life's Choices,"No One Size Fits All"

                  Comment


                    #24
                    Originally posted by Eman View Post

                    Someone else interested asked but to sum it up nothing critical shuts down !
                    Personally I think this is a foolish approach. No system has a 100% up time.

                    So....you are on holiday, away from home. The power goes out for a day because a storm took out the local power lines. Are you trying to tell me your system keeps running on a UPS for over 24 hours? That there is no need for an unattended graceful shutdown and restart? Ever?
                    iCore5 Win 10 Pro x64 SSD

                    HS3 Pro Edition 3.0.0.435 Windows

                    BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

                    Comment


                      #25
                      Originally posted by mminehan View Post

                      Personally I think this is a foolish approach. No system has a 100% up time.

                      So....you are on holiday, away from home. The power goes out for a day because a storm took out the local power lines. Are you trying to tell me your system keeps running on a UPS for over 24 hours? That there is no need for an unattended graceful shutdown and restart? Ever?
                      What are you running? a Hospital?
                      graceful shutdown
                      Back track all my posts. In fact if you live off grid I started off with Solar. If not for trying to save on power (energy) in the old days when I first started with automation I used to run a full rack of servers (I don't need to do that anymore) now the computers are micro. All the devices I run are small including the Synology NAS DVA 3219 and if small each one has its owm mini UPS. Do you get the picture? When I can afford I tend to go for industrial stuff (power management devices) but don't care much. If the devices are PoE (even my Tablets are PoE).When power is restored they all come up online.And for mission critical systems more here : https://www.apc.com/us/en/faqs/FA156201/

                      Eman.
                      TinkerLand : Life's Choices,"No One Size Fits All"

                      Comment


                        #26
                        Originally posted by Eman View Post
                        Back track all my posts.
                        Most of your posts are links to sites selling UPSs and power supplies and Pi HATS and DC voltage regulators etc. 😐 Not really sites with any useful information on intelligent power management.

                        We are obviously on different pages. This thread is about what methods people are using for unattended graceful shutdowns and orderly restarts of their home automation system in various power loss scenarios. This is not about how to keep their systems running on a UPS, or battery backup for alarm systems. I think most people understand what a UPS is, mini or otherwise. And most people know no system has 100% uptime. "Nothing critical shuts down!" is unrealistic.

                        Anyway, this is all getting a bit weird and this thread is filling up with unhelpful posts (I'm guilty too). I'm glad you are happy with your system and it works for you.

                        So let's move on and hear what others are doing.
                        iCore5 Win 10 Pro x64 SSD

                        HS3 Pro Edition 3.0.0.435 Windows

                        BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

                        Comment


                          #27
                          Why you power cycle your server after updates? That's not unreasonable but best practice. When you fail to understand the content of my posts that is where I thought we all got lost and hense the OP starting this thread.
                          • I don't usually tend to follow large threads but that's where we are and the more experienced gurus all left the field
                          • Please plot down the design of what you want to do and people will help you. I have already refered you to posts # 16 and # 17 of this thread for a more software based control from the most inteligent people I know of in these forums but you keep picking on everything I post.
                          • So lets say you start off with how you would gracefully shut down a system during a power loss? You will indeed find that the items I have and listed will aid you in your systems easily coming back on line unless you are running an irrigation system ...greeen house..
                          • In simple techinical terms an auto power transfer relay sends power over to another line (from grid /solar ==> to UPS) and back should there be a power cut from the Grid or Solar and the job of the Power conditioner ( current limiter) is to level out the power that devices (critical) upstream will not even notice the difference
                          • And for mission critical systems more here : http://www.digital-loggers.com/ats.html
                          Now unless you run a dairy or a chick hatching business and the above can't help and no more sunshine then.......................

                          This https://www.youtube.com/watch?v=ni0A_ZdH7aU


                          TIP : You need a PoE Android Tablet to create a Tasker Profile (Event) of what the tablet does after boot :Next
                          • Test by rebooting the Tablet or reconnecting the PoE (RJ45) cable
                          • How you do the graceful stut down of devices is another issue (I use ioBroker to shut down my PC)
                          • There is also a WoLnode for Node-RED (that's also another story)


                          Eman.
                          TinkerLand : Life's Choices,"No One Size Fits All"

                          Comment


                            #28
                            Originally posted by Eman View Post
                            Why you power cycle your server after updates? That's not unreasonable but best practice. When you fail to understand the content of my posts that is where I thought we all got lost and hense the OP starting this thread.
                            • I don't usually tend to follow large threads but that's where we are and the more experienced gurus all left the field

                            Now unless you run a dairy or a chick hatching business and the above can't help and no more sunshine then.......................
                            I appreciate you are trying to help but please stay on topic. Most of what you have posted is out of context or is incomprehensible. And the reason that "gurus all left the field" and you think people are picking on you is that you fill up threads with off topic links. Nobody is talking about solar systems, irrigation systems or chicken farms. It seems to be a bit of a habit of yours: https://forums.homeseer.com/forum/ho...77#post1431777

                            If you want to discuss solar systems, power transfer switches, power conditioners or chicken farms then start a new thread on those topics.

                            Now this thread has lost its value as once again it's been derailed with rubbish. Thanks!
                            iCore5 Win 10 Pro x64 SSD

                            HS3 Pro Edition 3.0.0.435 Windows

                            BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

                            Comment


                              #29
                              Originally posted by mminehan View Post

                              I appreciate you are trying to help but please stay on topic. Most of what you have posted is out of context or is incomprehensible. And the reason that "gurus all left the field" and you think people are picking on you is that you fill up threads with off topic links. Nobody is talking about solar systems, irrigation systems or chicken farms. It seems to be a bit of a habit of yours: https://forums.homeseer.com/forum/ho...77#post1431777

                              If you want to discuss solar systems, power transfer switches, power conditioners or chicken farms then start a new thread on those topics.

                              Now this thread has lost its value as once again it's been derailed with rubbish. Thanks!
                              I like your way of thinking but you must also realise that I stopped following or signed off but sadly you have reopened this up.
                              Sorry, for the grown man I am, have things to do than dwell on this.
                              So please thank you very much for your educating me and the end............................. and enjoy your automation.






                              Eman.
                              TinkerLand : Life's Choices,"No One Size Fits All"

                              Comment

                              Working...
                              X