Integrate UPS with MSR
-
As always Patrick, thank you for your attention.
I will follow your recommendation at the weekend and see if I can then have control by NUT, if this is possible then I communicate to you with your usual kindness to help us to then have access via MSR.
Thank you very much and I will inform you next week.
-
toggledbitswrote on Jun 1, 2022, 1:47 PM last edited by toggledbits Jun 1, 2022, 9:47 AM
-
kfxoreplied to toggledbits on Jun 1, 2022, 5:06 PM last edited by kfxo Jun 1, 2022, 3:57 PM
Getting this error in the log when restarting Reactor after performing the installation steps for NUT controller. I am on Reactor 22149 installed on Ubuntu in Docker.
[latest-22149]2022-06-01T16:54:36.344Z <Structure:INFO> Structure#1 loading controller interface nut (NUTController) [latest-22149]2022-06-01T16:54:36.345Z <Controller:CRIT> Controller: failed to load nut implementation /var/reactor/ext/NUTController/NUTController.js: [TypeError]TypeError: Incompatible base version; is 22125, requires at least 22145 [latest-22149]2022-06-01T16:54:36.346Z <Controller:CRIT> TypeError: Incompatible base version; is 22125, requires at least 22145 TypeError: Incompatible base version; is 22125, requires at least 22145 at Function.requires (/opt/reactor/server/lib/Controller.js:327:19) at Object.<anonymous> (/var/reactor/ext/NUTController/NUTController.js:9:53) at Module._compile (node:internal/modules/cjs/loader:1103:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:168:29) at ModuleJob.run (node:internal/modules/esm/module_job:197:25) at async Promise.all (index 0) at async ESMLoader.import (node:internal/modules/esm/loader:337:24) [latest-22149]2022-06-01T16:54:36.346Z <Structure:ERR> Structure#1 controller nut (NUT) skipped, implementation could not be loaded.
edit: Fixed in build 22152. See below.
-
Whoops! Sorry. I'm using a slightly newer version of some classes. Fixed now, 22152 build of NUTController available for download.
-
@toggledbits said in Integrate UPS with MSR:
Fixed now, 22152 build of NUTController available for download.
Confirmed fixed. Thanks.
-
NUT installed and running, it was a long way, I had to install VirtualBox and create a Linux VM because I couldn't find anywhere how to have NUT for Windows.
Now I see that to install NUTController you have to be Linux too? If your answer is yes, then I will have another huge journey, move the MSR from Windows bare-metal to this VM I created, and we will have to read a lot of manual, I know nothing of Linux.
-
It should run fine under Windows. Just create an
ext
directory in your Reactor install directory, unzip the archive, and copy theNutController
folder intoext
. If you look at theinstall.sh
script, all it does is install dependencies usingnpm
, so instead of running the script, just run thenpm
command manually:npm i --no-save --omit dev
Configuration steps are the same, but depending on how your VM is configured, you may need to do some network tricks in VirtualBox to make sure that NUTController can access the IP port of your NUT server in the VM. Can't help you there. VirtualBox is not my jam.
-
@toggledbits said in Integrate UPS with MSR:
22152 build of NUTController available for download.<
Thanks for publishing this. I am now using it on MSR Synology docker. Love it.
-
Hi Patrick
Well, I got all the installations done, and NUT is connected to the MSR.
Looking at the Reactor log, no error:
[latest-22149]2022-06-07T04:07:18.147Z <Structure:INFO> Structure#1 loading controller interface nut (NUTController) [latest-22149]2022-06-07T04:07:18.158Z <default:null> Module NUTController v22152 [latest-22149]2022-06-07T04:07:18.272Z <Structure:INFO> Starting controller NUTController#nut [latest-22149]2022-06-07T04:07:18.276Z <NUTController:NOTICE> NUTController#nut connecting to NUT server at "192.168.33.25":3493 [latest-22149]2022-06-07T04:07:18.278Z <NUTController:INFO> NUTController#nut started NUT client connection; waiting for ready [latest-22149]2022-06-07T04:07:19.258Z <NUTController:INFO> NUTController#nut connected and ready! [latest-22149]2022-06-07T04:07:19.260Z <NUTController:NOTICE> Controller NUTController#nut is now online.
In the VM using the command: upsc smart1500lcd@192.168.33.25 shows all the UPS data.
So, my difficulty as can be seen on the first screen, that I don't get the detailed UPS information in the MSR.
-
toggledbitswrote on Jun 7, 2022, 2:17 PM last edited by toggledbits Jun 7, 2022, 10:17 AM
You are not searching correctly in the Entities list. Your UPS name does not have "nut" in it. Rather than seaching for entities containing the word "nut", clear all fields and select your NUTController instance in the controller filter field.
-
-
Hi!
A query, my NUT service stops working recurrently, and when I make the query upsc myups@localhost I get the message Error: Data stale.
To get it working again I have to run upsdrvctl start to restart.
Has anyone experienced this difficulty?
-
Okay, job done, UPS > NUT > MSR > HE
The only thing that bothers me is that the UPS drive stops working without explanation, and I had to put a routine in crontab for it to restart every 10 minutes, I find this horrible but it was the only solution from everything I read, and I am not the only one to do it.
-
Does the NUTController's system entity show that the connection is down when that happens? If so, and NUT is running on the same host as MSR, it's probably pretty easy to just write a rule that restarts the NUT service when the controller has been marked down for X minutes (sustained for).
-
The NUT and MSR are in the same HW, but NUT is in a Linux VM, and MSR I run in Windows.
I was able to build a rule in MSR that analyzes 3 attributes of NUT, that if they stay without changing the content in 5 minutes gives me an alert of failure.
Strange, when I look at the service, it is all active, what crashes is the UPS driver, so I have to run
upsdrvctl stop upsdrvctl start
Now, is it possible via Windows MSR to trigger a command in the Linux VM to do this restart? It would avoid having to crontab, only reboot in real failure conditions, and not every 10 minutes.
Thanks.
-
I rescued an Eaton Ellipse ups from work that come back to life with fresh batteries.
Thought it would be easy to get some kind of system status or notification (from Windows) that somehow could be picked up in Reactor or at least in HA. Oh my... what a horror
After a long time following this guide I got NUT up and running on Windows @wmarcolin (Another VM is not a resonable option here)
Monitor a UPS attached to a Windows machineThen I added the HA integration just to se if it worked and it actually did
So now I want over the finish line, and install NUTController in Reactor.
It looked easy, but still, no luck.
This got me thinking on another possible solution. Reactor already monitors "System Memory" "Uptime" and so on, so maybe it also could monitor Powersource, Battery Level, Charging State? Then let Reactor react with its magic @toggledbits ?
For a Windows user that seems a lot easier and efficient as Windows just handle my UPS as the battery it actually is so it looked like "a laptop".Anyway, here is were I got stuck. No clue what more to try since the Nutserver is up and running and speaks with HA.
reactor.log gives me two errors:[latest-23196]2023-07-28T19:34:28.862Z <Structure:CRIT> TypeError: self.nut.setUsername is not a function [-] TypeError: self.nut.setUsername is not a function at NUTController.start_client (c:\reactor\ext\NUTController\NUTController.js:221:22) at NUTController.start (c:\reactor\ext\NUTController\NUTController.js:44:14) at Structure.start (c:\reactor\server\lib\Structure.js:362:56) [latest-23196]2023-07-28T19:34:28.863Z <NUTController:CRIT> TypeError: Cannot read properties of undefined (reading 'end') [-] TypeError: Cannot read properties of undefined (reading 'end') at Nut.close (c:\reactor\ext\NUTController\node_modules\node-nut\node-nut.js:65:15) at NUTController.stop (c:\reactor\ext\NUTController\NUTController.js:53:26) at c:\reactor\server\lib\Structure.js:366:48 [latest-23196]2023-07-28T19:34:28.864Z <Controller:NOTICE> NUTController#nut stopping
-
toggledbitswrote on Jul 29, 2023, 4:38 PM last edited by toggledbits Jul 29, 2023, 12:39 PM
Go into the extension directory (
ext/NutController
) and runnpm list
and post the output here.Also you need to show your NutController config.
-
Andrreplied to toggledbits on Aug 10, 2023, 10:04 PM last edited by Andr Aug 10, 2023, 6:04 PM
@toggledbits
So, back from vacation so time to take another shot at thisnpm list:
C:\reactor\ext\NUTController>npm list npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead. reactor-nutcontroller@0.1.22305 C:\reactor\ext\NUTController `-- node-nut@1.0.3
NutController config
- id: nut implementation: NUTController enabled: true #name: Eddie UPS NUTController config: server: 22.33.44.11 # modify the IP address as needed port: 3493 # optional, default shown username: "***" # optional, no user auth if not set password: "***" # optional, must be specified if username is used
-
Try commenting out the username from config. Authentication isn't needed for the queries being used.
-
@toggledbits
Yep, that did it
Thanks once again @toggledbitsAny thougts about getting more System Info into MSR by the way?
This got me thinking on another possible solution. Reactor already monitors "System Memory" "Uptime" and so on, so maybe it also could monitor Powersource, Battery Level, Charging State? Then let Reactor react with its magic