Skip to content
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

Is there an API to add a custom UPS ? #1056

Closed
donnib opened this issue Jul 4, 2021 · 3 comments
Closed

Is there an API to add a custom UPS ? #1056

donnib opened this issue Jul 4, 2021 · 3 comments

Comments

@donnib
Copy link

donnib commented Jul 4, 2021

Hi,
I have a solar system consisting of an item called Victron Cerbo GX which i can talk to Modbus TCP / MQTT etc so i can in NodeRed for example do something with the data for example i'd like to tell the NUT server i have a UPS and hand over information about it like when battery is low etc. Is there a API or something that i can call to integrate my own UPS ?

/donnib

@jimklimov
Copy link
Member

jimklimov commented Jul 5, 2021

Hello, please read up the developer guide texts in the docs/ of the sources.

In short, NUT has a three-layer architecture, with vendor/protocol-specific device drivers talking to hardware over some media (serial/USB ports or networked SNMP are most common but not only options); these NUT drivers talk to an upsd server on same system (using a local pipe protocol and I guess you can say API based on using same libs and headers) and that server represents them using common networked NUT protocol to clients like upsmon (and many others) using a C or C++ client library, running on local or remote systems.

What you are after here is making a new NUT driver for your device. I believe there were already some efforts for solar device support as a concept (similar but different from UPS or ePDU for example), as well as a few drivers for Modbus TCP, including a recent PR #1052. I'm traveling this week so can't quickly find if any efforts on MQTT were completed and merged, but some were started at least. Maybe there are PRs or experimental branches on github to that effect.

@dtsecon
Copy link
Contributor

dtsecon commented Jul 5, 2021

Hello all,
generic_modbus driver (PR #1052) intends to support generic UPS devices with contact signals through modbus TCP/RTU gateways (also known as RIO - remote I/Os).

[UPSD] <--- IPC ---> [GENERIC_UPS] <--- modbus TCP/RTU ---> MODBUS-RIO <--- contacts ---> [UPS DEVICE]

On the other hand you can setup any kind of modbus server, and configure generic_modbus driver to connect and read or write specific registers. Your application / modbus server could then drive NUT statuses (e.g. OL, OB, HB etc) by writing over those registers.

@jimklimov
Copy link
Member

FYI: generic_modbus was recently merged, so you can try it with a build of NUT master branch now. Thanks @dtsecon !

jimklimov added a commit that referenced this issue Sep 21, 2021
#1056 about the data-path and generic use for the modbus driver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants