home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.28k stars 30.61k forks source link

sensors offset/calibrate suggestion #25703

Closed segalion closed 4 years ago

segalion commented 5 years ago

I open this suggestion here instead on forum proposals, because I think is a suggestion more suitable for developers than for common users. I would like to make some proposals:

  1. Include a 'offset' optional parameter inside sensor object (so all sensor inheritance them), only to "correct" the basic meassurements without need of create a custom template. Imagine you has some ammount of temperature sensors... that you prevously calibrate... you could parametrize some 'offset' for them, so you can easlily calibrate the temperature (i.e. +0.7ºC. or -0.25ºC). Its really usefull for all sensor, and it doesnt increase sensor base complexity.

  2. one-wire prococol could be the id as parameter of name instead of actual opposite: from actual:

    names:
    id: name

    to the proposed:

    names:
      name: id

With this, you can easily interchange one-wire sensor, or even traslate "id_sensor" to a secrets.yaml to interchange systems...

  1. If you like the callibration (needed usually in lots of analog sensor with probes like pH or ORP electrodes) could be great create a standar calibrate sensor, with those parameter:
sensor:
  platform: calibrate
  entity_id: sensor.to_calibrate
    calibrate:
      from:
      to:
    calibrate_low:
      from:
      to:
    calibrate_high:
      from:
      to:

To get up three-level calibration.

stale[bot] commented 5 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

gingerlime commented 3 years ago

+1 I think it can be a useful feature. Wonder if anybody knows of a workaround to adjust sensors that cannot be calibrated? (e.g. I have a ruuvitag with humidity skewed downwards by around 8%, and there's no way to calibrate the firmware itself).

milleker commented 3 years ago

I've run into this lately with humidity sensors that I want around as perfect to 70% as possible. Sure, I know the offsets, but would really love to be able to get them dialed in natively. I also have some problematic temperature sensors as well that could use this treatment.

I'm going to look at seeing if there's a way to set a script and variable to just add the offset to that in the meantime.

GrinGrin commented 3 years ago

+1 ! I use Oregon Scientific sensors and the barometer show lower value. Previously I used Domoticz and the barometer sensor show a specific field for this type of correction.

Also, if you search for "barometer sensor elevation correction", you'll find a lot of articles about that physical fact as atmospheric pressure is lower when altitude rise.

Here I'm at 188m above the sea (~617 feet) and previously needed to add an offset of 21 hPa to get the same value as the national meteo service for my location.