I have three DS18B20 temperature sensors, each located on a different side of a cabinet outside. The sun often shines on one or two of the sensors, and I figured the one in the shadow would be correct.
I can do this in home-assistant with a template as simple as: {{ [a,b,c] | min }}. However in esphome the min filter returns the smallest value of a single sensor over a specified period. So how could I get the home-assistant functionality in esphome?
Using the C++ min function would reduce your whole lambda to one line. Not sure out of the back of my head if you have to prepend with std:: but I think so:
That one-liner is really nice. Thank you. It works like that with two sensors, but three apparently requires brackets. Is that a list in cpp? So the working code is: