I have a number of cheap temperature & humidity sensors that are biased but lack internal calibration.
I would like to “filter” (i.e. adjust) the sensor values before the state gets recorded to the HA db – similar to the optional filter: line in ESPHome.
I can do this manually for mqtt integrations by changing the config line in MQTT and I can do this manually for ESPHome devices by adding a filter: line as noted above.
But I would like to be able to do this in a generic manner for all integrations.
In particular, I would like to calibrate my Nest Thermostat temperature sensors.
I know I can do this by creating a second “Template” or “Filtered” entity but that seems klugey and just duplicates the number of recorded entities while creating a new unnecessary abstraction layer that needs to be maintained as sensors come and go or are modified.
Has anyone created a generic integration (or is it even possible to do so) that stands between the primary integration and recording to HA db that allows one to filter individual states for specified entities. Ideally, the filter would be a line of jinja-like code that could be optionally added for any recording entity.
Any thoughts?