Page 6 of 10

Re: APCUPSD Plugin discussion

PostPosted: Thu Oct 13, 2016 10:53 am
by DaveL17
It's within the plugin package. Right click on the plugin file and select View Package Contents.


Sent from my iPhone using Tapatalk

Re: APCUPSD Plugin discussion

PostPosted: Tue Nov 22, 2016 1:16 pm
by yassi
I have this plugin working for a while but it seems so I didn't configured the apcupsd part in a good way, because last Sunday I had a power outage and I didn't get any message from Indigo.
The UPS was able to keep the MacMini alive (about 4 minutes power outage), but no message.

It seems so, I forgot to install and configure the two files: apccmdex and apcupsAction.

Where can I found them, they are not in the plugin package.

Thx!
Yassi

Re: APCUPSD Plugin discussion

PostPosted: Tue Dec 06, 2016 8:01 am
by mortenkols
I have a Socomec Netys PE 850 kVA UPS. I dont have so much knowledge about UPS. Can i use this plugin with my UPS?
I have tried to install the plugin, but i can't get communication with the UPS.

Here a link to the UPS:

http://www.socomec.com/range-ups-single ... #technical

Re: APCUPSD Plugin discussion

PostPosted: Tue Dec 06, 2016 9:57 am
by durosity
Doubtful, the APCupsD software is designed only for APC UPSes. You could try this one though if macOS recognises it?

viewtopic.php?f=33&t=9559

Re: APCUPSD Plugin discussion

PostPosted: Tue Dec 06, 2016 11:07 am
by mortenkols
I have tried this plugin, But the macOS dosent recognise the ups. Any suggestion ?

Re: APCUPSD Plugin discussion

PostPosted: Tue Dec 06, 2016 1:01 pm
by durosity
You didn't install the APCUPSD software before testing with macOS did you? It disables the kext macOS uses to identify the UPS (because it'd interfere with the apcupsd connection)

Re: APCUPSD Plugin discussion

PostPosted: Tue Dec 06, 2016 2:27 pm
by mortenkols
I tried first the battery monitor ups plugin. i didn't get that to work, so then i tried APCUPSD plugin. Installed the APCUPSD software and then the plugin, but the OS X can't find the ups.

Is there any trick i must do on OS X to find my UPS?

Re: APCUPSD Plugin discussion

PostPosted: Wed Dec 07, 2016 10:31 am
by durosity
The only way to get that to work would be to modify APCUPSD to be able to read your USP. Unless your UPS uses the same protocols as APC (which is pretty dang unlikey) i doubt you'll be able to get it to work using this system.

Have you had a search of interwebs to see if there's any scripts around for reading that model? If so you could possibly modify one to parse the information into Indigo variables?

Re: APCUPSD Plugin discussion

PostPosted: Wed Dec 07, 2016 1:21 pm
by mortenkols
I have searched but i can't find anything about it.

Im just interested in when the ups goes on battery. There is a option to run a script (First delay script), is it possible to make a script to update a variable when it is on battery?

Re: APCUPSD Plugin discussion

PostPosted: Wed Dec 07, 2016 3:44 pm
by durosity
I don't see why not.. i'm curious as to what kind of script the UPS is expecting to run. Might be worth looking at the shutdown.sh one it references for shutdown to see what it does.. perhaps a duplication and modification of that could work?

Re: APCUPSD Plugin discussion

PostPosted: Thu Dec 08, 2016 9:47 am
by mortenkols
This is the shutdown.sh script. it turns off my mac mini if the battery on the ups is low.

Code: Select all
#!/bin/bash

shutdown -hu now

----------------

i have tried to make a script to update a variable, but I failed. what is wrong? :D

Code: Select all
UPS = indigo.variables[206759487] # "UPS"

indigo.variable.updateValue(UPS, "true")

Re: APCUPSD Plugin discussion

PostPosted: Thu Dec 08, 2016 12:33 pm
by berkinet
berkinet wrote:
mortenkols wrote:
This is the shutdown.sh script. it turns off my mac mini if the battery on the ups is low.
#!/bin/bash shutdown -hu now
----------------
i have tried to make a script to update a variable, but I failed. what is wrong? :D
UPS = indigo.variables[206759487] # "UPS"indigo.variable.updateValue(UPS, "true")

The problem appears to be using Indigo internal (plugin) Python programming syntax in a bash shell script. You want Indigo to change the value of an internal variable. But, the shell script is executed by the bash shell, which is a completely separate process. The only (simple) way to have the script interact with Indigo would be through the Indigo RESTful API.

An example of such a URL to set the value of Indigo variable powerFail to true would look like:
http://127.0.0.1:8176/variables/powerFail?_method=put&value=false

You can test that by simply pasting the URL into a browser window.

To execute that from a shell script you would need a means to simulate a browser. The solution is curl which is provided in the standard OS X release. Something like this:
Code: Select all
curl --user username:password --digest  -X PUT -d value=true http://127.0.0.1:8176/variables/powerFail
Just change "username" and "password" to whatever you have set for Indigo, put that into your shell script and you should get the result you want.

Re: APCUPSD Plugin discussion

PostPosted: Fri Dec 09, 2016 1:17 pm
by mortenkols
thank you so much. have tested it and it worked !!=)

Re: APCUPSD Plugin discussion

PostPosted: Sun Dec 18, 2016 6:36 am
by yassi
Hi guys,

after moving my Indigo 6 to another MacMini with ElCapitan and reinstalling a fresh copy of the apcupsd package (3.14.14), I have the issues stated on their web page:

Mac OS X 10.11 “El Capitan” support
Installer is now compliant with SIP (aka “rootless”) requirements. apcupsd executables are installed into /usr/local/sbin instead of /sbin. Config files and scripts remain in /etc.
NB: There continues to be a known issue with USB UPSes under OS X where the OS power management service occasionally does not relinquish control of the UPS, leaving apcupsd unable to communicate with it. The workaround is to unplug and replug the USB cable after booting the Mac.


Even after several reboots, unplugging the cable and selecting another USB port, the UPS isn't recognized (even in AppleProfiler not).
Have the mention, that the package was working with my old MacMini with 10.6.8
So, can't use the plugin till the UPS isn't recognized.
Checked the config file (under /etc/apcupsd), it's correct, for USB.

Does one can help?
If not, how can I remove the apcupsd package, where is the uninstaller? Can vague remember, there must be a shell script to uninstall it.

Thanks in advance,
Yassi

Re: APCUPSD Plugin discussion

PostPosted: Sun Dec 18, 2016 7:27 am
by durosity
I recall there was a bug where after a restart you had to unplug the UPS and replug it back in.. might be worth giving that a try? (Just for reference I've got an APC 1500va smart ups connected to my Mac Pro 2008 running El Capitan and it sees it fine, so it definitely does work on 10.11)


Sent from my iPad using Tapatalk