esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
291 stars 34 forks source link

Strange behavior with DS18B20 #5983

Closed deanfourie1 closed 5 days ago

deanfourie1 commented 1 week ago

The problem

When I setup the one_wire component on its own, it finds my DS18B20 sensor and displays the ID, However, when I setup the DS18B20 device as a sensor, with the address specified, I get the error no sensors found.

With the following code,

one_wire:
  - platform: gpio
    pin: GPIO14

image

And with the following code,

one_wire:
  - platform: gpio
    pin: GPIO14

sensor:
  - platform: dallas_temp
    address: 0x950121128170a628
    name: "Temp"

image

Which version of ESPHome has the issue?

2024.6.4

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2024.6.4

What platform are you using?

ESP32

Board

Kinkony KC868-A8

Component causing the issue

dallas_temp

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

deanfourie1 commented 1 week ago

Additionally, from the log.

[01:01:38][W][dallas.temp.sensor:139]: 'CoreRackTemp' - Scratch pad checksum invalid!
[01:01:38][W][component:157]: Component dallas_temp.sensor set Warning flag: scratch pad checksum invalid
[01:01:38][D][sensor:094]: 'CoreRackTemp': Sending state nan °C with 1 decimals of accuracy
ssieb commented 1 week ago

That is very strange. Does removing the sensor definition bring it back?

deanfourie1 commented 1 week ago

Yea, if I remove the dallas_temp sensor, the sensor is found and displays the address, to which I then add to my sensor and then again, no sensors found with the above error.

ssieb commented 1 week ago

Try adding setup_priority: -100 to the sensor and see what happens.

deanfourie1 commented 1 week ago

Wow, thank you so much.

That worked.

ssieb commented 1 week ago

I think I have an idea of what went wrong. Try putting setup_priority: 1000 on the one_wire: component instead. Looks like I forgot to set the priority.

deanfourie1 commented 6 days ago

Yup that works too, I removed from the sensor and added the above to the one_wire component.

But its weird that it works on 3 of the other identical boards just not this one, all on the latest version.

ssieb commented 6 days ago

ok, even stranger is that the one_wire component actually does have that priority already. I looked in the wrong file. I didn't think I would have missed that... :shrug:

deanfourie1 commented 5 days ago

Yea thats strange, but for now this is resolved for me haha, sensor is working perfectly so im happy for this to be closed.

Thanks again for the support, love your work! Love ESPhome.