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?