Getting multiple notifications if numeric state is above certain value

I am trying to make an automation that sends a notification when one of my humidity sensors is above 60%, but only if its last state was below 60%, to avoid getting notifications if it is changing from 61 to 62.

alias: Humidity alarm
description: ''
trigger:
  - platform: numeric_state
    entity_id: >-
      sensor.woonkamer_humidity, sensor.slaapkamer_humidity,
      sensor.badkamer_humidity
    above: '60'
condition:
  - condition: template
    value_template: '{{ trigger.from_state.state < 60 }}'
action:
  - service: notify.mobile_app_oneplus
    data:
      title: >-
        De luchtvochtigheid in {{ trigger.to_state.attributes.friendly_name }}
        is te hoog
      message: 'De luchtvochtigheid is {{ trigger.to_state.state }}%'''
mode: single

Does this value template work?

You don’t need this condition. Numeric state triggers will only fire when the value has crossed the threshold. In your example it will only be triggered if the previous state was below 60 and the new state above 60. It will then only trigger again when the value goes below 60 and then above 60 again.

1 Like