Wind speed alert / notification

Hi,

i am trying to write an automation for wind speed alert. I want to have a notification if there is a high wind speed outside.

My problem is right now that i get to much notifications. Do you have any ideas how i could solve it?

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
mode: single

One way is to use an input_boolean. The other less desirable is a timer.

alias: Wind speed alert
description: ''
trigger:
  - platform: numeric_state
    entity_id: sensor.xxx_wind_speed
    above: '30'
condition: 
  - condition: state
    entity_id: input_boolean.message
    state: 'off'
action:
  - service: notify.mobile_app_xxxxx
    data:
      message: Wind über 30 km/h
  - service: input_boolean.turn_on
    target:
      entity_id: input_boolean.message
mode: single

-----------------------------------------------

alias: Turn off Message Boolean
description: ''
trigger:
  - platform: state
    entity_id: input_boolean.message
    to: 'on'
    for:
      hours: 0
      minutes: 15
      seconds: 0
condition: []
action:
  - service: input_boolean.turn_off
    target:
      entity_id: input_boolean.message
mode: single

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.

Another alternative is to send an alert once in the evening if the winds are forecast to be high tomorrow.

- id: a590bdfb-840b-4399-b468-23c45dd8b585
  alias: 'Wind Speed Alert'
  trigger:
    platform: time
    at: '18:30:00'
  condition:
    condition: numeric_state
    entity_id: sensor.max_wind_tomorrow
    above: 49
  action:
  - service: notify.telegram_general
    data:
      title: '🌪️ *High winds*'
      message: "High winds predicted for tomorrow, {{ states('sensor.max_wind_tomorrow')}}km/h"

Of course this relies on you having forecast wind data, not just instantaneous values.

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 :wink:
in your case just to know if there is hight wind you can use below condition

    - condition: template
      value_template: "{{ states.sensor.windspeed.state|int >11 }} "

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.