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

Solved a particular Vultech UPS (UPS2000VA-PRO) issue #2738

Open
mrrmtt opened this issue Dec 26, 2024 · 0 comments
Open

Solved a particular Vultech UPS (UPS2000VA-PRO) issue #2738

mrrmtt opened this issue Dec 26, 2024 · 0 comments
Labels
enhancement Qx protocol driver Driver based on Megatec Q<number> such as new nutdrv_qx, or obsoleted blazer and some others
Milestone

Comments

@mrrmtt
Copy link

mrrmtt commented Dec 26, 2024

Hello,
I don't have much experience with software development or GitHub in general, but I found a solution for my particular UPS problem and I'd like to help others prevent my time consuming research if possible.
I have this Vultech UPS: Model UPS2000VA-PRO, EAN13 8057284627203, site link.

At the beginning I tried to manage all the NUT capabilities through Home Assistant VM under Proxmox, but it failed to work completely. So I created a dedicated NUT server debian VM under Proxmox.

For the most part, I found a specific configuration working quite well:
nutdrv_qx as driver, armac as subdriver, megatec as protocol, my /etc/nut/ups.conf looks like this (MODE=netserver):

[myups]
        driver = "nutdrv_qx"
        port = "auto"
        vendorid = "0925"
        productid = "1234"
        product = "UPS USB Mon V2.0"
        vendor = "RICHCOMM"
        subdriver = "armac"
        protocol = "megatec"
        offdelay = 180
        ondelay = 60
        ignorelb
        override.battery.charge.low = 30
        override.battery.charge.warning = 50
        pollinterval = 15

The problem was shutdown didn't work at all. Neither the shutdown.return function, nor the shutdown.stayoff one.
By trial and error, and by noticing that the only function to actually work to stop it was the load.off function (it stopped it instantly, not very useful), I found a working solution for this issue.
Here the details:
In the nutdrv_qx_megatec.c source within the /* qx2nut lookup table */

        { "shutdown.return",		0,	NULL,	"S%s\r",	"",	0,	0,	"",	0,	0,	NULL,	QX_FLAG_CMD,	NULL,	NULL,	blazer_process_command },
	{ "shutdown.stayoff",		0,	NULL,	"S%sR0000\r",	"",	0,	0,	"",	0,	0,	NULL,	QX_FLAG_CMD,	NULL,	NULL,	blazer_process_command },

has become

	{ "shutdown.return",		0,	NULL,	"S%s\r",	"",	0,	0,	"",	0,	0,	NULL,	QX_FLAG_CMD,	NULL,	NULL,	blazer_process_command },
	{ "shutdown.stayoff",		0,	NULL,	"S%s\r",	"",	0,	0,	"",	0,	0,	NULL,	QX_FLAG_CMD,	NULL,	NULL,	blazer_process_command },

Moreover within nutdrv_qx_blazer-common.c in blazer_process_command function

if (!strcasecmp(item->info_type, "shutdown.return")) { ...
			if (offdelay < 60) {
				snprintf(buf, sizeof(buf), ".%ld", offdelay / 6);
			} else {
				snprintf(buf, sizeof(buf), "%02ld", offdelay / 60);
			}
...

*** has become ***

			if (offdelay < 60) {
				snprintf(buf, sizeof(buf), ".%ldR0000", offdelay / 6);
			} else {
				snprintf(buf, sizeof(buf), "%02ldR0000", offdelay / 60);
			}
...

With these two changes NUT manages the shutdown process perfectly with this UPS, the ondelay and offdelay variables work as expected too. Perhaps I missed something but if someway this code can be helpful and become a further official integration for this UPS I'd be glad.
I want to thank all the devs for the software, it's great.
Matteo

@jimklimov jimklimov added enhancement Qx protocol driver Driver based on Megatec Q<number> such as new nutdrv_qx, or obsoleted blazer and some others labels Jan 2, 2025
@jimklimov jimklimov added this to the 2.8.4 milestone Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Qx protocol driver Driver based on Megatec Q<number> such as new nutdrv_qx, or obsoleted blazer and some others
Projects
None yet
Development

No branches or pull requests

2 participants