I’d like to have an automations that triggers when a value goes above a certain value.
Of course this would be an easy task, but the thing is I’d like to get notified when the value goes above (lets say) 50%, 60%, 70% AND
Below 20% and 10%.
This is my example:
- alias: Percentage Alert
initial_state: 'on'
trigger:
- platform: numeric_state
entity_id: sensor.percentage_value
below: 20
for: '00:10:00'
- platform: numeric_state
entity_id: sensor.percentage_value
below: 10
for: '00:10:00'
- platform: numeric_state
entity_id: sensor.percentage_value
above: 50
for: '00:10:00'
- platform: numeric_state
entity_id: sensor.percentage_value
above: 60
for: '00:10:00'
- platform: numeric_state
entity_id: sensor.percentage_value
above: 70
for: '00:10:00'
action:
- service: notify.iosdevice
data:
message: "Curent value: {{ states.sensor.percentage_value.state }} "
The issue with this automation is that 10 min after a restart of ha I will get some notifications, because some triggers are true.
Lets say the percentage value is 55% at the restart. This would cause two notifications, but I only want this to happen when the value rises aboce or falls below the certain values.
Any help is appreciated, maybe you have a nice idea again @petro