What filters do you use for air temperature?

Have you figured out some filter combination that gets rid of enough noise while not adding a significant lag, and that is a nice balance between amount of data and precision?

Indoor temperatures do not change very fast so I use this:

sensor:
  - platform: dht
    pin: D5
    model: DHT22
    update_interval: 15s
    temperature:
      name: "Bathroom Temperature"
      filters:
        - sliding_window_moving_average:
            window_size: 15
            send_every: 15
            send_first_at: 15

Updates every 3m45s with the average over that interval.

Untitled Untitled2

If you want more responsive but without flooding the network with messages you could use something like this:

  update_interval: 1s
    filters:
      - sliding_window_moving_average:
          window_size: 10
          send_every: 1
      - or:
          - throttle: 120s
          - delta: 0.2

This sends a 10 second average every 2 minutes unless the temperature average changes by 0.2°, if that happens the average is sent immediately.

6 Likes