Network UPS Tools (nut) setup issues

If the ups instance is referenced as “ups” here maybe the items have to be referenced accordingly?
From:
networkupstools=“ups1:ups.status”
to:
networkupstools=“ups:ups.status”

Not according to the documentation:

Gave it a go anyway, no dice though :frowning:

hm, its working for me the only difference is I use a user/password which is my last suggestion to try… :neutral_face:

Tried adding a username and password, still no luck.
Could you please post relevant parts of your setup (minus username and password)?

Could the warning displayed by upsc be tripping up the module?
“Init SSL without certificate database”

I wish the binding would have some debug output…

Turns out I was facing the same problem as the guy in this topic.
Was about to post my findings when I saw his post.

Hi All

Can someone tell me whats required to monitor a Cyberpower UPS from OpenHAB thats connected via USB to a NAS? Its remote. I want OH2 to be a NUT slave

There is alot of conflicting information and the documentation for the networkups tools isn’t very good.

Thanks!

You would need to deploy the NUTS “server” on the NAS and establish comms via the USB cable to the UPS unit

You can then link one or more NUTS “clients” to this server remotely (over IP)

Then one of the “client” hosts would be your OH2 host with the NUTS Binding.

Most of the openHAB docs don’t deal with the actual NUTS setup. They describe how to configure the binding, assuming that you have NUTS properly up and running.

The QNAP is already running as Master and can see the UPS connected, displaying the battery etc just fine.

The linking is what i need help with. the OH2 server is a client. I put it in the allowed list on the QNAP.

I have done this in the past and I don’t remember the details (it’s fire and forget type of stuff :slight_smile:)
Maybe take a look at: Network UPS Tools - Documentation

The OH2 docs don’t cover this aspect (installation and configuration of NUTS):
https://www.openhab.org/addons/bindings/networkupstools1/

Which part is conflicting?

I’m monitoring the UPS attached to the QNAP NAS with the following networkupstools.cfg:

# Refresh interval for state updates in milliseconds (optional)
refresh=60000

# UPS device name
ups1.device=qnapups

# UPS server hostname (optional)
ups1.host=<QNAP_ip>

# UPS server port (optional)
ups1.port=3493

# UPS server login (optional)
ups1.login=admin

# UPS server pass (optional)
ups1.pass=<password>

ups.items:

Group gUPS "UPS" <ups> (All)
//Number gUPS_Output_Voltage "UPS output voltage [%.1f V]" (gUPS) {networkupstools="ups1:output.voltage"}
Number UPS_Battery_Charge "Battery level [%d %%]" (gUPS) {networkupstools="ups1:battery.charge"}
Number UPS_Battery_Voltage "Battery voltage [%.1f V]" (gUPS) {networkupstools="ups1:battery.voltage"}
Number UPS_Input_Voltage "Input voltage [%d V]" (gUPS) {networkupstools="ups1:input.voltage"}
Number UPS_Input_Voltage_Nominal "Input nominal [%d V]" (gUPS) {networkupstools="ups1:input.voltage.nominal"}
Number UPS_Current_Load "Current load [%d %%]" (gUPS) {networkupstools="ups1:ups.load"}
String UPS_Battery_Runtime "Runtime [JS(duration_from_seconds.js):%s]" <clock> (gUPS) {networkupstools="ups1:battery.runtime"}

Thank you , can you show me your configuration file on the QNAP? I think this is my gap…

Is this from a remote host running OH2 or OH2 is running directly on the NAS?

What configuration file on the QNAP?
The UPS is setup in web interface… no config file…

OH2 is running on a VM on QNAP.

1 Like

How do you know what the username and password is? The Web interface has no area to configure that

The username is admin and the password is the admin's one.
The same ones that you’re using to connect to QTS as administrator.

Oh I see.

Did you install the NUT client on the OH2 machine also? or just the networktools binding?

I see this in my /var/log/syslog


Dec  7 18:05:07 openhab2 systemd[1]: Starting Network UPS Tools - power device monitor and shutdown controller...
Dec  7 18:05:07 openhab2 upsmon[6828]: fopen /var/run/nut/upsmon.pid: No such file or directory
Dec  7 18:05:07 openhab2 upsmon[6828]: Unable to use old-style MONITOR line without a username
Dec  7 18:05:07 openhab2 upsmon[6828]: Convert it and add a username to upsd.users - see the documentation
Dec  7 18:05:07 openhab2 upsmon[6828]: Fatal error: unusable configuration
Dec  7 18:05:07 openhab2 upsmon[6828]: Network UPS Tools upsmon 2.7.4
Dec  7 18:05:07 openhab2 systemd[1]: nut-monitor.service: Control process exited, code=exited status=1
Dec  7 18:05:07 openhab2 systemd[1]: nut-monitor.service: Failed with result 'exit-code'.

did you have to deploy and configure upsc (the client component) on the VM or it works also without a local NUTS deployment? I don’t remember in this moment.

If I am not wrong, you need NUTS installed and configured also on the OH2 host

I think it works like this:

OH2 -> NUTS Binding -> upsc -> upsd -> USB -> UPS
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  xxxxxxxxxxxxxxxxx
          local                     remote

Now you see why its confusing.

Do you need a nut client on OH2? or is the binding a replacement!

1 Like