DS18B20 probes are industry standard for submerged temperature reporting in everything from hot tubs to aquariums.
If you’re getting unreliable and imprecise readings, it’s almost always one of two causes:
- you didn’t get an actual maxim DS18B20 probe, you got one of the many offbrand clones. These are sufficient for many use cases, but definitely are not as precise as the original. You can probably tell by the price. And original is likely to cost close to $15, the clones typically cost under $8.
Digikey and Mouser are usually good sources for reliable DS18B20s.
- you connected the probe to a less precise thermostat. I would definitely put the sonoff into this category, but YMMV.

Remember when checking the accuracy specifications for a device that many of them are given in Celsius rather than Fahrenheit. +/- 0.5°C is a range of about 4°F. Again, fine for some use cases, but not for others.
————
What accuracy were you looking for?