Get data from APC Smart + Network Management Card via SMTP

My code:

# APC 2200 snmp    
  - platform: snmp
    name: apc2200_smart_type
    unique_id: apc2200_smart_type
    host: 192.168.1.50
    baseoid: 1.3.6.1.4.1.318.1.1.1.1.1.1.0
    accept_errors: true
  - platform: snmp
    scan_interval: 10
    name: apc2200_smart_status
    unique_id: apc2200_smart_status
    host: 192.168.1.50
    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' %}
        Online
      {% 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 %}
  - platform: snmp
    scan_interval: 10
    name: apc2200_smart_battery_voltage
    unique_id: apc2200_smart_battery_voltage
    host: 192.168.1.50
    baseoid: 1.3.6.1.4.1.318.1.1.1.2.3.4.0
    device_class: voltage
    unit_of_measurement: "V"
    accept_errors: true
    value_template: "{{((value | int) / 10)}}"
  - platform: snmp
    scan_interval: 10
    name: apc2200_smart_battery_capacity
    unique_id: apc2200_smart_battery_capacity
    host: 192.168.1.50
    baseoid: 1.3.6.1.4.1.318.1.1.1.2.2.1.0
    device_class: battery
    unit_of_measurement: "%"
    accept_errors: true
  - platform: snmp
    scan_interval: 10
    name: apc2200_smart_input_voltage
    unique_id: apc2200_smart_input_voltage
    host: 192.168.1.50
    baseoid: 1.3.6.1.4.1.318.1.1.1.3.2.1.0
    device_class: voltage
    unit_of_measurement: "V"
    accept_errors: true
  - platform: snmp
    scan_interval: 10
    name: apc2200_smart_output_frequency
    unique_id: apc2200_smart_output_frequency
    host: 192.168.1.50
    baseoid: 1.3.6.1.4.1.318.1.1.1.3.3.4.0
    accept_errors: true
    value_template: "{{((value | int) / 10)}}"
  - platform: snmp
    scan_interval: 10
    name: apc2200_smart_load
    unique_id: apc2200_smart_load
    host: 192.168.1.50
    baseoid: 1.3.6.1.4.1.318.1.1.1.4.3.3.0
    unit_of_measurement: "%"
    accept_errors: true
    value_template: "{{((value | int) / 10)}}"
  - platform: snmp
    scan_interval: 10
    name: apc2200_smart_ups_temperature
    unique_id: apc2200_smart_ups_temperature
    host: 192.168.1.50
    baseoid: 1.3.6.1.4.1.318.1.1.1.2.2.2.0
    device_class: temperature
    unit_of_measurement: "°C"
    accept_errors: true
  - platform: snmp
    scan_interval: 10
    name: apc2200_smart_runtime
    unique_id: apc2200_smart_runtime
    host: 192.168.1.50
    baseoid: 1.3.6.1.4.1.318.1.1.1.2.2.3.0
    accept_errors: true
    value_template: "{{((value | int) / 100)|timestamp_custom('%-H год %-M хв', false)}}"

3 Likes