Page 1 of 1

Calculate average temperature ds18b20

Posted: 19 Mar 2020, 16:58
by Kudryash
Hi, I'm from Russia, I apologize for my poor English. :)
Need your help.
I need to add the temperature of two ds18b20 sensors and divide by 2 to get the average temperature.
temp1+temp2/2=?
Thanks !

Re: Calculate average temperature ds18b20

Posted: 19 Mar 2020, 17:38
by TD-er
You can do this in the rules and assign them to a dummy task.
See: https://espeasy.readthedocs.io/en/lates ... skvalueset

Re: Calculate average temperature ds18b20

Posted: 19 Mar 2020, 17:48
by Kudryash
Thank you, I found an example here on the forum and tweaked it a little.
Works.

Code: Select all

On System#Boot do
  timerSet,1,3
endon
On Rules#Timer=1 do
 TaskValueSet,12,1,[ds18b201#temp1]/2+[ds18b202#temp2]/2
 timerSet,1,3
endon