Battery & UPS Monitor plugin.

Posted on
Thu Aug 15, 2013 8:08 pm
rhanson offline
Posts: 114
Joined: Apr 30, 2013

Re: Battery & UPS Monitor plugin.

OK, I'm late to the party here. So if I have a UPS and the apc daemon, then is the plugin all I need to get the simulated bad shutdown? Or do I need to go ahead and adjust the launchctl params as indicated in the middle of this thread?

If I have a non-apc ups, but it's supported by the OSX battery preferences pane, then will the plugin (by itself) be able to cause the auto-restarting shutdown?

Posted on
Sat Aug 24, 2013 1:32 pm
rhanson offline
Posts: 114
Joined: Apr 30, 2013

Re: Battery & UPS Monitor plugin.

OK, I have the UPS device created, and it communicates with the UPS correctly. UPS is correctly identified by OSX, and functions correctly.

However, the plugin's trigger for AC Power On/Off doesn't fire. If I use a trigger for Charging Status, that works fine.

Here's what the log says for AC and UPS power:

UPS and Battery Monitor Power Status - AC Power
UPS and Battery Monitor UPS Model - -CRCA102*AF1
UPS and Battery Monitor Charging Status - True
UPS and Battery Monitor Battery Charge - 120
UPS and Battery Monitor Sleeping for 5 minutes (300)

UPS and Battery Monitor Power Status - UPS Power
UPS and Battery Monitor UPS Model - -CRCA102*AF1
UPS and Battery Monitor Charging Status - False
UPS and Battery Monitor Battery Charge - 118
UPS and Battery Monitor Sleeping for 5 minutes (300)

In addition, the Indigo built-in Power Failure event doesn't trigger either, but I'm not sure whether that's looking at the OSX UPS status or some Insteon controller or what.

Does anyone have any issues with the AC power status trigger?

Edit: looking at the plug-in code, the ACPower state is defined as boolean, but it stores a string "AC Power" or "UPS Power". Changing that to a string, and changing the trigger to match text does the trick.

Still no idea what the built-in Indigo power-failure trigger does, though.

Posted on
Sun Aug 25, 2013 9:34 am
ssciboz offline
Posts: 80
Joined: Jun 22, 2007

Re: Battery & UPS Monitor plugin.

It would be great of the refresh time could be changed from a trigger (for example, when I'm at home, or when my Mac Pro is on, I need a check every minute, when only my mini server runs, I could make it every 5 minutes).

Posted on
Tue Aug 27, 2013 5:54 pm
rhanson offline
Posts: 114
Joined: Apr 30, 2013

Re: Battery & UPS Monitor plugin.

I agree, I think it should be user-defined. Furthermore, once it knows it's in battery mode, it should poll every minute. 5 minutes is a long time on battery. Finally, I would get rid of the log messages every 5 minutes. Report at startup, and then only when things change.

Posted on
Mon Sep 02, 2013 8:58 am
richy240 offline
Posts: 106
Joined: Jul 08, 2012

Re: Battery & UPS Monitor plugin.

This is a great plugin, and seemingly very stable. One nice addition would be to suppress the refresh logging. It's nice to know that things are working ok, but it tends to fill up my log. Maybe an option to only log issues?

Posted on
Fri Sep 06, 2013 6:42 am
bschollnick2 offline
Posts: 1286
Joined: Oct 17, 2004
Location: Rochester, Ny

Re: Battery & UPS Monitor plugin.

I'll look at adding in a user option to suppress the logging, and an option to switch to 1 minute updates, after a power loss.

Thanks for the feedback.

- Ben

------
My Plugins for Indigo (v4, v5, and v6) - http://bit.ly/U8XxPG

Security Script for v4 - http://bit.ly/QTgclf
for v5 - http://bit.ly/T6WBKu

Support Forum(s) - http://www.perceptiveautomation.com/userforum/viewforum.php?f=33

Posted on
Mon Sep 09, 2013 12:34 pm
bschollnick2 offline
Posts: 1286
Joined: Oct 17, 2004
Location: Rochester, Ny

Re: Battery & UPS Monitor plugin.

richy240 wrote:
This is a great plugin, and seemingly very stable. One nice addition would be to suppress the refresh logging. It's nice to know that things are working ok, but it tends to fill up my log. Maybe an option to only log issues?


Okay, I have a version that I need to test, that includes:

* The option to only log when a power failure occurs
* A separate refresh timer when a power failure occurs

I need to test this today / tomorrow, but then I should be able to release it.

- Ben

------
My Plugins for Indigo (v4, v5, and v6) - http://bit.ly/U8XxPG

Security Script for v4 - http://bit.ly/QTgclf
for v5 - http://bit.ly/T6WBKu

Support Forum(s) - http://www.perceptiveautomation.com/userforum/viewforum.php?f=33

Posted on
Mon Sep 09, 2013 9:27 pm
rhanson offline
Posts: 114
Joined: Apr 30, 2013

Re: Battery & UPS Monitor plugin.

Ben - see your PM inbox.

Posted on
Tue Sep 10, 2013 9:17 am
bschollnick2 offline
Posts: 1286
Joined: Oct 17, 2004
Location: Rochester, Ny

Re: Battery & UPS Monitor plugin.

v1.03 is ready for use.

https://dl.dropboxusercontent.com/u/241 ... tor103.zip

Improvements include, option to only log to the system log when a power failure has occurred.
Along with the ability to set a Refresh Timer for when a power failure has occurred.

- Ben

------
My Plugins for Indigo (v4, v5, and v6) - http://bit.ly/U8XxPG

Security Script for v4 - http://bit.ly/QTgclf
for v5 - http://bit.ly/T6WBKu

Support Forum(s) - http://www.perceptiveautomation.com/userforum/viewforum.php?f=33

Posted on
Tue Sep 10, 2013 11:44 am
ssciboz offline
Posts: 80
Joined: Jun 22, 2007

Re: Battery & UPS Monitor plugin.

Seems to works good !
But my question is : if I check the battery level every 6 hours, when the power is lost, is there any action we can make?
On my last test it was saying power failure only while it checked it (so 45 seconds after the lost of power).

It's clear I don't need an update on the battery every minute, but in case of a power failure, I need to shut down some computers/NAS immediately or the soonest possible to avoid battery to be completely down. My Mac Mini Server alone can last 2 hours.

That's why I ask this question, and ask for another feature (but ok this is a "+" :) ), to be able to change dynamically the check value (but if I'm wrong and we can receive a power failure without a check, it's ok).

So when my Mac Pro is on, I need to check really often, if not, I can check less often, if my NAS is off too, then I can check rarely.

Thanks :)

EDIT: To be more specific, I don't use email notifications, but I could, but my need is to make automatic shutdowns via Shell Scripts, and not to ask me to shutdown :)

Posted on
Tue Sep 10, 2013 12:46 pm
bschollnick2 offline
Posts: 1286
Joined: Oct 17, 2004
Location: Rochester, Ny

Re: Battery & UPS Monitor plugin.

ssciboz wrote:
Seems to works good !
But my question is : if I check the battery level every 6 hours, when the power is lost, is there any action we can make?
On my last test it was saying power failure only while it checked it (so 45 seconds after the lost of power).


No that is correct. The Refresh time is the only time that it checks the UPS status.
My suggestion is the default of 2 minutes, with 1 Minute on the power failure timer.

ssciboz wrote:
[That's why I ask this question, and ask for another feature (but ok this is a "+" :) ), to be able to change dynamically the check value (but if I'm wrong and we can receive a power failure without a check, it's ok).
So when my Mac Pro is on, I need to check really often, if not, I can check less often, if my NAS is off too, then I can check rarely.


This makes sense. I'm not sure how quickly I can get to this, but I'll see what I can do.

- Ben

------
My Plugins for Indigo (v4, v5, and v6) - http://bit.ly/U8XxPG

Security Script for v4 - http://bit.ly/QTgclf
for v5 - http://bit.ly/T6WBKu

Support Forum(s) - http://www.perceptiveautomation.com/userforum/viewforum.php?f=33

Posted on
Mon Nov 14, 2016 12:40 pm
McJohn offline
User avatar
Posts: 268
Joined: Dec 18, 2012
Location: The Netherlands

Re: Battery & UPS Monitor plugin.

Hello Ben,

Is the Battery & UPS Monitor plugin completely compatible with the new Indigo 7?

Kind regards,

John

Posted on
Mon Nov 14, 2016 5:38 pm
durosity offline
User avatar
Posts: 2932
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Battery & UPS Monitor plugin.

Just FYI if you find it doesn’t work then try out APCupsD and its plugin - it fully works (for me anyway) and is a lot of powerful than using the macOS UPS system.. for example it’ll give you info about the state of the batteries

Computer says no.

Posted on
Tue Nov 15, 2016 1:56 am
Coolcaper offline
Posts: 189
Joined: Aug 30, 2013
Location: Australia

Re: Battery & UPS Monitor plugin.

McJohn wrote:
Hello Ben,

Is the Battery & UPS Monitor plugin completely compatible with the new Indigo 7?

Kind regards,

John


Working well on mine so far!


Sent from my iPhone using Tapatalk

Posted on
Thu Feb 23, 2017 3:16 pm
Professor Falken offline
User avatar
Posts: 124
Joined: Mar 29, 2015

Re: Battery & UPS Monitor plugin.

Does anyone know if it is possible to have one Mac monitor two UPS's (and, if so, would this plug-in then allow monitoring of both)?

I have two separate UPS's that power a bunch of AV gear, as well as the the Indigo Mac mini, AD2Pi, modem, routers, switches, etc. One is an APC, but the other is another brand. I was hoping to use this plugin (and the Mac's built-in power monitor settings) to monitor both UPS's, but I am not sure that is possible.

If not I suppose I could use the separate APC plug-in for that one and this plug-in for the other one, but I was trying to avoid plugin bloat, plus the program for the APC one looks rather complex to set up.

Thanks for any advice.

Who is online

Users browsing this forum: No registered users and 0 guests