UPS monitoring via SNMP

These are Tripp-Lite units

1 Like

Posting this kind of thing (especially in the “share your projects” section) is completely useless without the associated code to accomplish it.

is it just the cards in lovelace using pre-existing integrations/entities or do you use a new integration?

Sorry about that.

It’s just snmp sensors done according to docs. I used a windows program called ‘miblle browser’ to figure out what OIDs I was looking for.

I use sensor: !include_dir_merge_list sensors in my config, and so I drop this yaml file into the sensors folder:

  - platform: snmp
    host: tripplite2.mydomain.net
    version: 2c
    community: tripplite
    baseoid: .1.3.6.1.2.1.33.1.2.7.0
    unit_of_measurement: "°C"
    name: "UPS2 battery temperature"

  - platform: snmp
    host: tripplite2.mydomain.net
    version: 2c
    community: tripplite
    baseoid: .1.3.6.1.2.1.33.1.2.7.0
    unit_of_measurement: "V"
    name: "UPS2 battery Voltage"

  - platform: snmp
    host: tripplite2.mydomain.net
    version: 2c
    community: tripplite
    baseoid: .1.3.6.1.2.1.33.1.2.4.0
    unit_of_measurement: "%"
    name: "UPS2 battery charge remaining"

  - platform: snmp
    host: tripplite2.mydomain.net
    version: 2c
    community: tripplite
    baseoid: .1.3.6.1.2.1.33.1.2.7.0
    unit_of_measurement: "degrees"
    name: "UPS2 battery temperature"

  - platform: snmp
    host: tripplite2.mydomain.net
    version: 2c
    community: tripplite
    baseoid: 1.3.6.1.2.1.33.1.2.3.0
    unit_of_measurement: "minutes"
    name: "UPS2 runtime minutes remaining"

  - platform: snmp
    host: tripplite2.mydomain.net
    version: 2c
    community: tripplite
    baseoid: .1.3.6.1.2.1.33.1.3.3.1.3.1
    unit_of_measurement: "V"
    name: "UPS2 AC Input Voltage"

  - platform: snmp
    host: tripplite2.mydomain.net
    version: 2c
    community: tripplite
    baseoid: .1.3.6.1.2.1.33.1.4.4.1.2.1
    unit_of_measurement: "V"
    name: "UPS2 output voltage"

  - platform: snmp
    host: tripplite2.mydomain.net
    version: 2c
    community: tripplite
    baseoid: .1.3.6.1.2.1.33.1.4.4.1.4.1
    unit_of_measurement: "W"
    name: "UPS2 output load"
    
  - platform: snmp
    host: tripplite2.mydomain.net
    version: 2c
    community: tripplite
    baseoid: 1.3.6.1.4.1.850.1.1.3.1.3.1.5.1.2.1.1
    unit_of_measurement: "C"
    name: "UPS2 Battery Temperature"
    value_template: '{{ ((value | int) / 100) | int}}'
    
    
  - platform: snmp
    host: tripplite2.mydomain.net
    version: 2c
    community: tripplite
    baseoid: 1.3.6.1.4.1.850.1.1.3.1.3.1.1.1.1.1
    name: "UPS2 battery status" 
    value_template: >
          {% if value | int == 1 %}
            unknown
          {% elif value | int == 2 %}
            Normal
          {% elif value | int == 3 %}
            BatteryLow
          {% elif value | int == 4 %}
            BatteryDepleted
          {% else %}
            commfail
          {% endif %}

  - platform: snmp
    host: tripplite2.mydomain.net
    version: 2c
    community: tripplite
    baseoid: 1.3.6.1.4.1.850.1.1.3.1.3.1.2.1.4.1
    name: "UPS2 battery charge detail" 
    value_template: >
          {% if value | int == 0 %}
            float
          {% elif value | int == 1 %}
            charging
          {% elif value | int == 2 %}
            resting
          {% elif value | int == 3 %}
            discharging
          {% elif value | int == 4 %}
            normal
          {% elif value | int == 5 %}
            standby
          {% else %}
            commfail
          {% endif %}
          
  - platform: snmp
    host: tripplite2.mydomain.net
    version: 2c
    community: tripplite
    baseoid: 1.3.6.1.4.1.850.1.1.3.1.3.3.1.1.1.1
    name: "UPS2 Source" 
    value_template: >
          {% if value | int == 0 %}
            unknown
          {% elif value | int == 1 %}
            other
          {% elif value | int == 2 %}
            none
          {% elif value | int == 3 %}
            AC Input
          {% elif value | int == 4 %}
            bypass
          {% elif value | int == 5 %}
            battery
          {% elif value | int == 6 %}
            boosting
          {% elif value | int == 7 %}
            reducing
          {% elif value | int == 8 %}
            second
          {% elif value | int == 9 %}
            economy
          {% else %}
            commfail
          {% endif %}          

The lovelace config for each column looks like this:

type: vertical-stack
title: MAIN RACK UPS 1
cards:
  - type: picture-elements
    image: /local/images/tripplite.png
    elements:
      - type: state-label
        entity: sensor.ups1_ac_input_voltage
        style:
          top: 40%
          left: 84%
          font-size: 18px
          font-family: fantasy
          background-color: green
          padding: none
      - type: state-label
        entity: sensor.ups1_source
        style:
          top: 30%
          left: 18%
          font-size: 18px
          font-family: monospace
  - type: 'custom:bar-card'
    entities:
      - entity: sensor.ups1_battery_charge_remaining
        direction: right
        name: Battery
        icon: 'mdi:battery'
        color: green
        positions:
          icon: 'off'
          indicator: 'off'
          name: inside
          value: inside
        severity:
          - {}
    height: 20px
  - type: glance
    title: Battery Status
    entities:
      - entity: sensor.ups1_battery_status
        name: Health
        icon: 'mdi:battery-heart-variant'
      - entity: sensor.ups1_runtime_minutes_remaining
        name: Minutes
        icon: 'mdi:battery-alert-variant-outline'
      - entity: sensor.ups1_battery_charge_detail
        name: Detail
        icon: 'mdi:battery-charging'
      - entity: sensor.ups1_battery_temperature
        name: Temp
      - entity: sensor.ups1_source
        name: Source
    state_color: false
    show_state: true
    show_icon: true
    show_name: true
  - type: horizontal-stack
    cards:
      - type: gauge
        entity: sensor.ups1_battery_charge_remaining
        min: 0
        max: 100
      - type: gauge
        entity: sensor.ups1_battery_voltage
        min: 10
        max: 30
  - type: horizontal-stack
    cards:
      - type: gauge
        entity: sensor.ups1_battery_temperature
        min: 0
        max: 50
      - type: gauge
        entity: sensor.ups1_ac_input_voltage
        min: 100
        max: 130
  - type: horizontal-stack
    cards:
      - type: gauge
        entity: sensor.ups1_output_voltage
        min: 100
        max: 130
      - type: gauge
        entity: sensor.ups1_output_load
        min: 0
        max: 2000
  - type: 'custom:mini-graph-card'
    entities:
      - entity: sensor.ups1_battery_charge_remaining
        name: Charge Remaining (1hr)
        show_legend: true
    icon: 'mdi:battery-alert'
    hours_to_show: 1
    points_per_hour: 30
    lower_bound: 0
    upper_bound: 100
    animate: true
    show:
      labels: true
      points: hover
      state: false
  - type: 'custom:mini-graph-card'
    entities:
      - entity: sensor.ups1_output_load
        name: Output Load (1hr)
        show_legend: true
    icon: 'mdi:power-plug'
    hours_to_show: 1
    points_per_hour: 600
    line_width: 2
    smoothing: false
    animate: true
    show:
      labels: true
      points: false
      extrema: true
      state: false
3 Likes

Thank you for posting this information @VinistoisR !

Tripp Lite’s OID doc can be found at this URL: https://assets.tripplite.com/flyer/supported-snmp-oids-technical-application-bulletin-en.pdf

1 Like

Thanks @VinistoisR, I tried this but no luck as there must be other custom integrations or sensor definitions, since after using your YAML code none of the sensors are available/visible for my SNMP enabled Tripp Lite UPS.

Any chance you can post more detailed instructions and code? Much appreciated.

Here’s what I’m using with my TrippLite:


sensor:
  - platform: snmp
    host: poweralert-061036777249
    #    host: 10.0.1.7
    version: 2c
    community: tripplite
    baseoid: .1.3.6.1.4.1.850.1.1.3.1.2.1.1.8.1
    unit_of_measurement: "°F"
    name: "UPS ambient temperature"
    value_template: '{{ (value | int) / 10 }}'


  - platform: snmp
    host: 10.0.1.7
    version: 2c
    community: tripplite
    baseoid: .1.3.6.1.2.1.33.1.4.4.1.4.1
    unit_of_measurement: "W"
    name: "UPS output power"

  - platform: snmp
    host: <<replace with your own UPS IP address>>
    version: 2c
    community: tripplite
    baseoid: 1.3.6.1.4.1.850.1.1.3.1.3.3.1.1.1.1
    name: "UPS Source"
    value_template: >
      {% if value | int == 0 %}
      unknown
      {% elif value | int == 1 %}
      other
      {% elif value | int == 2 %}
      none
      {% elif value | int == 3 %}
      AC Input
      {% elif value | int == 4 %}
      bypass
      {% elif value | int == 5 %}
      battery
      {% elif value | int == 6 %}
      boosting
      {% elif value | int == 7 %}
      reducing
      {% elif value | int == 8 %}
      second
      {% elif value | int == 9 %}
      economy
      {% else %}
      commfail
      {% endif %}

1 Like

Just an hint:

use this app (as suggested) to discover codes
setup properly the app
import this database of codes

make a query to the device (subtree, top right list) of the entire UPS list.
Grab your values!

To test the connection, use this one : ‘.1.3.6.1.2.1.1.1.0’ who is sysDescr, should work with every device.

Thank you they’re working great.

I would like some help to add the total energy consumed by the Tripplite in my Energy dashboard.

I think the sensor that has this information is the sensor.output_load sensor.

Unfortunately it seems like it’s not compatible with the Energy dashboard as it can’t be found there.

I think that I must create a Riemann sum integral sensor but I don’t know what to put in there.

image

If anyone could help me on this one it would be very much appreciated.