Apcupsd for multiple UPS

Currently have the apcupsd component working but would like to be able to add multiple ups or add apcupsd_2:…:etc components.

Thanks!

anyonee? .

Not exactly a fix, but I went a different direction with my (6) home APC UPS units. I already had SNMP management cards in each of them and poll them via SNMP in Home Assistant. I can share the config if interested.

mine our only the usb models so i dont know if snmp is possible? but id be interested

APC 1000, 1500, etc Smart UPS can take snmp management cards.

This is all done in the configuration.yaml. I run HA on Windows, so using a Windows based snmpget command line utility. The utility syntax differs from platform to platform, but this should show the general idea.

Using one of my UPS units as an example:

sensor:

  • platform: command_line
    name: ‘UPS1 Name’
    command: ‘d:\apps\snmpget -r:192.168.254.100 -c:“secretpw” -o:1.3.6.1.4.1.318.1.1.1.1.1.2.0 -q’
    scan_interval: 600
  • platform: command_line
    name: ‘UPS1 Type’
    command: ‘d:\apps\snmpget -r:192.168.254.100 -c:“secretpw” -o:1.3.6.1.4.1.318.1.1.1.1.1.1.0 -q’
    scan_interval: 600
  • platform: command_line
    name: ‘UPS1 Location’
    command: ‘d:\apps\snmpget -r:192.168.254.100 -c:“secretpw” -o:1.3.6.1.4.1.318.1.4.2.2.1.7.1 -q’
    scan_interval: 600
  • platform: command_line
    name: ‘UPS1 Battery Capacity’
    command: ‘d:\apps\snmpget -r:192.168.254.100 -c:“secretpw” -o:1.3.6.1.4.1.318.1.1.1.2.2.1.0 -q’
    unit_of_measurement: ‘%’
    scan_interval: 60
  • platform: command_line
    name: ‘UPS1 Runtime Remaining’
    command: ‘d:\apps\snmpget -r:192.168.254.100 -c:“secretpw” -o:1.3.6.1.4.1.318.1.1.1.2.2.3.0 -q’
    unit_of_measurement: ‘Minutes’
    scan_interval: 60
  • platform: command_line
    name: ‘UPS1 Load Percentage’
    command: ‘d:\apps\snmpget -r:192.168.254.100 -c:“secretpw” -o:1.3.6.1.4.1.318.1.1.1.4.2.3.0 -q’
    unit_of_measurement: ‘%’
    scan_interval: 60
  • platform: command_line
    name: ‘UPS1 Battery Temperature’
    command: ‘d:\apps\snmpget -r:192.168.254.100 -c:“secretpw” -o:1.3.6.1.4.1.318.1.1.1.2.2.2.0 -q’
    unit_of_measurement: ‘°F’
    value_template: “{{ ((value|float*9)/5+32) | round(0) }}”
    scan_interval: 60
  • platform: command_line
    name: ‘UPS1 Battery Status’
    command: ‘d:\apps\snmpget -r:192.168.254.100 -c:“secretpw” -o:1.3.6.1.4.1.318.1.1.1.2.2.4.0 -q’
    value_template: “{%if value == ‘1’ %}Good{% elif value == ‘2’ %}Failed{% endif %}”
    scan_interval: 60
1 Like

1 Like

I’m trying to pull multiple APC UPS rack mount units with management cards in them into HA. Having a hard time getting past the apc add on and the nut add on that mostly seem like they deal with connected devices and not network. I was doing something similar to what you have above with my Nagios monitoring platform. Curious. Are you on Windows with HA? Noticed the command path. Is there an equivalent capability built into HA to pull SNMP info?

I’m not aware of a comparable way to do this native inside of HA. Yes, I am running HA on Windows 10 64-bit. I am using the HA command_line parameters to pull the SNMP information from all the UPS units using the snmpget program for Windows. Works perfectly for as many UPS units as you want. All mine are APC Smart UPS1000s or 1500s.

Still using this setup today…

Cool, thanks for the reply. I have all the data loaded with SNMP on my linux box now so just need to make it look pretty and work on automating shutdown of my systems should the batteries be close to failing.

I wrote a python based server to poll the local apcups status via the apcaccess command and report the status to Home Assistant via MQTT. I’ve got it running on my raspberry pi, should work on most Linux systems. This is still very fresh, feedback would be welcome.