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”
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.
I have done this in the past and I don’t remember the details (it’s fire and forget type of stuff )
Maybe take a look at: Network UPS Tools - Documentation
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"}
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