I am using the Network UPS Tools integration on my RPi running the latest version of Home assistant. I am monitoring the state of the ups and I am getting valid state changes on the cards as the unit goes on battery, off battery and fully recharged. The state changes come through as text, OL, OB CHRG and others as well. For some reason my automations do not trigger during state changes.
I have tried ‘OB CHRG’ and ‘OB_CHRG’ and have tried the “_” in place of the space in all of the various states.
Here are the automations that are not triggering, they are in my automations/ups.yaml file:
# UPS Automation
- id: UPS_01
alias: 'Notify when UPS goes on battery'
trigger:
- platform: state
entity_id: sensor.dr_ups_status_data
from: 'OL'
to: 'OB_DISCHRG'
action:
- service: notify.sms_matt
data:
title: "Alert from HomeAssistant"
message: "Home UPS on battery"
- id: UPS_03
alias: 'Notify when UPS goes on battery while charging'
trigger:
- platform: state
entity_id: sensor.dr_ups_status_data
from: 'OL_CHRG'
to: 'OB_DISCHRG'
action:
- service: notify.sms_matt
data:
title: "Alert from HomeAssistant"
message: "Home UPS on battery"
- id: UPS_02
alias: 'Notify when UPS goes off battery'
trigger:
- platform: state
entity_id: sensor.dr_ups_status_data
from: 'OB_DISCHRG'
to: 'OL_CHRG'
action:
- service: notify.sms_matt
data:
title: "Alert from HomeAssistant"
message: "Home UPS oFF battery"
- id: UPS_04
alias: 'Notify when UPS is full'
trigger:
- platform: state
entity_id: sensor.dr_ups_status_data
from: 'OL_CHRG'
to: 'OL'
action:
- service: notify.sms_matt
data:
title: "Alert from HomeAssistant"
message: "Home UPS fully charged"
- id: "Desktop off on UPS"
alias: 'Desktop off on UPS'
trigger:
- platform: time_pattern
minutes: '/5'
condition:
- condition: numeric_state
entity_id: sensor.dr_ups_status_data
below: 70
action:
- service: switch.turn_off
data:
entity_id: switch.desktop
- id: 'UPS shutdown hassio'
alias: UPS shutdown hassio
initial_state: 'on'
trigger:
- platform: time_pattern
minutes: '/3'
condition:
- condition: numeric_state
below: '5'
entity_id: sensor.dr_ups_battery_charge
action:
- service: notify.sms_matt
data:
title: "Alert from HomeAssistant"
message: "UPS low HomeAssistant shutdown"
- service: hassio.host_shutdown
I know it is something simple that I have missed, but I just can’t see it!
Thanks Matt