I normally don’t recommend long delays in automations because they can be interrupted by a restart or reload. However for this sort of non critical use it is fine. Adding a delay in single mode will prevent the automation running again until the delay has exprired. You can also set this to not log warnings:
alias: Wind speed alert
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.xxx_wind_speed
above: '30'
condition: []
action:
- service: notify.mobile_app_xxxxx
data:
message: Wind über 30 km/h
- delay:
minutes: 30
mode: single
max_exceeded: silent # remove this if you want logs of skipped runs.
My suggestion would be to use a text helper or a number helper, and set the value to the wind value after you have sent the notification. Then add a condition to the automation, so that the wind speed has to be over the value you previously saved.
Hi, as im a windsurfer wind notifications are the best and i have done an automation like this:
- alias: 'more than 12ms '
initial_state: 'on'
trigger:
- platform: time_pattern
minutes: '/59'
condition:
- condition: template
value_template: "{{(( states.sensor.medelvind_varekilsnas.state|int >11 and states.sensor.medelvind_varekilsnas.state|int <19 ) and ( states.sensor.vindriktning_varekilsnas.state|int > 235 and states.sensor.vindriktning_varekilsnas.state|int <290 )) and state_attr('sun.sun', 'elevation') > 0}} "
action:
- service: notify.mobile_app_rickard
well if the windangle is right and sun is up i get notifications every hour
in your case just to know if there is hight wind you can use below condition
And your automation triggers every hour if it needs to or not. Time pattern triggers are rarely the most efficient way to do things. Much better to trigger in state changes.