{# The device page's UPS block; `ups` comes from web/ups.py ups_block(). #} {% set u = ups.ups %}

UPS{% if u.model %}: {{ u.model }}{% endif %}

{% if ups.stale %}

last read failed {{ ups.data.last_error }} · showing the state from {{ ups.data.last_ok | local }}

{% endif %}
Power
{% if u.communication_ok is sameas false %}
card has lost the UPS
the values below are from before
{% elif u.on_battery %}
on battery
{% if u.seconds_on_battery %}for {{ u.seconds_on_battery | duration }}{% endif %}{% if u.last_transfer_cause and u.last_transfer_cause != 'no transfer' %} · cause: {{ u.last_transfer_cause }}{% endif %}
{% else %}
on mains
{{ u.output_status or u.output_source or '' }}{% if u.last_transfer_cause and u.last_transfer_cause != 'no transfer' %} · last transfer: {{ u.last_transfer_cause }}{% elif u.last_transfer_cause == 'no transfer' %} · no transfer to battery recorded{% endif %}
{% endif %}
{% if u.input_v is not none %}
Input
{{ u.input_v }} V{% if u.input_hz %} · {{ u.input_hz }} Hz{% endif %}{% if u.input_v_min is not none and u.input_v_max is not none %} (range {{ u.input_v_min }}–{{ u.input_v_max }} V){% endif %}
{% endif %} {% if u.transfer_low_v and u.transfer_high_v %}
Transfers at
below {{ u.transfer_low_v }} V, above {{ u.transfer_high_v }} V
{% endif %}
{% if u.charge_pct is not none %}
Charge
{{ u.charge_pct }} %
battery {{ u.battery_status or 'unknown' }}{% if u.battery_c is not none %} · {{ u.battery_c }} °C{% endif %}
{% endif %} {% if u.runtime_min is not none %}
Runtime
{{ u.runtime_min }} min
{% set rt = [u.runtime_min, 240] | min %}
at the current load{% if u.low_battery_warning_min %} · low-battery warning {{ u.low_battery_warning_min }} min before the end{% endif %}
{% endif %} {% if u.load_pct is not none %}
Load
{{ u.load_pct }} %
{% if u.load_w is not none %}{{ u.load_w }} W{% endif %}{% if u.load_va is not none %} · {{ u.load_va }} VA{% endif %}
{% endif %}

Graphs · {% for key, title in (('24h', 'last 24 hours'), ('7d', 'last 7 days')) %}{{ title }}{% if not loop.last %} · {% endif %}{% endfor %}

{% for g in ups.graphs %}
{{ g.title }}{% if g.chart %} {{ g.chart.last | round(1) }} {{ g.unit }} now · {{ g.chart.min | round(1) }}–{{ g.chart.max | round(1) }}{% endif %}
{% if g.chart %} {% for r in g.chart.refs %}{{ r.value | int }} {{ g.unit }}{% endfor %} {% if g.chart.n > 1 %}{% else %}{% set px, py = g.chart.points.split(',') %}{% endif %} {% else %}

No readings yet.

{% endif %}
{% endfor %}

Battery

{% if u.battery_cartridge %}
Cartridge
{{ u.battery_cartridge }}
{% endif %}
Replace
{% if u.battery_replace %}the UPS says now{% elif u.battery_replace is sameas false %}not needed{% else %}unknown{% endif %}{% if u.battery_replace_by %} · recommended by {{ u.battery_replace_by }}{% endif %}
{% if u.battery_last_replaced %}
Last replaced
{{ u.battery_last_replaced }}
{% endif %}
Self-test
{% if u.self_test_result == 'failed' %}failed{% else %}{{ u.self_test_result or 'unknown' }}{% endif %}{% if u.self_test_date %} · {{ u.self_test_date }}{% endif %}{% if u.self_test_every_days %} · scheduled every {{ u.self_test_every_days }} days{% endif %}
Calibration
{% if u.calibration_date %}{{ u.calibration_date }}{% if u.calibration_result %} · {{ u.calibration_result }}{% endif %}{% else %}never recorded: the runtime estimate is not calibrated{% endif %}
{% if u.alarms %}
Alarms
{{ u.alarms | join(', ') }}
{% endif %}

Firmware

{% if u.firmware %}
UPS
{{ u.firmware }} · shown only: there is no official list to compare with
{% endif %} {% set fw = device.attrs.firmware %}{% if fw and fw.product == 'APC NMC' %}
Card
{{ fw.model }}{% if fw.platform %} ({{ fw.platform }}){% endif %} {{ fw.version }}{% if fw['update'] %} · {{ fw.latest }} available{% elif fw.latest %} · newest known ({{ fw.latest }}{% if fw.latest_checked %}, list checked {{ fw.latest_checked }}{% endif %}){% endif %}
{% endif %} {% if u.sku or u.manufactured %}
Unit
{{ u.sku or '' }}{% if u.manufactured %} · made {{ u.manufactured }}{% endif %}
{% endif %}

Power events

{% if ups.events %}
{% for f in ups.events %}{% endfor %}
Went on batteryForCauseStatus
{{ f.evidence.started | local }}{% if f.evidence.seconds_on_battery %}{{ f.evidence.seconds_on_battery | duration }}+{% else %}-{% endif %}{{ f.evidence.cause or '-' }}{{ f.status.value }}
{% else %}

None recorded. lanwatch sees an outage when a read falls inside it.

{% endif %}