DS18b20 Dallas Temp Not Reading Temperature

I have a couple projects that I would like to use utilize a DS18b20 in Home Assistant through ESPHome. I tried last evening to set up my first sensor & it is not working correctly. The temperature is not being registered. First I was getting a “Scratch Pad Checksum” error. I read that ESPHome had been updated which contributed to some issues. I edited my YAML slightly & the previous error is gone but it still is not reading the temperature. I did try using a different sensor & have the same issue. Can someone please point me in the right direction?

I believe this is my board below. When I started down this path I didn’t realize there to so many versions.

image

esp32:
board: esp32dev
framework:
type: arduino

dallas:

  • pin: GPIO4

In the Log below, it finds the sensor.

[10:57:16][C][logger:447]: Logger:
[10:57:16][C][logger:448]: Level: DEBUG
[10:57:16][C][logger:449]: Log Baud Rate: 115200
[10:57:16][C][logger:451]: Hardware UART: UART0
[10:57:16][C][dallas.sensor:075]: DallasComponent:
[10:57:16][C][dallas.sensor:076]: Pin: GPIO4
[10:57:16][C][dallas.sensor:077]: Update Interval: 60.0s
[10:57:16][D][dallas.sensor:082]: Found sensors:
[10:57:16][D][dallas.sensor:084]: 0xe03ce1d45814f028
[10:57:16][C][captive_portal:088]: Captive Portal:
[10:57:16][C][mdns:115]: mDNS:
[10:57:16][C][mdns:116]: Hostname: shower-wall
[10:57:16][C][ota:096]: Over-The-Air Updates:
[10:57:16][C][ota:097]: Address: shower-wall.local:3232
[10:57:16][C][ota:100]: Using Password.
[10:57:16][C][ota:103]: OTA version: 2.
[10:57:16][C][api:139]: API Server:
[10:57:16][C][api:140]: Address: shower-wall.local:6053
[10:57:16][C][api:142]: Using noise encryption: YES

Try to use internal pullup or even better external pullup resistor 2-10 k.
As well can try external component dallasng.

external_components:
  - source: github://nrandell/dallasng

dallasng:
  - pin: 
      number: GPIO04
      mode:
        input: True
        pullup: True

sensor:
  - platform: dallasng
...

Check previous discussions regarding Dallas sensor - lot of happened and still happens.

I do have a 4.7K resistor installed per the ESPHome website. I’ll try editing my yaml with your suggestion & see what happens. It would not install the update until I added the addres line.

It is still not reading the temperature. Temperature failed to read scratchpad: 3

13:38:20][D][dallasng.sensor:060]: Found sensors:
[13:38:20][D][dallasng.sensor:063]: 0xe03ce1d45814f028
[13:38:20][C][dallasng.sensor:069]: Device ‘Temperature’
[13:38:20][C][dallasng.sensor:069]: Device Class: ‘temperature’
[13:38:20][C][dallasng.sensor:069]: State Class: ‘measurement’
[13:38:20][C][dallasng.sensor:069]: Unit of Measurement: ‘°C’
[13:38:20][C][dallasng.sensor:069]: Accuracy Decimals: 1
[13:38:20][C][dallasng.sensor:079]: Address: 0x1c0000031edd2a28
[13:38:20][C][dallasng.sensor:080]: Resolution: 12
[13:38:20][C][captive_portal:088]: Captive Portal:
[13:38:20][C][mdns:115]: mDNS:
[13:38:20][C][mdns:116]: Hostname: shower-wall
[13:38:20][C][ota:096]: Over-The-Air Updates:
[13:38:20][C][ota:097]: Address: shower-wall.local:3232
[13:38:20][C][ota:100]: Using Password.
[13:38:20][C][ota:103]: OTA version: 2.
[13:38:20][C][api:139]: API Server:
[13:38:20][C][api:140]: Address: shower-wall.local:6053
[13:38:20][C][api:142]: Using noise encryption: YES
[13:39:01][W][dallasng.sensor:111]: ‘Temperature’ failed to read scratchpad: 3
[13:40:01][W][dallasng.sensor:111]: ‘Temperature’ failed to read scratchpad: 3
[13:41:01][W][dallasng.sensor:111]: ‘Temperature’ failed to read scratchpad: 3
[13:42:01][W][dallasng.sensor:111]: ‘Temperature’ failed to read scratchpad: 3
[13:43:01][W][dallasng.sensor:111]: ‘Temperature’ failed to read scratchpad: 3
[13:44:01][W][dallasng.sensor:111]: ‘Temperature’ failed to read scratchpad: 3

[13:38:20][D][dallasng.sensor:060]: Found sensors:
[13:38:20][D][dallasng.sensor:063]: 0xe03ce1d45814f028
...
[13:38:20][C][dallasng.sensor:079]: Address: 0x1c0000031edd2a28

See different sensor addresses - actually connected (found) and configured in sensor.
IMHO that is main issue.

Yup! I see what I did now & it is working. Thanks for pointing that out.

BTW if/when have only Dallas sensor connected You can use ’ index: 0’ instead of address specified.