This plugin requires apcupsd (http://www.apcupsd.org) to be installed and running on whatever machine your UPS is connected to.
When you install the plugin you will need to configure it. In the Plugin configuration dialog set the frequency at which the Indigo devices should be updated, a connection timeout, and a debugging level.
Once configured plugin will allow you to create an Indigo device for each apcupsd instance (IP Address & Port) you have.
When creating an apcupsd plugin device, you need to:
- Provide an IP Address. If you have apcupsd running on the same machine as your Indigo server, select the default local host. Otherwise select Will Specify and enter the IP Address in textfield that appears.
- Enter the port number. The default of 3551 should be correct for most installations.
- Select the UPS Report Fields you wish to use for states in this device. The default set contains the fields that are most likely to be of interest. Buttons are available to:
- Select all states (fields)
- Deselect all states (fields)
- Reset default states list (i.e. Reset)
- Specify the state (field) to be displayed for this device in Indigo's Devices window State column
- Click Save
For release v0.3.1
This release contains a re-write of the query engine and several new features:
- If the apcupsd server reports lost communications with the UPS, an error will be reported in the Devices window, States column and the device text color will change to red.
- State names are now in lower case
- The status state is now hard coded and will not appear in the states selection list
- If apcupsd reports lost communication with the UPS, most state values will change to show "n/a"
Values that are preserved when communications is lost will be marked with an * - Tooltips are available for all states listed in the ConfigUi
- Clicking the ? in the ConfigUi will bring up a complete list of available states and their description. A link is also provided for the online apcupsd documentation.
- Triggers are provided for every event the apcupsd daemon generates.
Note: In order to receive events from the apcupsd daemon, you must install two programs that are included with the plugin AND make changes to the apcupsd configuration (See instructions below) - When querying the apcupsd server, the plugin now uses the /sbin/apcaccess program which is automatically installed by the apcaccess installer.
- A new action is available to dump a full UPS query to the log.
- A new menu item is available to dump a full config for all UPS devices to the log.
If you are upgrading from an earlier version of the plugin, you will need to do the following:
- Disable the plugin
- Delete the plugin from the Indigo 6 Plugins (Disabled) folder
- Delete the file com.berkinet.apcupsd.indiPref from the Indigo 6, Preferences, Plugins folder
- Delete all apcupsd plugin devices
- Restart the Indigo server
- Install, and configure, the v0.3.1 plugin
- Create your UPS devices
Enabling event notification from the apcupsd daemon
- Place the two enclosed files (apccmdex and apcupsAction) in /usr/local/bin.
- Determine your numeric user ID (UID). In a terminal window just enter id
The first bit of info will be uid=xxx that is the number you need. If you run the Indigo server as another user, you will need that user's UID. - Edit each of the user notification files in /etc/apcupsd that you wish to have notify you. By default apcupsd provides:
commfailure, commok, changeme off battery and onbattery- On the first line change #!/bin/sh to #!/bin/ksh
- Then, anywhere below the first line add the following line
/usr/local/bin/apccmdex -u xxx -p /usr/local/bin/apcupsdAction -a `basename $0` -d yyy
where xxx is your uid and yyy is the device from Indigo. - You can leave the rest of the file alone or comment (#) it out. All except the exit 0, that needs to stay.
Please use the apcupsd plugin discussion forum to post any issues, questions, ideas, etc.
Enjoy!
Release notes:
v 0.0.1 Sep 11, 2013
- Created the plugin from a previous script
v 0.1.0 Sep 12, 2013
- First public release
Added state selection options (All, None, Default set)
Added ability to display state descriptions from apcupsd.org
Added option to select the state to be used for the Devices window state column
Added error handling and reporting for connection errors
Added action to update UPS device on demand
Added Menu script to refresh all UPS devices
v 0.1.1 Sep 12, 2013
- Changed button text in Devices.xml
v 0.2.0 Sep 13, 2013
- Added error reporting in State column in case of lost communications to the UPS
Changed the STATUS state to be hard coded - required to determine comms status
Fixed several minor errors in rarely used methods
Added deleting state values in case of lost comms (commLostStatesList)
Added tooltips to states in ConfigUi
Added Complete states list in support URL
v 0.3.0 Sep 14, 2013
- Finalized list of state values to keep if commlost
Added notation (*) to state values that are preserved during a comm failure
Improved error detection and retry login for status update polling
Changed state names to lower case
Switched query engine from native Python to call /sbin/apcaccess
Added event triggers for all apcpusd events
Added 2 utility programs to integrate with apcupsd events: apccmdex and apcupsdAction
v 0.3.1 Sep 15, 2013
- Added acton to dump full status report for a UPS device to the log
Added menu item to log full status report for all UPSs
v 0.3.2 Sep 15, 2013
- Various small. but critical bug fixes
v 0.3.3 Sep 16, 2013
- Changed event names to show apcupsd event name + description
Changed definition of status ONLINE to != COMMLOST
Changed model name to "apcupsd UPS"
Added apcupsdAction to readApcupsd - to let events force a status update
Added documentation on creating event handlers