Calculate with data from 2 different sensor
Posted: 17 Oct 2023, 23:33
Hi guys,
i'm struggling with some rules.
I try to calculate the solved CO2 in a liquid with an Pressure sensor (12MPa sensor as internal imput) and the temperature (bme280) - and show it on an OLEd display (thats not the problem).
The sensors are working and i read the rules manual... but i cant find a solution.
i have the formula:
co2 = (pressure[bar] + 1,013) * (2,71828182845904^(-10,73797 + (2617,25/(Temperatur[°C] + 273,15)))) * 10
I guess i need a new variable (co2) but it can't be an uint32_t. Can i use another type of var?
I Tried to start with something like
Everytime when 1 of the 2 sensor values is changing the formula should be newly calculated (and showed on the OLED)
Can anyone help me with it?
i'm struggling with some rules.
I try to calculate the solved CO2 in a liquid with an Pressure sensor (12MPa sensor as internal imput) and the temperature (bme280) - and show it on an OLEd display (thats not the problem).
The sensors are working and i read the rules manual... but i cant find a solution.
i have the formula:
co2 = (pressure[bar] + 1,013) * (2,71828182845904^(-10,73797 + (2617,25/(Temperatur[°C] + 273,15)))) * 10
I guess i need a new variable (co2) but it can't be an uint32_t. Can i use another type of var?
I Tried to start with something like
Code: Select all
on BME#Temp do
logentry,"Aenderung Temp: [BME#Temp] "
<here should be the the definition of the variable and the calculation>
endon
on Drucksensor#Druck do
logentry,"Aenderung Druck: [Drucksensor#Druck]"
<here should be the the definition of the variable and the calculation>
endon
Can anyone help me with it?