HomeGenie Forum

Automation Program Plugins and Wizard Scripting => Help => Topic started by: bkenobi on December 15, 2014, 10:41:32 PM

Title: ACPUPSD support
Post by: bkenobi on December 15, 2014, 10:41:32 PM
Has anyone looked into adding support for any UPS's in HG?  I am about to hook an APC brand UPS up to the Raspi and will be using apcupsd to handle communication.  I envision having HG emailing or texting me when power goes down and ideally when it comes back online.  If no one has looked into it yet, I'll see what I can come up with after playing with apcupsd a bit this evening.  I'm assuming it should be possible one way or another.
Title: Re: ACPUPSD support
Post by: drpepper on December 16, 2014, 12:45:05 AM
Good idea. Going to do it via the CGIs or apcaccess polling or something else?
Title: Re: ACPUPSD support
Post by: bkenobi on December 16, 2014, 01:34:25 AM
I'm not sure now.  I reviewed the manual for apcapud and it already can email/text when the power fails by modifying the script (which may need tweaking anyway).  I may try to get the events broadcast in such a way that HG sees them so that if someone wants to make a widget for visualization, they'd be set.  I'll have to verify that my UPS works with things first, but it looks very promising!
Title: Re: ACPUPSD support
Post by: bkenobi on December 16, 2014, 07:41:51 AM
I got apcupsd installed and working.  I then tried to install the CGI component so I could query data from HG.  The issue I ran into is that the CGI interface uses apache, which is not installed on the HG raspi image.  I could install it, but I'm concerned that it will interfere with whatever web server hg uses.

I'm going to run more tests on apcupsd to verify that it can shut the raspi down correctly before I spend much time configuring it with hg.  I assume it will be fine, but I'd like to be sure.  Oh, one note for those considering using apcupsd.  If you install it and plug in your ups without properly configuring it, you may break other things.  My system was up and responsive but was not capable of sending x10 commands to the cm15a.  Once configured, it seems to run correctly.
Title: Re: ACPUPSD support
Post by: drpepper on December 16, 2014, 11:28:31 AM
I would want to minimize the overhead if it's running on a Pi, so no apache. I would also try to avoid making users alter their configuration too much. For a quick and dirty, I wouldn't object to polling apcaccess via exec or io events but there could be a cleaner option.

According to the docs apcupsd events will "also generate a call to /etc/apcupsd/apccontrol which in turn will call any scripts you have placed in the /etc/apcupsd directory". So you place your script in that dir, have it curl the HG /api and implement a webservice call received method in your program code to receive the call from your script, parse the event and call any actions you want in HG.

I've got a spare APC to test with, just not the time right now  :-[ Let me know how you get along and I'll have time over Christmas break to help or make a widget or something  :)
Title: Re: ACPUPSD support
Post by: bkenobi on December 16, 2014, 02:37:10 PM
It took me several months to get up to speed on the c# implementation within HG.  Not being a c# programmer and not touching c since school, it was nice to learn something new.  I'll give the webservice class a reviews and hopefully come up with something.  I really didn't want to install a new web server since one is already running.  I really don't even want to run a second web page since it's really not needed.  I envision using HG for visualization of power (if at all).  Realistically, I could have apcconrtol call a script that emails me, so technically hg isn't needed.  It would be nice to have a widget in my dashboard that shows the basic stats though (number of power outages/brown outs, time on battery, battery charge, line voltage, etc).  But, I'm not sure how easy .json will be to pick up.
Title: Re: ACPUPSD support
Post by: bkenobi on December 17, 2014, 06:37:54 PM
It looks like the best approach for obtaining voltage/battery %/etc might be to create a script that calls "sudo apcaccess status" and then parses it for important info for HG to use on a given interval (60 or 300 seconds probably).  As for power failures and other critical events, it's probably best to have apccontrol call a HG with a string of what the error is.  Then, based on the error, HG can send an email/text.

One question.  If apcupsd needs to shut down the system, would it be good to stop HG?  Gene mentioned in another thread that it's better to restart the service via the button in the maintenance section so that HG has time to write values.  Is that really needed?
Title: Re: ACPUPSD support
Post by: drpepper on December 18, 2014, 07:29:21 AM
Just an option, you can always call Program.Quit() in your event handler that's called if you're notified of a power outage, but if your system is doing a clean shutdown/halt then it will just call 'service homegenie stop' anyway which will perform the flush writes anyway. So if Program.Quit() gives you the warm fuzzies it's an option, otherwise `shutdown -h now`just before battery death.
Title: Re: ACPUPSD support
Post by: bkenobi on December 18, 2014, 05:01:04 PM
I'm stuck on step one of communicating between apcupsd and HG.  I know that the daemon can run scripts which can then call anything I want (e.g., call a HG page), but I don't know what I would do in HG to set up a command for the daemon to call.  I know about module commands, but it seems like it would be better to have the daemon call something referencing a script directly.  There are a couple functions that seem designed for this, but I don't have an example of them in use.

http://www.homegenie.it/docs/doxy/d9/d20/class_home_genie_1_1_automation_1_1_scripting_1_1_tcp_client_helper.html (http://www.homegenie.it/docs/doxy/d9/d20/class_home_genie_1_1_automation_1_1_scripting_1_1_tcp_client_helper.html)

OnStringReceived
OnMessageReceived

I was originally looking at the NetHelper class

http://www.homegenie.it/docs/doxy/d1/d60/class_home_genie_1_1_automation_1_1_scripting_1_1_net_helper.html (http://www.homegenie.it/docs/doxy/d1/d60/class_home_genie_1_1_automation_1_1_scripting_1_1_net_helper.html)

But, it looks like that is more intended to pull content rather than listen for connections.  Can anyone help me get started?
Title: Re: ACPUPSD support
Post by: bkenobi on December 18, 2014, 06:11:05 PM
Perhaps I'm going about this wrong.  Maybe I should just be using  a WebServiceCall Recieved:

http://www.homegenie.it/docs/doxy/d4/dd7/class_home_genie_1_1_automation_1_1_scripting_1_1_events_helper.html#a58515455945c35783cde47d21f844663 (http://www.homegenie.it/docs/doxy/d4/dd7/class_home_genie_1_1_automation_1_1_scripting_1_1_events_helper.html#a58515455945c35783cde47d21f844663)

It looks like that would allow me to define an event that could be called from apcupsd.  I could do something like this in HG:


Code: [Select]
When.WebServiceCallReceived( "ups.event", (args) =>
{
var returnstring = "";
if (args == "power.off")
{
SendMessage( recipients, "Power out", "A power outage has been detected at " + DateTime.Now.ToString() + ".  HomeGenie is shutting down now.")
}
else if (args == "power.on")
{
SendMessage( recipients, "Power restored", "Power has been restored at " + DateTime.Now.ToString() + ".  HomeGenie is back up and running.")
}

return 0;
});

Then, I'd just need to add an entry to the apccontrol script that makes a call to:

Code: [Select]
http://<hg_server_address>/api/ups.event/power.offor

Code: [Select]
http://<hg_server_address>/api/ups.event/power.on
Does that look right?  I'd still need to figure out poling of the apcaccess status message within HG or writing a shell script to parse it first.
Title: Re: ACPUPSD support
Post by: drpepper on December 18, 2014, 08:37:33 PM
Yep! That's what I was referring to by "have it curl the HG /api and implement a webservice call received method in your program code"

Though I believe your args processing is off. args will be everything after /api/ so your if statement would not match.

You could match the whole thing 'ups.event/power.off' or split the args string and test them individually like
Code: [Select]
When.WebServiceCallReceived( "ups.event", (args) =>
{
string[] reqs = ((string)args).split('/');
string domain = reqs[0];
string event = reqs[1];
string device = reqs[2];

if (event == "power.off")
Title: Re: ACPUPSD support
Post by: bkenobi on December 18, 2014, 09:26:01 PM
Great, thanks for that!
Title: Re: ACPUPSD support
Post by: bkenobi on December 19, 2014, 04:19:41 AM
The compiler was really unhappy with using your code.  I haven't used input arguments before, so I'm struggling with getting it to work.  I went back to my original code and tried manually connecting to HG with a web browser and the code never seemed to run.  Not sure what I did wrong at the moment though.
Title: Re: ACPUPSD support
Post by: drpepper on December 19, 2014, 06:57:04 AM
Hi friend, try something like this:
Code: [Select]
When.WebServiceCallReceived( "Ups.Event", (args) =>
{
  string[] reqs = ((string)args).Split('/');
  if (reqs[1] == "Power.Off"){
    Program.Notify("UPS Event","Uh oh.");
  }
  return null;
});
Program.GoBackground();

Where it is requested with:

http://<HG>/api/Ups.Event/Power.Off/0

EDIT: Attach hgx for even easier testing  8)
Title: Re: ACPUPSD support
Post by: bkenobi on December 19, 2014, 05:53:29 PM
<Massive face palm>   :o

The reason my code failed was because I had a lowercase "s" in the "Split" command.  I had to copy your working code next to mine and it still took ~5 minutes to see it.
Title: Re: ACPUPSD support
Post by: bkenobi on December 20, 2014, 04:54:01 AM
I got the HG code working correctly.  I had 2 issues.  The first was missing the capital "S" as mentioned before.  The second was that my web browser wouldn't let me specify the capitalization I needed (it would change "power.off" to "Power.Off" on its own).  After I figured this out, the script is working great.
Title: Re: ACPUPSD support
Post by: bkenobi on December 20, 2014, 05:15:35 PM
Here is the first cut at a HG script for receiving apcupsd events.  It will email the recipient as specified in the settings and display a notification of the event.  When/if I figure out how to parse the "apcaccess status", I'll update the script and post it in a app submission topic.  If anyone wants to take the lead on the parsing and post the code, I'd greatly appreciate!
Title: Re: ACPUPSD support
Post by: drpepper on December 21, 2014, 02:47:41 AM
Good work! Can you post the output of your apcaccess status and any detail about what you'd like to see from it? Looks like different models have different data available, but all models have at least UPSNAME, STATUS, UPSMODE so those would be good starters.

Something like this works for example output. If you need a status widget that's just another line or two away.
Code: [Select]

var proc = new System.Diagnostics.Process {
    StartInfo = new System.Diagnostics.ProcessStartInfo {
        FileName = "apcaccess",
        Arguments = "status",
        UseShellExecute = false,
        RedirectStandardOutput = true,
        CreateNoWindow = true
    }
  };
  proc.Start();
  string model = "", status = "";
 
  while (!proc.StandardOutput.EndOfStream) {
    string line = proc.StandardOutput.ReadLine();
string[] output = ((string)line).Split(':');
 
switch (output[0].Trim()) {
    case "MODEL":
      model = output[1];
      break;
    case "STATUS":
      status = output[1];
      break;
    }
  }
  Program.Notify(model,status);


EDIT: Wow it hates my indenting preferences. And there is no syntax highlighting.  :P
Title: Re: ACPUPSD support
Post by: bkenobi on December 21, 2014, 04:00:59 AM
This is what was output right before the battery died during some functionality testing:

Code: [Select]
pi@raspberrypi ~ $ apcaccess status
APC      : 001,035,0904
DATE     : 2014-12-20 18:36:49 -0800
HOSTNAME : raspberrypi
VERSION  : 3.14.10 (13 September 2011) debian
UPSNAME  : BE550G
CABLE    : USB Cable
DRIVER   : USB UPS Driver
UPSMODE  : Stand Alone
STARTTIME: 2014-12-20 11:42:41 -0800
MODEL    : Back-UPS ES 550
STATUS   : ONBATT
LINEV    : 000.0 Volts
LOADPCT  :   0.0 Percent Load Capacity
BCHARGE  : 013.0 Percent
TIMELEFT :   5.1 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes
MAXTIME  : 0 Seconds
SENSE    : Medium
LOTRANS  : 092.0 Volts
HITRANS  : 139.0 Volts
ALARMDEL : No alarm
BATTV    : 12.0 Volts
LASTXFER : Low line voltage
NUMXFERS : 1
XONBATT  : 2014-12-20 12:32:04 -0800
TONBATT  : 21887 seconds
CUMONBATT: 21887 seconds
XOFFBATT : N/A
STATFLAG : 0x07060010 Status Flag
SERIALNO : <deleted>
BATTDATE : 2009-06-14
NOMINV   : 115 Volts
NOMBATTV :  12.0 Volts
FIRMWARE : 843.K1 .D USB FW:K1
END APC  : 2014-12-20 18:36:51 -0800

I would think things that would be useful would be:
STATUS   : ONBATT
LOADPCT  :   0.0 Percent Load Capacity
BCHARGE  : 013.0 Percent
TIMELEFT :   5.1 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes

There might be others, but these are the minimum that seem crucial.
Title: Re: ACPUPSD support
Post by: drpepper on December 21, 2014, 04:11:03 AM
Cool, then the code I posted in the last post should work fine, just add switch cases for those items. Wasn't sure what your goal of that particular data was. Like polling apcaccess once a minute and working that load data into the Analyze graphs of HG or just polling for status/bcharge and displaying it in a widget, etc.
Title: Re: ACPUPSD support
Post by: bkenobi on December 21, 2014, 04:39:08 AM
I hadn't thought about using charts, but that might be nice for some things.  I'll think about that and let you know.
Title: Re: ACPUPSD support
Post by: bkenobi on December 21, 2014, 05:35:56 AM
This is the new code.  I'd love to see a widget if you know how to code one.
Title: Re: ACPUPSD support
Post by: bkenobi on December 21, 2014, 03:49:25 PM
When I originally thought of incorporating this into HG, my original thought was to have email notification (done), automatic shutdown and restart or the Raspi (done), and a widget of some kind that showed pertinent information (TBD).  What I originally envisioned was something that looked like the original app embedded in HG.  I have no capability to do that nor know if that is realistic in any way.  A simple widget that's updated on a periodic basis showing numbers is ok, but this is what I was originally thinking about.  Alas, I only have limited coding skills (self taught on current languages) and no experience with anything HTML related.


http://sourceforge.net/projects/apcupsd/ (http://sourceforge.net/projects/apcupsd/)

http://a.fsdn.com/con/app/proj/apcupsd/screenshots/59404.jpg (http://a.fsdn.com/con/app/proj/apcupsd/screenshots/59404.jpg)
http://a.fsdn.com/con/app/proj/apcupsd/screenshots/59406.jpg (http://a.fsdn.com/con/app/proj/apcupsd/screenshots/59406.jpg)
http://a.fsdn.com/con/app/proj/apcupsd/screenshots/59408.jpg (http://a.fsdn.com/con/app/proj/apcupsd/screenshots/59408.jpg)
http://a.fsdn.com/con/app/proj/apcupsd/screenshots/68863.jpg (http://a.fsdn.com/con/app/proj/apcupsd/screenshots/68863.jpg)


I doubt something close to that can be generated, but a single widget with some of that info would be great.  Maybe even a second widget with the events.  Not sure how feasible that would be, so I'm ok with a very simple display widget with just the critical stuff.  I didn't see where in the data it provides info on last outage, last outage duration, how many outages, total duration, etc.  That must be stored by the program based on every recorded event.  Of course, every event is known by HG now too, so perhaps that would be a matter of storing the delta times and counting outages within HG.
Title: Re: ACPUPSD support
Post by: bkenobi on January 09, 2015, 06:38:22 PM
I modified my script slightly since it was sending several notification emails for every power event.  I still have 2 outstanding issues that I may need help with though.

1) When power goes out, the Raspi is shut down correctly and reboots correctly.  However, when shutting down, it appears to kill HG too quickly for an email notification to be sent out.  I'm not sure how to address this since apcupsd sends the system shutdown command and stops all programs on it's own.  So maybe I can add a wait statement in the system kill script somehow.  Also, when the system comes back up I don't know what event to use to send a notification.

2) I don't have a clue how to make a widget.  I checked the HG widget tool out, but between json and html, I'm stuck before I start.  I only really want to display a few items that I believe are available either directly in apcaccess or by logging events that HG already sees.  But, actually creating the widget to display this basic text is not something I'm clear about.
Title: Re: ACPUPSD support
Post by: drpepper on January 09, 2015, 09:19:46 PM
When do the When.SystemStarted and When.SystemStopping events get hit? Not sure if apcupsd shuts down the services, or which signal it sends to the process (SIGTERM/SIGKILL) so check when those events get hit. You could also try moving the homegenie to the end of the line in /etc/rc*.d/ (keeping in mind dependencies of course)

http://www.homegenie.it/docs/doxy/d4/dd7/class_home_genie_1_1_automation_1_1_scripting_1_1_events_helper.html#afcf0d379d8dd2da00c2adf1c3c9996f3 (http://www.homegenie.it/docs/doxy/d4/dd7/class_home_genie_1_1_automation_1_1_scripting_1_1_events_helper.html#afcf0d379d8dd2da00c2adf1c3c9996f3)
Title: Re: ACPUPSD support
Post by: bkenobi on January 10, 2015, 03:24:37 AM
I've used Linux for years, but primarily as an end user.  I've only worked with the administering minimally (primarily with set top boxes/tivo/raspi).  That being said, I don't understand the difference between the different /etc/rc*.d directories.  If you can elaborate where to look and what to change, I'd gladly look into changing it.
Title: Re: ACPUPSD support
Post by: drpepper on January 10, 2015, 03:37:32 AM
/etc/rc0.d would be the shutdown runlevel, when the system gets the call to shutdown it will stop all of the services in the order assigned in this directory, such as /etc/rc0.d/K20homegenie. By changing that to say K99homegenie you'd be putting homegenie at the end of the line of things to be stopped (unrealistic because the network service would stop before homegenie and it wouldn't be able to send a notification)

First, please test and ensure the When.System events don't meet your needs, that would be the best way to do things. Changing the rc.d order of things can be risky since the system sets the order based on dependencies. This should be solved in HG/mono for a more universal solution (i.e. a system or application exit event handler)
Title: Re: ACPUPSD support
Post by: bkenobi on January 10, 2015, 04:33:03 AM
I tried adding the following code to the end of my script:

Code: [Select]
When.SystemStopping( () =>
{
  Net.SendMessage( recipients, "HomeGenie shutting down", "notification");
  // returning true will route this event to other listeners
  return true;
});

Unfortunately, it did not send anything.  I shut down the service and got nothing from this function.  I then shut down and restarted the machine.  I did receive an email after reboot, but that was based on my IP check function detecting the machine coming back online.  I didn't see anything from the SystemStopping code.  I then added SystemStarting and didn't see anything either.  Perhaps I'm not using the function correctly, but I don't know how since I simply copied the cod off the documentation.
Title: Re: ACPUPSD support
Post by: drpepper on January 10, 2015, 05:18:37 AM
This may be due to HG's startup script running HomeGenie.exe with mono instead of mono-service (which would handle and relay the SIGTERM correctly, which is what actually fires those events). You can test this by stopping HG, then
Code: [Select]
$ cd /usr/local/bin/homegenie && sudo mono-service --debug HomeGenie.exe
then if things look okay and your program is set up to catch the SystemStopping event

Code: [Select]
$ kill `sudo cat /tmp/HomeGenie.exe.lock`
Title: Re: ACPUPSD support
Post by: bkenobi on January 10, 2015, 09:36:25 PM
I know very little about mono.  I tried the command and it looks like mono-service is not avalable:
Code: [Select]
pi@raspberrypi ~ $ cd /usr/local/bin/homegenie
pi@raspberrypi /usr/local/bin/homegenie $ sudo mono-service --debug HomeGenie.exe
sudo: mono-service: command not found
Title: Re: ACPUPSD support
Post by: bkenobi on January 12, 2015, 05:56:51 PM
Is the reason I don't have mono-service due to using the standard MRE (mono runtime environment) and not the MDK (mono development kit).  I saw you mention these in a different thread, so I thought maybe you have access to them since you are running a different environment.
Title: Re: ACPUPSD support
Post by: drpepper on January 13, 2015, 12:31:39 AM
Nope, mono-service should be an apt package depending on how you installed HomeGenie on your Pi. (I usually just install with mono-complete to get by without any CLR dependencies). Something like:

Code: [Select]
$ aptitude search mono|grep service
> p   mono-2.0-service                - Mono service manager for CLI 2.0
> p   mono-4.0-service                - Mono service manager for CLI 4.0
$ apt-get install mono-4.0-service -y (depending on what CLR your have installed)
$ cd /usr/local/bin/homegenie && mono-service --debug ./HomeGenie.exe
...etc...
Title: Re: ACPUPSD support
Post by: bkenobi on January 13, 2015, 08:07:42 AM
I installed the mono-4.0-service package and was able to run HG in mono-service --debug mode.  I tried stopping the service normally via:

Code: [Select]
sudo service homegenie stop
This didn't work with the mono-service so I was not able to test the above code.  Suggestions?
Title: Re: ACPUPSD support
Post by: drpepper on January 13, 2015, 03:21:26 PM
The service command will use /etc/init.d/homegenie which looks for the pid file at a different location. That's why I posted to check with the kill command using the pid file where mono-service puts it  ???

See the difference?
Code: [Select]
$ ls /tmp
 HomeGenie.exe.lock  homegenie.pid  ssh-n4R9fvuVltHa

If you want to use the service command, specify the same pid file when using mono-service like
Code: [Select]
$ mono-service --debug -l:/tmp/homegenie.pid HomeGenie.exe
Then you can probably use service homegenie stop.



Title: Re: ACPUPSD support
Post by: bkenobi on January 13, 2015, 04:46:57 PM
Right, I got that and used the lock file to stop the mono-service.  I was just wondering if that exits HG the same way as using the service stop command.  I did not get an email when HG exited from mono-service, so if that should have worked when using the kill command, it didn't.

I'll try using the -l command to see how that works.  Thanks!
Title: Re: ACPUPSD support
Post by: bkenobi on October 31, 2015, 07:48:39 PM
I'm looking to update this code to save the UPS details to a widget rather than outputting to a notification.  It looks like the generic sensor widget would be most appropriate to use (since I don't know anything about building a custom widget).  But, I'm not sure what parameters are available for saving to.  I know about a few that I've used, but I don't have a full list.  Is there a listing on GitHub or the documentation that would help?

Here's what I have right now:
Status.Battery
Sensor.Temperature
Sensor.Luminance
Sensor.Humidity
Meter.Watts
Sensor.DoorWindow
Sensor.Alarm
Sensor.Smoke
Sensor.Flood
Sensor.Heat
Sensor.Generic
Status.Level

I extracted this list from viewing the Javascript of homegenie/generic/sensor.  It would be good if there was a central location for all widgets (assuming one doesn't exist currently).
Title: Re: ACPUPSD support
Post by: kevin1 on November 02, 2015, 01:17:29 PM
The generic sensor widget allows any parameters to be created and then displayed.  I have this to show how frequently my sump pump is running...

Code: [Select]
Program.AddVirtualModules("HomeAutomation.ArduinoBsmtUtil", "Sensor", "homegenie/generic/sensor", 4, 4);
////
var module4 = Modules.InDomain("HomeAutomation.ArduinoBsmtUtil").WithAddress("4").Get();
Program.RaiseEvent(module4, "Sensor.SCPH", data[AM_SUMP_SCPH], "Sump pump cycles per hour counter on arduino ");

There are benefits to using the pre-defined ones you mention though (if they exist for your parameter)... some force an icon to show up for example.

I also have a generic sensor widget for the "multi-sensor" my Arduinos implement.  I added "uptime" parameter so I can see if they are resetting frequently (My ESP8266 started resetting too frequently after updating the arduino libraries a couple months ago). 
Title: Re: ACPUPSD support
Post by: bkenobi on November 02, 2015, 05:29:13 PM
How did you do the uptime?  I assume you just assign a string to the parameter and format it however you want it to be displayed rather than saving a number of seconds/minutes/hours/etc that HG has to convert (somehow knowing it's a time).

For the this APP, I will be writing state ("ONLINE"), battery remaining percent, and time remaining ("52.2 minutes").  I was thinking that parameters had to be decimal to be displayed, but now that I see you saving strings, that would make it a bit nicer than saving the state as "status.level = 1" which results in "1" showing up all the time.
Title: Re: ACPUPSD support
Post by: kevin1 on November 02, 2015, 07:41:19 PM
Arduino sends uptime as seconds then in HG I just do a couple rough calculations and display as string...

Code: [Select]
Program.RaiseEvent(module3, "Sensor.Uptime",   upd.ToString()+"d "+uph.ToString()+"h", "Uptime");
Title: Re: ACPUPSD support
Post by: bkenobi on November 02, 2015, 07:56:55 PM
Ok, that's what I figured.  I have it set up so that I can write the time in either string or float format.  The advantage of float is that I can use the statistics to view the data (should I need to).  But, using a string it's a lot easier since it comes in that way and it's nicely formatted in the widget.
Title: Re: ACPUPSD support
Post by: amselem on March 03, 2016, 02:35:20 AM
Hi
I have written a little widget for apcupsd. I also have refined your code to support pushalot notifications.

You can discuss here: http://www.homegenie.it/forum/index.php?topic=1465.0 (http://www.homegenie.it/forum/index.php?topic=1465.0)

Please note that I run HG under Windows so I don't know if it's going to help you.

Regards