• [6.5.2] UPS Power Down at Percentage Not Working


    nickp85
    • 6.5.3-rc2 Solved Minor

    I did a test today with my UPS to make sure the battery is working normally.  Unraid is set to power down at 600 seconds (10 minutes) or 20% battery power.  I unplugged the UPS from the wall and it switched to battery.  I have a 900 watt UPS so run time at idle is about 30-40 minutes.  Unraid emailed me at 9:21 PM that power loss was detected.  Then immediately after I got a second email also 9:21 PM saying Unraid was shutting down due to battery level below the 20% threshold.  Sure enough, the PC powered down.  I plugged the UPS back in and can see from its LCD that the battery was still above 90%.  This is honestly the first time I've conducted such a test but the UPS is brand new and otherwise working normally.

     

    For now I've emptied the setting to shut down based on percent and just using seconds now.  Hopefully this can be addressed.  I'm happy to provide logs directly to someone at Unraid but would prefer not to post them to the forum publicly even using the anonymous function.

     

    Here's the two emails I got from the system.  Funny enough the one about shutting down came in before the one about running on batteries.

     

    Wed, May 23, 9:21 PM (2 hours ago)

    to me

    Event: unRAID Server Alert
    Subject: UPS Alert
    Description: Power failure on UPS nicknas2. Running on batteries.
    Importance: alert

     

    Wed, May 23, 9:21 PM (2 hours ago)

    to me

    Event: unRAID Server Alert
    Subject: UPS Alert
    Description: Remaining battery runtime below limit on UPS nicknas2. Doing shutdown.
    Importance: alert




    User Feedback

    Recommended Comments

    You have to understand that the estimated runtime and percent battery remaining are simple SWAG's.  As the battery(ies) age, they are even less accurate.  Plus, they are based on the idle power levels-- Hard disks probably spun down and CPU may even be idled backed for energy savings.  When you start the shutdown, all of the HD's spin-up, the CPU will ramp up and your load is now two or three times what it was at idle. .

     

    What I would suggest doing is setting the Time on Battery to something like thirty seconds or a minute.  (This is based on the fact that planned or unplanned grid switching outages seldom last longer than this and, if some drunk has knocked over a power pole, it is not going to repaired anytime soon.)  This will also give you protection against a second scenario.  The power goes out.  Your UPS shuts down after several minutes on the battery.  Power comes back after an hour or two.  After a few minutes, you (or someone else) decides things are back to normal, so the server is restarted.  The power goes out for a second time.  The battery has not had time to recharge and the UPS shuts down before the server can be cleanly shutdown...

    Link to comment
    13 hours ago, Frank1940 said:

    You have to understand that the estimated runtime and percent battery remaining are simple SWAG's.  As the battery(ies) age, they are even less accurate.  Plus, they are based on the idle power levels-- Hard disks probably spun down and CPU may even be idled backed for energy savings.  When you start the shutdown, all of the HD's spin-up, the CPU will ramp up and your load is now two or three times what it was at idle. .

     

    What I would suggest doing is setting the Time on Battery to something like thirty seconds or a minute.  (This is based on the fact that planned or unplanned grid switching outages seldom last longer than this and, if some drunk has knocked over a power pole, it is not going to repaired anytime soon.)  This will also give you protection against a second scenario.  The power goes out.  Your UPS shuts down after several minutes on the battery.  Power comes back after an hour or two.  After a few minutes, you (or someone else) decides things are back to normal, so the server is restarted.  The power goes out for a second time.  The battery has not had time to recharge and the UPS shuts down before the server can be cleanly shutdown...

     

    I don’t think this answers the issue. It’s a brand new 900w UPS with a full battery and unraid immediately shut the system down upon loss of power thinking the battery was drained below 20%.  A swag is fine but this was totally wrong.  Definitely appears to be a bug.

    Link to comment

    I'm trying to reproduce with a very small UPS here (APC Back-UPS NS 4001) with the following settings in unRAID:

     

    Battery level to initiate shutdown (%): 20
    Runtime left to initiate shutdown (minutes): 5

    Time on battery before shutdown (seconds): 0

     

    I pulled the APC's plug from the wall and almost immediately I got a notification that it was running on batteries.  I continued to watch the unRAID APC Settings page to see the UPS runtime left and percentage steadily drop.  After about 7-8min the UPS percentage dropped to ~40% and runtime left was 5min the unRAID server initiated a shutdown as expected.

     

    It's taking forever for my UPS to recharge now but next test tomorrow will be to just use the percentage (20%) and set runtime left to 0.

    Link to comment

    I guess one question is when a shutdown condition of 20% is set, is the condition monitored to initiate the shutdown performed by the UPS itself or by the software on Unraid?

     

    The Original poster also hasn’t mentioned what make/model of UPS is being used, which might be relevant if the problem is actually in the UPS firmware not correctly supporting %usage left.

     

    Suggestion .... do you have another system which you can install the UPS manufactures official software and plug the UPS into that and set a % condition and see if it works as expected ... this would help to eliminate the UPS itself as being the problem.

    Link to comment
    5 hours ago, remotevisitor said:

    I guess one question is when a shutdown condition of 20% is set, is the condition monitored to initiate the shutdown performed by the UPS itself or by the software on Unraid?

     

    The Original poster also hasn’t mentioned what make/model of UPS is being used, which might be relevant if the problem is actually in the UPS firmware not correctly supporting %usage left.

     

    Suggestion .... do you have another system which you can install the UPS manufactures official software and plug the UPS into that and set a % condition and see if it works as expected ... this would help to eliminate the UPS itself as being the problem.

     

    1. Model is CyberPower CP1500PFCLCD, very popular home UPS

    2. Unraid is configured to do the shutdown. In the case where the PC went off all my other things connected to battery stayed on (router, modem etc)

     

    it actually happened again today in a real world scenario. Even though I disabled the setting to turn off below a certain percent and just use a static time of 10 minutes, power flickered on and off in my house. I immediately got two alerts from unraid, one for the power loss and one for shutting down.

     

    Again in this case the power only flickered. My clocks around the house didn’t even reset. Yet unraid still shut itself down.

     

    Event: unRAID Server Alert
    Subject: UPS Alert
    Description: Remaining battery charge below limit on UPS nicknas2. Doing shutdown.
    Importance: alert
     

     

    Btw I’m now running 6.5.3 rc1 where before it was 6.5.2.

    Edited by nickp85
    Link to comment
    8 minutes ago, nickp85 said:

    Model is CyberPower CP1500PFCLCD, very popular home UPS

     

    I have at least a dozen UPSs here and half of them are CyberPower.  I'm pretty sure I have a couple of that exact model.  I'll see if I can try a couple of the CyberPower UPSs on some of the unRAID testbed machines.

    Link to comment
    7 minutes ago, nickp85 said:

    here’s a screenshot of my UPS details.

    Your MINTIMEL and MBATTCHG values are way off... they are suppose to match the inputs above:

     

    ups.png

    Link to comment

    MBATTCHG is the percent of battery charge left when shutdown starts.  This should be set in the "Battery level to initiate shutdown (%):" box on the 'UPS settings' section.

    Link to comment

    The 'bug' here is if you leave "Battery level to initiate shutdown (%):" or "Runtime left to initiate shutdown (minutes):" boxes empty (instead of 0) then it uses some random 5000 value ... which of course will tell unRAID to shutdown right after running on batteries since UPS at 100% < 5000  :)

    Link to comment
    3 minutes ago, eschultz said:

    The 'bug' here is if you leave "Battery level to initiate shutdown (%):" or "Runtime left to initiate shutdown (minutes):" boxes empty (instead of 0) then it uses some random 5000 value ... which of course will tell unRAID to shutdown right after running on batteries since UPS at 100% < 5000  :)

    So are you going to change to empty = 0 on future releases for those values?

    Link to comment
    6 hours ago, eschultz said:

    The 'bug' here is if you leave "Battery level to initiate shutdown (%):" or "Runtime left to initiate shutdown (minutes):" boxes empty (instead of 0) then it uses some random 5000 value ... which of course will tell unRAID to shutdown right after running on batteries since UPS at 100% < 5000  :)

    Awesome, so if I just change my blanks to some value, that that should take care of it?

     

    Originally, I had this:
    Battery level to initiate shutdown (%): 20%

    Runtime left to initiate shutdown (minutes): <blank>

    Time on battery before shutdown (seconds): 600

     

    Then I changed it thinking there was a bug:

    Battery level to initiate shutdown (%): <blank>

    Runtime left to initiate shutdown (minutes): <blank>

    Time on battery before shutdown (seconds): 600

     

    Which led me to the issue this morning where power flickered and it shut down.  

     

    I'll now set it to this:

    Battery level to initiate shutdown (%): 20%

    Runtime left to initiate shutdown (minutes): 10

    Time on battery before shutdown (seconds): 600

     

     

    Sure enough after doing that, now I unplug the UPS and it works as expected.  I'm posting this right now from battery power.

    Edited by nickp85
    Link to comment
    2 hours ago, nickp85 said:

    Awesome, so if I just change my blanks to some value, that that should take care of it?

     

    Yes.  Also, I'd change your '20%' to just '20'.

    Link to comment
    22 hours ago, eschultz said:

     

    Yes.  Also, I'd change your '20%' to just '20'.

     

    Yeah that was a typo on my part. I did put “20” in the settings. Thanks for fixing it in the next release!

    Link to comment


    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.
    Note: Your post will require moderator approval before it will be visible.

    Guest
    Add a comment...

    ×   Pasted as rich text.   Restore formatting

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


  • Status Definitions

     

    Open = Under consideration.

     

    Solved = The issue has been resolved.

     

    Solved version = The issue has been resolved in the indicated release version.

     

    Closed = Feedback or opinion better posted on our forum for discussion. Also for reports we cannot reproduce or need more information. In this case just add a comment and we will review it again.

     

    Retest = Please retest in latest release.


    Priority Definitions

     

    Minor = Something not working correctly.

     

    Urgent = Server crash, data loss, or other showstopper.

     

    Annoyance = Doesn't affect functionality but should be fixed.

     

    Other = Announcement or other non-issue.