Dallas sensor status detection

Hi,

I would like to check, whether the Dallas DS18B20 is connected or not?
In Arduino envorinment I could check that, but in ESPHome I did not find the corresponding function!
Overheating is pretty risky, so I have to be sure that the sensor values are valid. Right now if during runtime I disconnect a sensor, the latest measured values are provided by the library. However it should change the value to nan, regarding documentation.
If I reboot the device, then I get the nan value, but when I reconnect the sensor, it remains unconnected.

Any advice welcome!

Thanks!

You can probably use last_changed or last_updated of the sensor.

{{ states.sensor.dallas.last_updated }}

And template an automation with a warning or a template sensor that if more than one minute old make value Nan.

1 Like

I guess what you wrote is a Home Assistant stuff, but I would like to use this without HA. Like a standalone solution…

I don’t know if that is possible.

You could create a template binary sensor in ESPHome that looks for whatever the sensor error state is.