Wind sensor - logic help

I have set up the following wind sensor with mqtt which is working ok.
It reports every 10 seconds the wind speed in km/h. I think it was not designed for usage with home assistant but as I said it is working ok.
My problem is which would be the best way to integrate in HA in order if the wind speed is higher than 35 km/h to close the awning.
Since it is reporting the wind speed every 10 seconds I think if there is a spike of a wind gust at 35 the awning will close, but usually that average wind speed could be probably lower.
What logic I could use in order to be confident that the wind is actually high?
I am thinking for example (but I am not sure if this could be done in HA) to report the average value of the last 6 or 10 values (6 values =1 minute) using for example this component.
What do you think?

For my setup I used this mqtt and esp8266
My sensor right now is this one

- platform: mqtt
    name: "Wind Speed"
    state_topic: "anemometer/wind"

This is what I receive in HA Mqtt page
I haven’t received the anemometer yet, so the below test are from a small motor I have.

Listen to a topic
 
Listening to
anemometer/wind
 
Message 7 received on anemometer/wind at 12:10 AM:
0
QoS: 0 - Retain: false
Message 6 received on anemometer/wind at 12:09 AM:
0
QoS: 0 - Retain: false
Message 5 received on anemometer/wind at 12:09 AM:
6.61
QoS: 0 - Retain: false
Message 4 received on anemometer/wind at 12:09 AM:
9.48
QoS: 0 - Retain: false
Message 3 received on anemometer/wind at 12:09 AM:
0
QoS: 0 - Retain: false
Message 2 received on anemometer/wind at 12:09 AM:
9.48
QoS: 0 - Retain: false
Message 1 received on anemometer/wind at 12:09 AM:
5.22
QoS: 0 - Retain: false
Message 0 received on anemometer/wind at 12:09 AM:
0

A simpler way:

trigger:
  platform: numeric_state
  entity_id: sensor.wind_speed
  above: 35
  for:
    minutes: 1 # or however long it must be sustained above your limit, six samples in this case.
action:
  service: cover.close_cover
  entity_id: cover.your_awning

So, this automation will “count” the values for 1 minute and if is above 35 all the values will actually close the awning.
I really like it.

Is there a way to test it? If I say above 5 for 1 minute how can I get the value of 1 minute? I need a template? I mean a way to see the outcome of the 6 values somehow.

Why not just check what your sensor history shows?

This trigger will trigger if the value has been above 35 for 1 minute, meaning every measurment in this minute was above 35. The 1 minute will start once the previous reading is below 35 and the current reading is above 35.

1 Like