Here it goes in all it’s glory! But still doesn’t work properly wrong values
sensor:
- platform: adc
pin: GPIO32
name: "Probe 1 Temp"
id: probe1_temp
update_interval: 2s
# filters:
# - lambda: |-
# return ( 1 / (0.001129148 + (0.000234125 * std::log(x)) + (8.76741*10e-8 * (std::log(x))^3))) - 273.15;
unit_of_measurement: "°F"
accuracy_decimals: 0
icon: mdi:thermometer
filters:
- lambda: !lambda >-
float analog = x;
float R1 = 10000 * (1023.0 / analog - 1.0);
float steinhart;
steinhart = 0.2476197866e-03;
steinhart += 2.943226015e-04 * log(R1);
steinhart += -2.129189836e-07 * log(R1) * log(R1)* log(R1);
steinhart = 1.0 / steinhart;
steinhart -= 273.15;
steinhart = (steinhart * 9.0) / 5.0 + 32.0;
return steinhart;
As I understand this is all c++ like arduino code but I dont understand how to get the sensors raw value into the equation is th “x” all I need like above?
I also tried that one line but it spits back an error.
Thanks