NUT Network UPS Tools Integration

Using Home Assistant (2022.11.2 - Doker) and NUT (0.11.0) on Raspberry PI3 (Buster), I want to supervised my Network UPS (S2S Syrius MS 6000 from Legrand - ms_ii_en.pdf) thanks to SNMP protocol.

S2S

I used the following pameter for the NUT Configuration:

devices:
 - config: []
   name: S2S_6000
   driver: snmp-ups
   port: 192.168.1.155
   mibs: ietf
   community: public
   snmp_version: v3
   pollfreq: 15
   secLevel: authNoPriv
   secName: admin
   authProtocol: md5
   privProtocol: des
mode: netserver
shutdown_host: "false"
users:
 - actions: []
   instcmds:
     - all
   username: admin
   password: Nut_Pasword
remote_ups_host: 192.168.1.155
remote_ups_user: UPS_USer_Name
remote_ups_password: UPS_USer_Password
remote_ups_name: ONDULEUR-TEDDY

My UPS is equipped with a CS 131 Network card (manual_CS121_en.pdf) with RJ45 output.

I used the SNMP protocol V3 as show below, according to the manual to monitore the CS121 the Standard-MIB for UPS-systems, RFC1628, is generally to be integrated into your NMS.

By the way, NUT doc shows compatible MIBS with the RFC 1628: ietf

Here the log file error:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-banner.sh
-----------------------------------------------------------
 Add-on: Network UPS Tools
 Manage battery backup (UPS) devices
-----------------------------------------------------------
 Add-on version: 0.11.0
 You are running the latest version of this add-on.
 System: Raspbian GNU/Linux 10 (buster)  (armv7 / raspberrypi3)
 Home Assistant Core: 2022.11.3
 Home Assistant Supervisor: 2022.10.2
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
cont-init: info: /etc/cont-init.d/00-banner.sh exited 0
cont-init: info: running /etc/cont-init.d/01-log-level.sh
cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0
cont-init: info: running /etc/cont-init.d/02-set-timezone.sh
[22:38:41] INFO: Configuring timezone
cont-init: info: /etc/cont-init.d/02-set-timezone.sh exited 0
cont-init: info: running /etc/cont-init.d/nut.sh
[22:38:42] INFO: Setting mode to netserver...
[22:38:42] INFO: Generating /etc/nut/upsd.users...
[22:38:43] INFO: Configuring user: admin
[22:38:46] INFO: Password is NOT in the Have I Been Pwned database! Nice!
[22:38:49] INFO: Configuring Device named S2S_6000...
[22:38:49] INFO: Starting the UPS drivers...
Created directory: /var/lib/snmp/cert_indexes
Startup timer elapsed, continuing...
Network UPS Tools - UPS driver controller 2.7.4
cont-init: info: /etc/cont-init.d/nut.sh exited 1
cont-init: info: running /etc/cont-init.d/nutclient.sh
cont-init: info: /etc/cont-init.d/nutclient.sh exited 0
cont-init: warning: some scripts exited nonzero
s6-rc: warning: unable to start service legacy-cont-init: command exited 1
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
/run/s6/basedir/scripts/rc.init: fatal: stopping the container.
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

Any One can help ?
Best regards

ah i didn’t think to do an automation checking on the unavailable state. that’ll probably solve my issue. thx for that tidbit

Are you running NUT server add-on through home assistant or directly on the raspberry pi os? your config is a little different layout to mine (mine through nut server add-on in home assistant). I recall I had issues with the layout when first setting up as the documentation wasnt right for my setup and through some trial and error the below worked

example below

devices:
  - name: ups1
    driver: snmp-ups
    port: 192.168.0.3
    config:
      - desc = "Smart-UPS C 1000 - UPS 1"
      - snmp_version = v3
      - secLevel = noAuthNoPriv
      - secName = apc_snmp_profile1
      - pollinterval = 15
    upsmon_deadtime: 25
  - name: ups2Emerson
    driver: usbhid-ups
    port: AUTO
    config:
      - desc = "Emerson - UPS 2"
      - pollinterval = 15
    upsmon_deadtime: 25
mode: netserver
shutdown_host: false
users:
  - username: xxxxxx
    password: xxxxxx
    instcmds:
      - all
    actions: []
list_usb_devices: true
upsd_maxage: 60
log_level: info

Hi,

Thank you very much, I transpose your example and it work like a charm now !
By the way, is there a way to get a switch button onto HA in oorder to swtich from battery mode to the AC mode ?

Thanks

I am not familiar with that UPS to know the features unfortunately. If theres an API or way to do this via serial or web interface then I’m sure there should be a way to do this. This will be seperate to the NUT server/client setup though.

Why did I just get a massage saying NUT was no longer supported and to remove it in Home Assistant. My UPS just stopped updating?

EDIT: Guess I just needed to upgrade the integration! My Bad.

Really good writeup. Thanks!

I ran into the APC SHA/AES bug

Add-on version: 0.12.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 10.3  (amd64 / qemux86-64)
 Home Assistant Core: 2023.6.3
 Home Assistant Supervisor: 2023.06.2

Cyberpower - SHA/AES
APC - MD5/DES

- name: ups-PR2000RTXL2U
  driver: snmp-ups
  port: 192.168.1.10
  snmp_version: v3
  secLevel: authPriv
  authProtocol: SHA
  authPassword: 0123456789ABCDEF
  privProtocol: AES
  privPassword: 0123456789ABCDEF
  pollfreq: 15
  desc: description does not work
  config: []
  
- name: ups-apc-x2200
  driver: snmp-ups
  port: 192.168.1.11
  snmp_version: v3
  secLevel: authPriv
  authProtocol: MD5
  authPassword: 0123456789ABCDEF
  privProtocol: DES
  privPassword: 0123456789ABCDEF
  desc: description does not work
  config: []

Thank you for sharing the quick how-to! This was very helpful in my setup!!!

My UPS is available using SNMP but this addon shows UPS as not detected during startup.
How can I provide additional MIB file (mib: triplite 1.54) so my UPS using driver: snmp-ups is detected?
(after Going back to the classic MIB detection method.) log message


- config: []
  driver: snmp-ups
  name: VertivUPS
  description: Vertiv EDGE-1500IRT2UXL
  port: 192.168.0.82
  mibs: ietf
  community: public
  pollfreq: 5

mode: netserver