esphome / issues

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

ESP32 (Wroom) doent work with Dallas DS18B20 Sensor #5730

Closed StrSebastian closed 2 weeks ago

StrSebastian commented 3 weeks ago

The problem

I tested 300 Versions of these kind of yaml. And all kinds of configuratiosn nothing worked. Sensor not found or jost nothing in the log. I also uses all kind of resostors. Also multible or single sensors. But what makes me sure about the issu: it worked first try with Arduino IDE. Got the right temprature with example code. My guess is, the bug is somewhere in the lib ob HA build pipline.

Which version of ESPHome has the issue?

2024.4.0

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2024.4.3

What platform are you using?

ESP32

Board

Wroom 32

Component causing the issue

Dallas Sensor DS18B20

Example YAML snippet

I tested 300 Versions of these kind of yaml. 
And all kinds of configuratiosn nothing worked. 
Sensor not found or jost nothing in the log.
I also uses all kinds of resostors. 
Also multible or single sensors.
But what makes me sure about the issu: it worked first try with Arduino IDE. Got the right temprature with example code.
My guess is, the bug is somewhere in the lib ob HA.
dallas:
  pin:
    number: GPIO26<Optional tested>
    mode:
      input: true <Optional tested> 
      pullup: true<Optional tested>
  update_interval: 5s

Anything in the logs that might be useful for us?

nop.

Additional information

https://community.simon42.com/t/probleme-mit-esp32-und-dallas-temperatur-sensor/4522/15

sbrk-r commented 3 weeks ago

Try commenting out mode/input/pullup and have a hardware pullup, see if it works. Maybe mode is overriding something crucial.

I see open feature request asking for advanced pin options, so must not be supported currently..? Maybe it was added without closing FR FR 2499

I use configuration like this on many boards with no issues:

dallas:
  - pin: GPIO16
    id: ow0
    update_interval: 10s

sensor:
  - platform: dallas
    #address: 0x6c0000052b7f0828
    dallas_id: ow0
    index: 0
    name: "ow0_t0"
    accuracy_decimals: 2
StrSebastian commented 3 weeks ago

thx for the answer @sbrk-r Unfortunatly i tryed all versions. specially with and without these lines of code. I testet your config but it didnt work again :/ console:

[19:59:27][W][dallas.sensor:080]: Found no sensors!

[19:59:27][C][dallas.sensor:089]: Device Class: 'temperature' [19:59:27][C][dallas.sensor:089]: State Class: 'measurement' [19:59:27][C][dallas.sensor:089]: Unit of Measurement: '°C' [19:59:27][C][dallas.sensor:089]: Accuracy Decimals: 2 [19:59:27][C][dallas.sensor:091]: Index 0

here my code: substitutions: name: esphome-web-xxx friendly_name: ESPHome Web xxxx

esphome: name: ${name} friendly_name: ${friendly_name} name_add_mac_suffix: false project: name: esphome.web version: '1.0'

esp32: board: esp32dev framework: type: arduino

Enable logging

logger:

Enable Home Assistant API

api:

Allow Over-The-Air updates

ota:

Allow provisioning Wi-Fi via serial

improv_serial:

wifi:

Set up a wifi access point

ap: {}

In combination with the ap this allows the user

to provision wifi credentials to the device via WiFi AP.

captive_portal:

dashboard_import: package_import_url: github://esphome/example-configs/esphome-web/esp32.yaml@main import_full_config: true

Sets up Bluetooth LE (Only on ESP32) to allow the user

to provision wifi credentials to the device.

esp32_improv: authorizer: none

To have a "next url" for improv serial

web_server:

dallas:

sensor:

swoboda1337 commented 2 weeks ago

Did you pull the usb/serial logs. Should see "Setting up DallasComponent..."