-
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!
-
@JHanko
Can you goto the - Services -> apcupsd
select the status tab and share the results. -
@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.
-
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 contentsEdit: 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
-
Also curious why, when you are online at 100.0% the charge line isn't green
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. -
@jrey said in APCUPSD missing status icon:
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.
-
@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?
-
Days
-
I just exhausted the battery and the Netgate halted right at 5%, so everything's working as it should. Thanks again!
-
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 CEThanks
-
-