• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

APCUPSD missing status icon

Scheduled Pinned Locked Moved UPS Tools
10 Posts 2 Posters 1.1k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J
    JHanko
    last edited by Nov 16, 2023, 12:59 AM

    I just setup an APC SURTA2200XL UPS with a network interface card installed. I configured APCUPSD for PCNET operation and everything appears to be working fine, except when "on battery", there is no colored status icon. When the UPS is online and fully charged, it shows a green icon and text (1st pic). When online and charging, it shows a yellow icon and text (2nd pic). When it's on battery operation, I assume there should be a red icon and text showing ON BATTERY, but there's just the text "unknown(ONBATT)", shown in the 3rd pic. Any idea where I should start looking to get APCUPSD to better recognize the "ONBATT" status? Thanks!

    20231115_175605.jpg

    20231115_180032.jpg

    20231115_175855.jpg

    J 1 Reply Last reply Nov 16, 2023, 11:18 AM Reply Quote 0
    • J
      jrey @JHanko
      last edited by Nov 16, 2023, 11:18 AM

      @JHanko
      Can you goto the - Services -> apcupsd
      select the status tab and share the results.

      J 1 Reply Last reply Nov 16, 2023, 10:25 PM Reply Quote 1
      • J
        JHanko @jrey
        last edited by Nov 16, 2023, 10:25 PM

        @jrey said in APCUPSD missing status icon:

        @JHanko
        Can you goto the - Services -> apcupsd
        select the status tab and share the results.

        Here you go. This is while running on battery. And thanks for taking the time to look into it.

        Screenshot 2023-11-16 at 16-18-17 NetGate.hanko.home - Status Apcupsd.png

        J 2 Replies Last reply Nov 17, 2023, 12:21 PM Reply Quote 0
        • J
          jrey @JHanko
          last edited by jrey Nov 17, 2023, 2:53 PM Nov 17, 2023, 12:21 PM

          @JHanko

          Thanks

          so it is just a display issue. There is nothing really wrong with the display in this case. When the status string being returned by the device doesn't match the string the widget is checking for, the dashboard widget will attempt to display the icon showing the battery level remaining.

          I don't have a similar model to test with, but the following should in your case change it back to the red icon you are likely expecting to see.
          NB: This is a "patch" but it would only be valid in this specific case on this specific model (and perhaps others).
          It would also likely be better long term if these values were mapped when read from the device based on the model and not when displayed, but that would require way more coffee.

          I tried to quickly locate the list of all return values for the model you have, but have been unable to find at this point. I suspect some of the other values return by this model may be different and well. So you may see "unexpected" display for things like "replace battery" - "battery low" etc.

          If you are up to trying this, create a patch (system->Patches)

          Set the Name to anything you like (I used: "APC Widget Icon Display")
          set the Path Strip Count to 0 (zero)
          set the Base Directory to "/usr/local/www/widgets/widgets"
          paste this into the patch contents

          Edit: revised from earlier, so that both responses should be handled.

          --- apcupsd.widget.php.orig	2023-11-17 06:50:10.645246000 -0500
          +++ apcupsd.widget.php	2023-11-17 06:52:23.106822000 -0500
          @@ -90,9 +90,9 @@
           				$bchrg = (($results['BCHARGE'] != "") ? str_replace(" Percent", "", $results['BCHARGE']) : null);
           
           				if ($results['STATUS'] != "") {
          -					$mainstatarray = array("ONLINE", "ON-BATTERY", "OVERLOADED", "BATTERY-LOW", "LOWBATT", "REPLACE-BATTERY", "REPLACEBATT", "COMM-LOST", "COMMLOST", "NOBATT"); //Taken from apcupsd source
          +					$mainstatarray = array("ONLINE", "ON-BATTERY", "ONBATT", "OVERLOADED", "BATTERY-LOW", "LOWBATT", "REPLACE-BATTERY", "REPLACEBATT", "COMM-LOST", "COMMLOST", "NOBATT"); //Taken from apcupsd source
           					$substatarray = array("CALIBRATION", "CAL", "TRIM", "BOOST", "SHUTDOWN", "SHUTTING-DOWN", "SLAVE", "SLAVEDOWN");  //Taken from apcupsd source
          -					$statusarray = explode(" ", str_replace(array("ON BATTERY", "BATTERY LOW", "REPLACE BATTERY", "SHUTTING DOWN", "COMM LOST"), array("ON-BATTERY", "BATTERY-LOW", "REPLACE-BATTERY", "SHUTTING-DOWN", "COMM-LOST"), $results['STATUS']));
          +					$statusarray = explode(" ", str_replace(array("ON BATTERY", "ONBATT", "BATTERY LOW", "REPLACE BATTERY", "SHUTTING DOWN", "COMM LOST"), array("ON-BATTERY", "ON-BATTERY", "BATTERY-LOW", "REPLACE-BATTERY", "SHUTTING-DOWN", "COMM-LOST"), $results['STATUS']));
           					$statstr = "";
           					$statsubstr = "";
           
          

          Save, then apply the patch

          if it gives you the result you expect, good

          if not just revert the patch and you are back to normal.
          Please share the results of this test.

          I'm running apcupsd package version 0.3.92_1

          J 1 Reply Last reply Nov 17, 2023, 7:37 PM Reply Quote 1
          • J
            jrey @JHanko
            last edited by Nov 17, 2023, 3:04 PM

            @JHanko

            Also curious why, when you are online at 100.0% the charge line isn't green
            Screen Shot 2023-11-17 at 9.55.36 AM.png

            That seems like a different coffee, next time it is online and at 100.0%, grab another status and post it. Has the bar ever shown green in that state?
            could just be that the status is actually 99.x and the display is just displaying 100.0 at that point.

            J 1 Reply Last reply Nov 17, 2023, 3:10 PM Reply Quote 0
            • J
              JHanko @jrey
              last edited by Nov 17, 2023, 3:10 PM

              @jrey said in APCUPSD missing status icon:

              @JHanko

              Also curious why, when you are online at 100.0% the charge line isn't green

              That is working fine now. I took those pictures before I entered in the warning and critical levels. I will try the patch this morning. Thank you again.

              1 Reply Last reply Reply Quote 0
              • J
                JHanko @jrey
                last edited by Nov 17, 2023, 7:37 PM

                @jrey said in APCUPSD missing status icon:

                if not just revert the patch and you are back to normal.
                Please share the results of this test.

                I created and applied the patch. Seems to have done the job. Thank you very much! I will run another test to make sure the Netgate still goes into Halt when it should. One more question: When entering the battery age warning and critical levels, does the input reflect days, weeks, months? Or a date format?

                Screenshot 2023-11-17 at 13-36-14 NetGate.hanko.home - Status Dashboard.png

                J 1 Reply Last reply Nov 17, 2023, 7:55 PM Reply Quote 0
                • J
                  jrey @JHanko
                  last edited by Nov 17, 2023, 7:55 PM

                  @JHanko

                  Days

                  1 Reply Last reply Reply Quote 0
                  • J
                    JHanko
                    last edited by Nov 17, 2023, 8:03 PM

                    I just exhausted the battery and the Netgate halted right at 5%, so everything's working as it should. Thanks again!

                    J 1 Reply Last reply Nov 18, 2023, 2:10 PM Reply Quote 0
                    • J
                      jrey @JHanko
                      last edited by Nov 18, 2023, 2:10 PM

                      @JHanko

                      Great,

                      Now that I had some more time, was going to create a redmine for this issue

                      and of course discovered there is one that has a similar proposed fixed. So I'm not going to create an account on redmine for the sole purpose of updating it.

                      https://redmine.pfsense.org/issues/14398

                      perhaps we could kindly ask @stephenw10 to update the redmine for you (us) so that at some point down the road it ends up in the system.
                      The redmine indicates affected version is 23.01 (and certainly it is) it is still there for 23.09 and 2.7.1 CE

                      Thanks

                      1 Reply Last reply Reply Quote 0
                      • S stephenw10 moved this topic from pfSense Packages on Apr 2, 2024, 6:44 PM
                      • U Unoptanio referenced this topic on Apr 11, 2024, 2:04 PM
                      10 out of 10
                      • First post
                        10/10
                        Last post
                      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                        This community forum collects and processes your personal information.
                        consent.not_received