RMCARD205 supplies metrics via SNMP for all supported CyberPower UPS. Who doesn't want to display power usage on their UPS via Home Assistant?
I created a "package" for CyberPower UPS RMCARD that exports data via SNMP. This assumes your default read-only community is named public.
packages/ups.yaml
:
sensor:
- platform: snmp
scan_interval: 60
name: ups_nompower
host: x.x.x.x
baseoid: 1.3.6.1.4.1.3808.1.1.1.4.2.5.0
accept_errors: true
unit_of_measurement: Watts
- platform: snmp
scan_interval: 60
name: ups_nominv
host: x.x.x.x
baseoid: 1.3.6.1.4.1.3808.1.1.1.3.2.1.0
accept_errors: true
unit_of_measurement: Volts
value_template: '{{((value | int) / 10) | int}}'
- platform: snmp
scan_interval: 60
name: ups_itemp
host: x.x.x.x
baseoid: 1.3.6.1.4.1.3808.1.1.1.2.2.3.0
accept_errors: true
unit_of_measurement: "°C"
- platform: snmp
scan_interval: 60
name: ups_timeleft
host: x.x.x.x
baseoid: 1.3.6.1.4.1.3808.1.1.1.2.2.4.0
accept_errors: true
unit_of_measurement: 'minutes'
value_template: '{{((value | int) / 6000) | int}}'
- platform: snmp
scan_interval: 30
name: ups_status
host: x.x.x.x
baseoid: 1.3.6.1.4.1.3808.1.1.1.4.1.1.0
accept_errors: true
value_template: >-
{% set status = (value | int) %}
{%- if status == 2 -%}
Online
{%- elif status == 3 -%}
On Battery
{%- elif status == 4 -%}
On Boost
{%- elif status == 5 -%}
On Sleep
{%- elif status == 6 -%}
Off
{%- elif status == 7 -%}
Rebooting
{%- elif status == 8 -%}
On ECO
{%- elif status == 9 -%}
On Bypass
{%- elif status == 10 -%}
On Buck
{%- elif status == 11 -%}
On Overload
{%- else -%}
Unknown
{%- endif -%}
group:
ups:
name: UPS
entities:
- sensor.ups_status
- sensor.ups_nompower
- sensor.ups_nominv
- sensor.ups_itemp
- sensor.ups_timeleft
homeassistant:
customize:
sensor.ups_nompower:
friendly_name: 'UPS Nominal Output Power'
icon: mdi:flash
sensor.ups_nominv:
friendly_name: 'UPS Nominal Input Voltage'
icon: mdi:flash
sensor.ups_status:
friendly_name: 'UPS Status'
icon: mdi:information-outline
sensor.ups_itemp:
friendly_name: 'UPS Internal Temperature'
icon: mdi:thermometer
sensor.ups_timeleft:
friendly_name: 'UPS Time Left'
icon: mdi:clock-alert