Temperature sensors in Esphome

I have two temperature sensors connected to a Wemos D1R1 board.
I have used the exponential moving average in the filter. This is my yaml file.

esphome:
  name: playground
  platform: ESP8266
  board: d1

wifi:
  ssid:  !secret ssid_playground
  password: !secret password_playground

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: !secret ssid_playground_fallback_hotspot
    password:  !secret password_playground_fallback_hotspot

captive_portal:

# Enable logging
logger:
  level: DEBUG

# Enable Home Assistant API
api:

ota:

dallas:
   -  pin:  5
       #number:  5
     #inverted:  True

switch:
  -  platform: gpio
     id: builtIn_led
     name: "Built In Led"
     pin:
       number:  GPIO02
       inverted:  True
       
  -  platform: gpio
     id: ntc_vcc
     name:  VCC For NTC from GPIO13
     internal:  True
     pin:
       number:  GPIO13
       inverted:  True
interval:
  - interval: 60s
    then:
      - switch.turn_off:  ntc_vcc
      - component.update:  source_sensor
      - switch.turn_on:  ntc_vcc
       
#######
sensor:
  -  platform:  ntc
     sensor:  resistance_sensor
     name:  NTC Temperature Sensor
     accuracy_decimals:  1
     calibration:
      #b_constant: 3950
      #reference_temperature: 25°C
      #reference_resistance: 10.0kOhm
       - 53.202kOhm -> -10°C
       - 10.10kOhm -> 25°C
       - 3.039kOhm -> 55°C
               
  -  platform:  resistance
     sensor:  source_sensor
     id:  resistance_sensor
     name:  Resistance Sensor
     resistor:  10.0kOhm
     reference_voltage:  3.3V
     configuration:  DOWNSTREAM
     accuracy_decimals:  2
     
  -  platform:  adc
     id:  source_sensor
     accuracy_decimals:  4
     filters:
       #-  offset:  -0.106
       -  multiply: 3.3
       -  exponential_moving_average:
            send_every:  4
            
     pin:  A0
     update_interval:  never
     
  - platform:  dallas
    address:  0x620004411638FF28
    id:  dallas_sensor
    name:  Dallas Sensor
    filters:
       -  exponential_moving_average:
            send_every:  4

A screenshot of the ntc sensor from the lovelace panel is like this


From this the curve does not show exponential averaging.
Same is seen for the dallas sensor…
BTW this was working fine prior to my installing Mariadb and migrating from the default SqlLite…
I cannot figure out why this has happened…

You have not specified the alpha value:

exponential_moving_average : A simple exponential moving average over the last few values.

  • alpha : The forget factor/alpha value of the filter.
  • send_every : How often a sensor value should be pushed out

@tom_l… are you sure this has nothing connected with my database migration?
what is alpha? I am using
send_every: 4
how is alpha to be used?

The alpha value determines how quickly the exponential average forgets the previous values. It’s similar to the window size in the windowed moving average. I have no idea what the default value is, or what the range should be. I use the windowed average.

This could be a coincidence. As changing where you store your values will have no effect on an averaging routine running on esphome. Maybe one of the recent esphome updates broke the exponential moving average. Have you re-flashed your device recently?

Yes @tom_l I have re flashed my device trying to see results with different values of
send_every: x
tried with different values of x but same result.

Send every x only changes how often ESPHome sends the data to home assistant. It has no effect on the averaging. That’s what the alpha value does.

I have used
alpha: 0.1
lets see how this pans out…

Yes this appears to be more likely as even using alpha the chart is stepped as before…