Hey.
I have a UPS connected to my LAN with a AP9619 network card, can i configure NUT to use the network interface? And if so, how?
you add the ups to ups.conf, mine looks like this:
[ups]
driver = snmp-ups
mibs = cyberpower
port = 192.168.0.250
community = public
snmp_version = v1
pollfreq = 15
desc = "RMCARD205"
Obviously not the same model but that was it for that file.
Now the NUT server @ localhost will report the data just like it was plugged in to the server, so you need to monitor it.
In the upsmon.conf file, you add
MONITOR ups@localhost 1 homeassistant homeassistant master
homeassistant is both the username and password I am using for authentication in NUT, and it needs to be here as well.
I think at that point, restarting the NUT services is all that is required to get it to show up in HA, assuming you already have the integration connected to the NUT server
Awesome, worked. Thanks.
Spent hours looking for this information. Come to find out, i just need to modify the yaml inside of the NUT Server add on configuration, inside of home assistant os.
Hi –
Newbie here. Was wondering if you can point me to where I need to go and what I need to create\edit the ups.conf file. I got 2 cyberpower switches I want to monitor\get data on. I been trying to get NUT working, but with no success. Many thanks.
How are you connecting to these UPS… USB, ethernet?
Two blade CyberPower UPS’s I am connecting to via rmcard205’s ethernet card that plugs into them. I have revised this post because it appears I need a NUTS server. I am trying to leverage the built in HA integrations, not develop or add new ones. While I do plan on resetting HA up on a Pi. It is currently running on a VM. I am not sure if this would work and the post is quite old.
https://peterkieser.com/2020/11/16/home-assistant-sensors-and-cyberpower-ups-via-rmcard205/
The code writer has not updated this in 2 years so it may not be worth pursuing for the reason above. Leverage existing integrations from vendors, not re-invent the wheel. Thanks to all who helped.
Hi!
I have an old su1400inet with AP9617 network card, please can i have an help to configure sensor, i have no expericence about, you have a guide?
I don’t know how to setup from start.
Thank you
For Cyberpower and APC UPSes using Network connection, this is what I found to work.
- name: ups-PR2000RTXL2U
driver: snmp-ups
port: 192.168.1.10
snmp_version: v3
secLevel: authPriv
authProtocol: SHA
authPassword: 0123456789ABCDEF
privProtocol: AES
privPassword: 0123456789ABCDEF
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: []
Hi,
Wanted to revisit, but do need clarification. The code for ups.conf should I add that to a device running NUT server? I already have NUT add-on configured on a desktop with a USB attached UPS. Can a second or third be added under NUT add-on config or should this be on device where NUT is installed? Does it matter where its configured?
I never got the nut addon to work, so i went the configuration.yaml route.
Just past the code into your config yaml and change to your settings and you should have connection to the ups and entities to work with.
make sure you allow smnp connection on the ups network card
#UPS test section start
sensor:
- platform: snmp
host: 192.168.178.102
baseoid: 1.3.6.1.4.1.2021.10.1.3.1
- platform: snmp
name: ups_smart_capacity
host: 192.168.178.102
baseoid: 1.3.6.1.4.1.318.1.1.1.2.2.1.0
accept_errors: true
unit_of_measurement: '%'
- platform: snmp
name: ups_smart_runtime_remaining
host: 192.168.178.102
baseoid: 1.3.6.1.4.1.318.1.1.1.2.2.3.0
accept_errors: true
value_template: >-
{% set time = (value | int) / 100 | int %}
{% set minutes = ((time % 3600) / 60) | int %}
{% set hours = ((time % 86400) / 3600) | int %}
{% set days = (time / 86400) | int %}
{%- if time < 60 -%}
Less than a minute
{%- else -%}
{%- if days > 0 -%}
{{ days }}d
{%- endif -%}
{%- if hours > 0 -%}
{%- if days > 0 -%}
{{ ' ' }}
{%- endif -%}
{{ hours }}h
{%- endif -%}
{%- if minutes > 0 -%}
{%- if days > 0 or hours > 0 -%}
{{ ' ' }}
{%- endif -%}
{{ minutes }}m
{%- endif -%}
{%- endif -%}
- platform: snmp
name: ups_smart_load_percentage
host: 192.168.178.102
baseoid: 1.3.6.1.4.1.318.1.1.1.4.2.3.0
accept_errors: true
unit_of_measurement: '%'
- platform: snmp
name: ups_smart_battery_temperature
host: 192.168.178.102
baseoid: 1.3.6.1.4.1.318.1.1.1.2.2.2.0
accept_errors: true
unit_of_measurement: '°C'
- platform: snmp
name: ups_smart_battery_status
host: 192.168.178.102
baseoid: 1.3.6.1.4.1.318.1.1.1.2.2.4.0
accept_errors: true
value_template: >-
{%if value == '1' %}
Good
{% elif value == '2' %}
Failed
{% endif %}
- platform: snmp
name: ups_smart_type
host: 192.168.178.102
baseoid: 1.3.6.1.4.1.318.1.1.1.1.1.1.0
accept_errors: true
- platform: snmp
name: ups_smart_input_voltage
host: 192.168.178.102
baseoid: 1.3.6.1.4.1.318.1.1.1.3.2.1.0
accept_errors: true
unit_of_measurement: 'V'
- platform: snmp
name: ups_smart_last_transfer_reason
host: 192.168.178.102
baseoid: 1.3.6.1.4.1.318.1.1.1.3.2.5.0
accept_errors: true
value_template: >-
{%if value == '1' %}
No events
{% elif value == '2' %}
High line voltage
{% elif value == '3' %}
Brownout
{% elif value == '4' %}
Loss of mains power
{% elif value == '5' %}
Small temporary power drop
{% elif value == '6' %}
Large temporary power drop
{% elif value == '7' %}
Small spike
{% elif value == '8' %}
Large spike
{% elif value == '9' %}
UPS self test
{% elif value == '10' %}
Excessive input voltage fluctuation
{% endif %}
- platform: snmp
name: ups_smart_output_load
host: 192.168.178.102
baseoid: 1.3.6.1.4.1.318.1.1.1.4.2.3.0
accept_errors: true
unit_of_measurement: '%'
- platform: snmp
name: ups_smart_output_current
host: 192.168.178.102
baseoid: 1.3.6.1.4.1.318.1.1.1.4.2.4.0
accept_errors: true
unit_of_measurement: 'A'
- platform: snmp
name: ups_smart_last_self_test_result
host: 192.168.178.102
baseoid: 1.3.6.1.4.1.318.1.1.1.7.2.3.0
accept_errors: true
value_template: >-
{%if value == '1' %}
OK
{% elif value == '2' %}
Failed
{% elif value == '3' %}
Invalid Test
{% elif value == '4' %}
Test In Progress
{% endif %}
- platform: snmp
name: ups_smart_last_self_test_date
host: 192.168.178.102
baseoid: 1.3.6.1.4.1.318.1.1.1.7.2.4.0
accept_errors: true
- platform: snmp
name: ups_smart_communication_status
host: 192.168.178.102
baseoid: 1.3.6.1.4.1.318.1.1.1.8.1.0
accept_errors: true
value_template: >-
{%if value == '1' %}
on
{% elif value == '2' %}
off
{% endif %}
- platform: snmp
name: ups_smart_status
host: 192.168.178.102
baseoid: 1.3.6.1.4.1.318.1.1.1.4.1.1.0
accept_errors: true
value_template: >-
{%if value == '1' %}
Unknown
{% elif value == '2' %}
On Line
{% elif value == '3' %}
On Battery
{% elif value == '4' %}
On Smart Boost
{% elif value == '5' %}
Timed Sleeping
{% elif value == '6' %}
Software Bypass
{% elif value == '7' %}
Off
{% elif value == '8' %}
Rebooting
{% elif value == '9' %}
Switched Bypass
{% elif value == '10' %}
Hardware Failure Bypass
{% elif value == '11' %}
Sleeping Until Power Returns
{% elif value == '12' %}
On Smart Trim
{% endif %}
#UPS test section end
@Darkyputz - Thanks for posting this code. I do have 2 CyberPower ups’s with rmcard205’s in them. Would prefer to see temps in °F. I have noticed in the past I was never able to get temps using a script like this as a package developed by someone else. I think that is because I need the optional Enviro Sensor that connects to the Universal port on the rmcard205. Been trying to confirm this before spending $100 on one. Wondering if in fact I do need the optional card.
Hello…
Which temp are you referring about?
Battery temp stated from the UPS?
When you get a Celsius value returned from this script, you can take that value, create a new entity and fill this entity with a calculated Fahrenheit value and use that for display instead
I would assume battery temp, but I have never been able to get a temperature with 2 UPS’s with rmcard205’s installed using code from this guy:
https://peterkieser.com/2020/11/16/home-assistant-sensors-and-cyberpower-ups-via-rmcard205/
Also when I log into UPS’s via the assigned address given to the rmcard205 I don’t see any reference to temp anywhere.
I have been using NUT successfully with USB plugged directly into my home assistant server and get lots of info…
- name: living-room-ups-network
driver: snmp-ups
port: 10.0.150.109
snmp_version: v3
config: []
- name: living-room-ups-usb
driver: usbhid-ups
port: auto
config: []
problem is when I try to connect to it over IP address, I can get only IP, and USB stops working. I tried changing the order, which didn’t help and adding a carriage return, but saving deletes the return. The other issue is that when connected through the network, I only get the sensors but no diagnostics. If I remove the networked UPS from the config, then the USB connection starts working again. This must not be the correct way to add another UPS to my NUT add-on.
I got 3 Pi’s running NUT and the UPS’s are from CyberPower (1325, SX550Ga, SL750u). I don’t see an option to get Battery Temp. Would like to see it. Was curious what brand UPS you were using. This is using usbhid-ups
I am using a couple of very old APC SU2200 with probably equally old AP9617 10/100BaseT network management cards.
Is that a different UPS from the screenshot above, and reference to USB…?
Didn’t think that AP9617 has USB, only Ethernet (10/100) ?