Notify when value goes above/below certain values

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

I’d just add a condition that the automation doesn’t trigger if HA started less than 11 min ago:
here is an example of one of my alerts:

    
- platform: template
  sensors:
    alert_aloe_vera_humidity_too_low:
      entity_id: sensor.aloe_vera_moisture
      value_template: >-
        {% if (((states("sensor.aloe_vera_moisture") )| default(100)) | int < 10) and (states("sensor.uptime") | float > 0.1)%}on{% else %}off{%endif%}
      friendly_name: Aloe Vera Humidity below 15%

the key here is the and (states("sensor.uptime") | float > 0.1)
my sensor.uptime gives me the number of hours since HA started:

- platform: uptime
  unit_of_measurement: hours

@lolouk44 thanks for your advice.

I added this to my automation:

  condition:
    - condition: numeric_state
      entity_id: sensor.uptime
      above: 0.2
1 Like