I’ve been having the same issues, but tried something different. There’s a newer library out there called OneWireNg that appears to be more stable. I’ve created a sort of dallas clone and now have it working on a number of projects.
You can see it at https://github.com/nrandell/dallasng
I’m using it with some esp32 on pretty new versions of libraries where the Dallas in esphome just didn’t work at all.
Excerpt from my configuration is
external_components:
- source: github://nrandell/dallasng
esp32:
board: um_feathers3
variant: esp32s3
framework:
type: arduino
version: 2.0.3
platform_version: 4.3.0
dallasng:
- pin: GPIO6
update_interval: 3s
sensor:
- platform: dallasng
name: ${fullname} Temperature
index: 0
resolution: 12
filters:
- filter_out: NAN