Filter wind direction

For “super stable” data i use simple hack- add very small random error from Random sensor

sensor:
  - platform: random

I read data from MQTT

  - platform: mqtt
    name: wind_dir_davis
    state_topic: "weather/windDir"
    unit_of_measurement: "°"
    value_template: "{{ (value + (float(states.sensor.random_sensor.state)-10)/1000) | round(2) }}"

this update sesor every 30 seconds

3 Likes

Maybe use statistic sernsor

I’m trying this method but for the wind dispersion I’ve values also > 90°. Maybe you did some update to the code? Thanks !

I came here trying to figure out if and how I could smooth wind direction and after some more googling, I discovered the Lovelace WindRose card in HACS. This has satisfied my need to better understand Wind Direction and recommend it to those having a similar need.