Hi. I am using an ESP8266 with temp sensor and two status leds (green & red). Green is active below 8 degrees, and red is active and flashing above 8 degrees.
I have the following code:
sensor:
- platform: dallas
address: ***
name: "unit_2"
unit_of_measurement: "°C"
on_value_range:
- above: 8
then:
- light.turn_on:
id: "red_led_light_unit_2"
- switch.turn_off: "green_led_switch_unit_2"
- below: 8
then:
- light.turn_off:
id: "red_led_light_unit_2"
- switch.turn_on: "green_led_switch_unit_2"
Sometimes it switches to the green led when below the threshold, and sometimes it doesn’t.
When I heat the probe by holding it in my hand and then placing it in cold water it always switches correctly.
However, when allowed to cool in a fridge, it fails to switch every now and again. I can see that the temperature in the fridge is indeed correct as I have a second probe showing the same temperature. The only difference then is the speed at which the probe cools down.
Any ideas as to what could be causing it?