I’ve been looking for a temperature sensor for my PI3 home thermostat. I’m to the point where my app is stable and running for over 20 days with the only issues relating to the temperature sensors. I have dual DHT22 sensors and those will freeze up occasionally, for which the power needs to be reset. I will try to handle this reset in code, but because this controls my home HVAC system, I would like to get sensors that will not freeze up and have greater reliability. Recommendations from someone with a current PI3 thermostat being used to control their HVAC would be appreciated. I would like to be able to rely on the sensors.
Try a DS18B20. They are readily and cheaply available packaged in water proof, stainless steel enclosures.
I use lots of them and they operate very reliably in field conditions that are often extreme. Some have been operating continuously for 18 months.
Be aware though that they are a 5v unit (I use them on arduinos that then connect through to a RPI).
I get best results with the 3x wire config (+5v, GND, signal) with different pull up resistors on the signal depending on cable length and how many are on a single signal bus (you can have many on a single signal).
Libraries are readily available for arduinos and I recall also finding libraries for RPI a while back.
Example of the stainless steel enclosed component: https://www.altronics.com.au/p/z6386-stainless-steel-housing-waterproof-ds18b20-temperature-probe/
Extended discussion on solutions for an anomonly using these sensors in industrial conditions FYI (problem not with the sensor): https://iot.stackexchange.com/questions/2859/ds18b20-oscillating-rapidly/2929#2929
You've fallen into the trap of using a low cost first generation device because it got picked up by the hobbyist community. Whilst this is a great source of early-adopter information, it can be quite sticky, and not too concerned about reliability.
Finding the genuine 'safe' operating conditions for this sort of device can be hard since reliability was probably never a high priority for the original design, so you can expect to see dramatically better performance from a different part.
If you need remote sensors, the digital wiring will be your greatest concern - you need something which is resilient to EMI and potentially has a built-in watchdog at the sensor end.
If your sensors are local, analogue inputs might be more reliable than digital, but you can also think about building in some 'fault recovery' logic for the cases where your sensors fail and cease to return plausible data.