Credits: The Denoise sensor code is based on the Average Sensor for Home Assistant which I used as a source and inspiration.
The Denoise sensor acts as a noise removal filter by filtering out small variations in the output of a source sensor. Sometimes sensors can produce quite a bit of white noise which ends up in the HA recorder database or the long term storage DB.
- Copy the directory
custom_components/denoisefrom this repository into HAcustom_componentsdirectory - Add
denoisesensor to your HA configuration. See configuration examples below. - Restart Home Assistant
To create a new temperature denoise filter sensor based on an existing temperature sensor:
# Example configuration entry
sensor:
- platform: denoise
name: "Multi Sensor 1 Temperature Avg"
precision: 1
value_delta: 0.06
average_interval: "00:01:30"
update_interval: "00:30:00"
scan_interval: 600
entity_id: sensor.multi_sensor_1_temperatureTo create a new humidity denoise filter sensor based on an existing humidity sensor:
# Example configuration entry
sensor:
- platform: denoise
name: "Multi Sensor 1 Humidity Avg"
precision: 1
value_delta: 0.3
update_interval: "01:00:00"
scan_interval: 600
entity_id: sensor.multi_sensor_1_humidityReplace source sensors entity IDs with your existing sensor.
Note:
You can use weather provider, climate and water heater entities as a data source. For that entities sensor use values of current temperature.
name:
(string) (Optional)
Name to use in the frontend.
Default value: "Denoise sensor"
unique_id:
(string) (Optional)
Sensor unique ID.
Default value: None
value_delta:
(number) (Optional)
The minimum change in the source sensor value to be considered, smaller changes are ignored.
Default value: 0
precision:
(number) (Optional)
The number of decimals to use when rounding the sensor state.
Default value: 1
average_interval:
(time) (Optional)
If defined then it averages the source sensor over this period of time.
It is only updated (old values removed, new values added) when the source sensor emits new values.
Default value: None
update_interval:
(time) (Optional)
If the sensor state is not updated in this time period, a new state is forced (even if equal to the previous state).
If update_interval is not specified then a new state is not forced.
The update_interval can help with big gaps in dashboards due to missing recorded changes for long periods of time.
Default value: None
scan_interval:
(number) (Optional)
This is a standard HA variable and dictates the update frequency in seconds for this sensor.
The verification of the update_interval happens at this frequency so the actual forced update interval can be higher than the value of update_interval.
Default value: None
entity_id:
(string) (Required)
The entity ID of the sensor you want to use as source.