johnBoy
(john R)
September 29, 2024, 11:00am
1
I would like to add some averaging filters on the temperature readings from my MCP9600 modules.
However, I keep seeing ‘doesn’t support filters’ message as I try and add them to the yaml.
Am I doing something wrong or is that really the case?
Why should a temperature measurement not support filters?
esphome:
name: "ktype-sensors-x2"
friendly_name: Ktype Sensors X2
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "LcIvLu1HrLivYJJ8k0H3="
ota:
- platform: esphome
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esphome-Web-3938A0"
password: "1WEPrZWpvBth"
captive_portal:
# i²c bus DFRobot
i2c:
sda: 21
scl: 22
scan: true
frequency: 10khz
sensor:
- platform: mcp9600
hot_junction:
name: "Sensor 1"
#cold_junction:
#name: "Ambient 1"
thermocouple_type: K
address: 0x63
update_interval: 30s
- platform: mcp9600
hot_junction:
name: "Sensor 2"
#cold_junction:
#name: "Ambient 1" Pimoroni
thermocouple_type: K
address: 0x67
update_interval: 30s
# WiFi Signal sensor.
# - platform: wifi_signal
# name: WiFi Signal
# update_interval: 60s
johnBoy:
mcp9600
Maybe show your YAML where you’ve tried adding filters? I’m guessing it might be an indentation issue, since that sensor actually provides multiple values/sensors.
Mikefila
(Mike Fila)
September 29, 2024, 3:52pm
3
Looking at the docs it seems they need to be inline with the name key.
sensor:
- platform: mcp9600
hot_junction:
name: "Sensor 1"
filters:
- offset: 2.0
- multiply: 1.2
#cold_junction:
#name: "Ambient 1"
thermocouple_type: K
address: 0x63
update_interval: 30s
johnBoy
(john R)
September 29, 2024, 8:44pm
4
Thank you.
You are correct.
I wasn’t able to interpret that from the docs.
I was trying to add the filter at the end of the device declaration rather than after the name.
That’s where/when I was seeing the 'doesn’t support filters’ message.
Also, using your advice on the indentation has resulted in success.
Thanks again.
esphome:
name: "ktype-sensors-x2"
friendly_name: Ktype Sensors X2
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "LcIvLu1HrLivYJJ8k="
ota:
- platform: esphome
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esphome-Web-3938A0"
password: "1WEPrZWpvBth"
captive_portal:
# i²c bus DFRobot
i2c:
sda: 21
scl: 22
scan: true
frequency: 10khz
sensor:
- platform: mcp9600
hot_junction:
name: "Sensor 1"
filters:
- median:
window_size: 5
send_every: 3
send_first_at: 1
#cold_junction:
#name: "Ambient 1"
thermocouple_type: K
address: 0x63
update_interval: 10s
- platform: mcp9600
hot_junction:
name: "Sensor 2"
filters:
- median:
window_size: 10
send_every: 2
send_first_at: 1
#cold_junction:
#name: "Ambient 1" Pimoroni
thermocouple_type: K
address: 0x67
update_interval: 10s
# WiFi Signal sensor.
# - platform: wifi_signal
# name: WiFi Signal
# update_interval: 60s