Got a new problem with my Dallas DS18B20 temprature sensor. when I connect it to an esp it works great for a while, but after a while it goes to the state “unknown” I have tried different things, but in the logs I see that the dallas temprature sensor gets recognized as you can see in the log:
In general, to get something to work, you must make sure everything that is needed is there and nothing that can block it from working is present. The DS18B20 is magical (when it works correctly) but like many things it does have some requirements and you have to meet them.
Are you using a “real” one sourced from a reliable dealer, or more likely do you have one of the many clones that probably mostly work, most of the time
How do you have it connected?
How long are the wires?
What kind of wires?
Looks like you are only using a single one which makes things easier, have you tried replacing the sensor with a different one?
I have had generally good luck with them and like them a lot. When I started there were no fakes and I got real ones and they were expensive. Now they are 1/10th the price and come encased in stainless steel (sometimes with epoxy even) but the insides are all fake. Still, they mostly, until they don’t. I have the most difficulty with my aerated static compost pile. It gets HOT in there and it is a very difficult environment, even with extra measures I don’t typically get a full year of service before I have to replace the sensors. Next time I will pay 10x to get real ones and see if that improves things. I have some real ones I installed in less challenging environments that are still working fine after a decade or more, so it is possible.
There have been some threads on the challenges some people have had using esphome with a similar error to what you are seeing. I have been using Tasmota and have not seen that problem. I don’t have a lot of experience with using esphome and the DS18B20, but it just worked for me when I tried it.
I think I found the problem. it looks like it is indeed the sensor itself. I ordered an original, and connected it, and it works great now. so I think it was the cheap chineze sensor that was the problem