WTH isn't there a simple way to calibrate entities?

I would love it if there were a simple way to calibrate entities. For instance, I have a few humidity sensors, and I’ve tested them so I can match up their offsets, but there’s no easy way to tell Home Assistant that (this humidity sensor should read 5% higher). Such a thing would be amazing!

This could done through helpers kind of like switch → light replacement works, creating a new, calibrated entity. It could also be built into the entity model, but that seems less consistent with HA’s approach.

The compensation integration gets close, but has three relevant limitations:

  1. It does not support offsets (degree 0 compensation) like “add 5%”. To accomplish that, you have to fake data by giving it at least two pairs of comparison points.
  2. It’s not configurable through the GUI.
  3. Even if it supported degree 0, without additional changes you’d need to give it a target point and a measurement point (e.g., show 55% for 50% measurement) rather than the offset (5%), which is non-intuitive.

Thanks!

You may already know this, but just in case. You can use a template helper sensor to ingest the state of the original humidity or temp and then offset it by whatever you like. You could even create a seperate input number helper to set whatever you would like the offset to be dynamically.

{{ (states('sensor.my_hunidity_sensor') | float) * 1.05 }} would give you the sensor value + 5%.

Or create a input number helper and pull the offset from there: {{ (states('sensor.my_hunidity_sensor') | float) * (states('input_number.my_hunidity_sensor_offset') | float) }}

1 Like

It has 4 limitations, in addition to the three you mentioned:

  • it requires creating a new entity.

This is also true for baudneo’s suggestion.

The ability to add a simple offset in the entity settings would be useful indeed.

2 Likes

Thanks! Good point that that’s another useful workaround. I’ve gone that route too, and it works. I’ve also done the compensation integration with two “fake” points to create an offset. They’re a similar amount of work, both with upsides and downsides; I was just hoping for something a little less clunky.

Funny re the 4th downside being creating a new entity. Totally agree—I originally had 4 points, but I decided to drop that one because my suggestion of making it like switch → light conversations also creates a new entity (and hides the old one). But a totally fair point!

It creates a polynomial, you can get any offset you want. e.g.

offset of five, provide

0, 5
1, 6

as your points.

Yes, it’s not a single field, but it can be done pretty easily.


Lastly, It may be coming to the UI soon, waiting on a few outstanding core PRs to get it there. Basically waiting on a Selector that allows for an endless list of 2 numerical pair values.