-
-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a dummy-ups script to examples? #2807
Comments
Sounds interesting, thanks! Some new entry under the Also a Tech-wise, it may be hard to specify |
I can probably blend the description above with the existing README from the file comments... I'll have to research the .adoc format :) (btw, where there spelling mistakes I missed?)
Yeah, the staleness was really designed to reflect the network connectivity to the API server, not the liveliness of the monitor, but that did give me a couple ideas: A. I should probably have the monitor start "before" the dummy-ups driver with a ExecStartPre mode to disable the port-file, so any pre-shutdown (and now quite stale) state isn't exposed at startup, and connectivity is "proved" before a real ups.status is made available. B. I could potentially offer a pull request for dummy-ups with a new "keyword" (TBD named, "ACTIVE_TIMEOUT"?) which would cause the driver to claim data "stale" if the modify-time wasn't changed by the stated timeout, proving an active file manager. Useful? Unrelated, I noticed that to be "net-protocol" consistent, the float numbers need to be in "POSIX" format, and running the monitor in some locales (eg da_DK) would result in incorrect radix characters; so I'm fixing that...and I should map non-POSIX radix characters retrieved from the API as well... |
I wrote a bash script to integrate my local Enphase's Envoy API (a simple JSON based local web API) with a dummy-ups driver's port file. I've just published it (GPLv3) at https://github.com/sshambar/enphase-monitor
The script is simple to use, and provides information on "grid" online/offline status, battery SOC, and several other details (like "load" and "runtime") from the Enphase system. I use it to integrate with current UPS + ATS (automatic transfer switch) to treat my house battery system as 2nd UPS. I didn't feel it merited writing a full driver as I'm not using it for FSD, outlet control or anything "interactive", I just didn't want my servers shutting down when my UPS failed (don't ask) and the house still had backup power. Plus it's nice to have another way to monitor the Enphase system using the NUT cgi programs...
The script is probably something others could use as an basis for integrating with similar web APIs using the dummy-ups as a hook to the NUT system, so I thought perhaps it made sense to add as an "example" script someplace in the source?
The script has nice features such as:
I would have rather created a pull request against NUT, but I honestly don't know where I would add the file here... perhaps someone can suggest a directory if you think it might be useful.
In any case, anyone wanting to add Enphase local API support to NUT can use it as is.
PS. yes I know there's a "external" Enphase API, but it's request limits are severely restricted without paying a high fee...
The text was updated successfully, but these errors were encountered: