I ran into a problem last night that I thought I’d share. Maybe I can alleviate the frustrations I went through for someone else.
I’ve got an automation to turn on a window fan when in the bedroom when the temperature outside is colder than inside the room. But the room temperature needs to be above 62 degrees Fahrenheit. To do this, I was using this condition;
ONLY READS AS °C:
- condition: numeric_state
entity_id: sensor.bedroom_temperature
above: "62"
attribute: temperature
While this sensor shows in Fahrenheit everywhere else in my configuration, the condition statement above always reverted back to the original Celsius (the sensor itself reports in °C). It was driving me FREAKING MAD!
However, I figured out that by removing the “attribute: temperature” line, it went back to comparing Fahrenheit!
READS CORRECTLY AS °F:
- condition: numeric_state
entity_id: sensor.bedroom_temperature
above: "62"
I’ve never used the “attribute” method of a numeric_state condition before. I think I copied the yaml code after what the GUI started putting together for me. Not that it really matters here.
The big takeaway for anyone who finds this in the future is that if you run into this situation and have that “attribute” line in the condition, try removing it. It may just save you a lot of extra frustration.
Shane