1) Give a description of the problem
I have a piston that is supposed to turn on a pipe heater when the temperature is below freezing, however it has been turning it on at random when I am using the condition $weather.conditions.current_observation.temp_f < 32.
2) What is the expected behavior?
I am expecting that $weather.conditions.current_observation.temp_f always returns a value
3) What is happening/not happening?
It seems that sometimes $weather.conditions.current_observation.temp_f returns a null value, and that when it does, checking it is <32 results in a TRUE result.
– I tried pulling $weather.conditions.current_observation.temp_f into a local variable to see if that was a problem, that didn’t help. So I thought alright… maybe it is a fluke, so in case $weather.conditions.current_observation.temp_f < 32, I actually check it again (set the variable again and check) so that I can be sure it’s really <32. Yet several times it has still made it through!
I am changing my comparison to check the variable is between -100 and 32, and hoping that will work. But clearly what is happening is there is no reading returned sometimes so it just returns a null.
Is this due to there just being inconsistent data available from certain weather sources? Could there be some sort of default setting to pull the last known good value for the current conditions/temperature in case a current one can’t be found so that null is never returned? Or is it up to us to buffer that value?
I think that $weather is super useful and maybe all this has been fixed in newer releases (I am a few behind) but am curious if anyone else has run into this, and if I should really expect a null to evaluate as <32 (and if using BETWEEN might fix it!)
Cheers!
Eric