Page 1 of 1

bme280: change temperature offset with rules

Posted: 08 Jun 2021, 08:45
by chromo23
Good morning,

is it possible to change the temperature offset value of the bme280 with rules?
because the humidity is important too i would like to do it with changing the offset rather than a simple calculation....

Re: bme280: change temperature offset with rules

Posted: 08 Jun 2021, 08:58
by Ath
That should be a value that is set once, when calibrating the sensor, and not changed regularly.

In general, unless the plugin supports it, no settings can be changed from rules.

Re: bme280: change temperature offset with rules

Posted: 08 Jun 2021, 09:08
by chromo23
Thats true, especially in terms of flash writes if you do something stupid in your rules.
But.... :) ..... i build a sensor for my brother which acts also as a night light. the temp deviation is very small when the light is on (+1,5°)
So i thought i do the offset with a rule when the light is on (i know this sounds stupid to put a heat-source into the sensor casing but the light is used very seldom)
Maybe i could calculate everything on the fly but i didn´t find a formula yet. and it is probably not that simple either.

Re: bme280: change temperature offset with rules

Posted: 08 Jun 2021, 23:49
by TD-er
The formula for correcting the humidity is in the BME280 code :)
It is quite simple.
First you compute the dew point based on measured temp and hum.
Then you offset the temperature and compute the humidity based on the new temp and dew point.

To compute dew point, I already included a conversion which is shown at the bottom of the system variables page.
But to compute humidity from temp and dew point is not (yet) present as a conversion.
It is also a formula which is hard to do in rules I guess.

Re: bme280: change temperature offset with rules

Posted: 09 Jun 2021, 21:44
by chromo23
I am not very good with code but i will dive right into it. :)
Thanks!