I have a UPS connected to my NAS, and it’s also powering the switch etc.
The homeassistant gets the status fine from the NAS via NUT.
But my automation doesn’t trigger.
The sensors looks like this:
- platform: nut
name: UPS Battery backup
host: 1.2.3.4
resources:
- ups.status.display
- ups.load
- ups.realpower.nominal
- ups.mfr
- ups.model
- input.voltage
- battery.charge
- battery.runtime
- platform: template
sensors:
upsruntimemins:
friendly_name: "UPS Runtime"
unit_of_measurement: "m"
value_template: "{{ ( states('sensor.ups_battery_backup_battery_runtime') | int / 60 ) | round(0) }}"
- platform: template
sensors:
upsstate:
friendly_name: "UPS State"
value_template: >-
{% if is_state('sensor.ups_battery_backup_status', 'Online') %}
Online
{% elif is_state('sensor.ups_battery_backup_status', 'On Battery Battery Discharging') %}
On Battery
{% endif %}
My automation looks like this:
- id: '1560506535380'
alias: Alert - Poweroutage
trigger:
- entity_id: sensor.upsstate
for: 00:00:10
from: Online
platform: state
to: On Battery
condition: []
action:
- data:
message: Der er ikke strøm til serverne i øjeblikket, de lukker ned om 20 min
title: Strømafbrydelse
service: notify.webpush
- data:
message: Der er ikke strøm til serverne i øjeblikket, de lukker ned om 20 min
title: Strømafbrydelse
service: persistent_notification.create
But when I make it go to the battery, the automation doesn’t trigger???
I can see the state is reflecting that it’s on battery, and that it’s online, so why doesn’t it react?