XFNeo
(Maksim)
July 27, 2023, 1:59pm
1
I want to receive notifications when UPS battery lower 50% 25% and 10%, but my logic is not working) I guess something wrong in condition section. Please help
- alias: Battery low notification
description: ""
mode: single
trigger:
- platform: state
entity_id: sensor.ups_battery_charge
condition:
or:
- condition: numeric_state
entity_id: sensor.ups_battery_charge
below: 50
- condition: numeric_state
entity_id: sensor.ups_battery_charge
below: 25
- condition: numeric_state
entity_id: sensor.ups_battery_charge
below: 10
action:
- service: notify.user1
data:
message: "UPS battary low - {{ sensor.ups_battery_charge }}%"
Won’t this fire every time the battery charge entity changes? Why not three triggers?
XFNeo
(Maksim)
July 27, 2023, 2:28pm
3
It does not fire at all))
Do you mean like this?
- alias: Battery low notification
description: ""
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.ups_battery_charge
below: 50
- platform: numeric_state
entity_id: sensor.ups_battery_charge
below: 25
- platform: numeric_state
entity_id: sensor.ups_battery_charge
below: 10
condition: []
action:
- service: notify.user1
data:
message: "UPS battary low - {{ sensor.ups_battery_charge }}%"
tom_l
July 27, 2023, 3:36pm
4
That should work though your messages template is malformed. Should be:
message: "UPS battary low - {{ states('sensor.ups_battery_charge') }}%"
It should trigger when the battery SOC goes from above each set point to below it. e.g. from 51% to 49% , or 11% to 9%
XFNeo
(Maksim)
July 27, 2023, 6:26pm
5
It works, thx.
- alias: Battery low notification
description: ""
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.ups_battery_charge
below: 50
- platform: numeric_state
entity_id: sensor.ups_battery_charge
below: 25
- platform: numeric_state
entity_id: sensor.ups_battery_charge
below: 10
condition: []
action:
- service: notify.user1
data:
message: "UPS battary low - {{ states('sensor.ups_battery_charge') }}%"