esphome / issues

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

1Wire problem after 2024.6 update #6045

Closed sebsebseb1982 closed 1 month ago

sebsebseb1982 commented 1 month ago

The problem

Hi,

For some time now, I have been having problems with my DS18B20 probes which no longer report temperature.

I saw several issues relating to the same problem, I,ve tried the proposed solutions:

But none of them seem to work... does anyone have any idea what might be causing the problem? What have I missing ?

Which version of ESPHome has the issue?

2024.6.6

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2024.7.2

What platform are you using?

ESP32

Board

No response

Component causing the issue

No response

Example YAML snippet

esphome:
  name: domo
  friendly_name: Domo

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "[redacted]"

ota:
  - platform: esphome
    password: "[redacted]"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Domo Fallback Hotspot"
    password: "[redacted]"

captive_portal:

# Example configuration entry
one_wire:
  - platform: gpio
    pin: 17

#external_components:
#  - source:
#      type: git
#      url: https://github.com/ssieb/esphome
#      ref: onewire
#    components: [ gpio ]
#    refresh: 1min

#interval:
#  - interval: 60s
#    then:
#      - component.update: etage
#      - delay: 1s
#      - component.update: exterieur
#      - delay: 1s
#      - component.update: rez_de_chaussee
#      - delay: 1s

# Individual sensors
sensor:
  - platform: dallas_temp
    address: 0x85000004549bbe28
    name: "Extérieur"
    id: "exterieur"
#    update_interval: never
    update_interval: 30s
    filters:
      - filter_out: nan
      - filter_out: 85.0
  - platform: dallas_temp
    address: 0xb100000454650f28
    name: "Etage"
    id: "etage"
#    update_interval: never
    update_interval: 30s
    filters:
      - filter_out: nan
      - filter_out: 85.0
  - platform: dallas_temp
    address: 0x8b00000454084928
    name: "Rez-de-chaussée"
    id: "rez_de_chaussee"
#    update_interval: never
    update_interval: 30s
    filters:
      - filter_out: nan
      - filter_out: 85.0
  - platform: uptime
    name: Uptime Sensor

switch:
  - platform: gpio
    pin: 25
    id: gate
    name: "Gate Remote"
    icon: "mdi:gate"
    on_turn_on:
    - delay: 300ms
    - switch.turn_off: gate
  - platform: gpio
    pin: 
      number: 14
      allow_other_uses: true
    id: buzzer
    name: "Buzzer"
    on_turn_on:
    - delay: 200ms
    - switch.turn_off: buzzer
  - platform: gpio
    id: longBuzzer
    pin: 
      number: 14  
      allow_other_uses: true
    name: "Buzzer long"
    on_turn_on:
    - delay: 12s
    - switch.turn_off: longBuzzer
  - platform: gpio
    pin: 33
    id: gpio33
    name: "GPIO 33"
  - platform: gpio
    pin: 32
    id: gpio32
    name: "GPIO 32"
  - platform: gpio
    pin: 26
    id: gpio26
    name: "Chaudière"
  - platform: gpio
    pin: 23
    id: gpioR
    name: "LED R"
  - platform: gpio
    pin: 1
    id: gpioG
    name: "LED G"
  - platform: gpio
    pin: 3
    id: gpioB
    name: "LED B"
  - platform: restart
    name: "Domo restart"
    id: restart_domo

binary_sensor:
  - platform: gpio
    pin:
      number: 27
      inverted: true
      mode: 
        input: true
        pulldown: true
    name: "Sonnette"
    device_class: window
    filters:
      - delayed_on: 10ms

time:
  - platform: homeassistant
    on_time:
      - seconds: 0
        minutes: 30
        hours: 3
        days_of_week: MON-SUN
        then:
           - logger.log: "***************** time event ***"
           - switch.toggle: restart_domo

Anything in the logs that might be useful for us?

[12:53:34][I][app:100]: ESPHome version 2024.6.6 compiled on Jul 16 2024, 12:48:06
[12:53:34][C][wifi:599]: WiFi:
[12:53:34][C][wifi:427]:   Local MAC: [redacted]
[12:53:34][C][wifi:432]:   SSID: [redacted]
[12:53:34][C][wifi:435]:   IP Address: [redacted]
[12:53:34][C][wifi:439]:   BSSID: [redacted]
[12:53:34][C][wifi:440]:   Hostname: 'domo'
[12:53:34][C][wifi:442]:   Signal strength: -32 dB ▂▄▆█
[12:53:34][C][wifi:446]:   Channel: 1
[12:53:34][C][wifi:447]:   Subnet: 255.255.255.0
[12:53:34][C][wifi:448]:   Gateway: 192.168.1.1
[12:53:34][C][wifi:449]:   DNS1: 192.168.1.1
[12:53:34][C][wifi:450]:   DNS2: 0.0.0.0
[12:53:34][C][logger:185]: Logger:
[12:53:34][C][logger:186]:   Level: DEBUG
[12:53:34][C][logger:188]:   Log Baud Rate: 115200
[12:53:34][C][logger:189]:   Hardware UART: UART0
[12:53:34][C][gpio.one_wire:020]: GPIO 1-wire bus:
[12:53:34][C][gpio.one_wire:021]:   Pin: GPIO17
**[12:53:34][W][gpio.one_wire:078]:   Found no devices!**
[12:53:34][C][uptime.sensor:031]: Uptime Sensor 'Uptime Sensor'
[12:53:34][C][uptime.sensor:031]:   Device Class: 'duration'
[12:53:34][C][uptime.sensor:031]:   State Class: 'total_increasing'
[12:53:34][C][uptime.sensor:031]:   Unit of Measurement: 's'
[12:53:34][C][uptime.sensor:031]:   Accuracy Decimals: 0
[12:53:34][C][uptime.sensor:031]:   Icon: 'mdi:timer-outline'
[12:53:34][C][switch.gpio:068]: GPIO Switch 'Gate Remote'
[12:53:34][C][switch.gpio:070]:   Icon: 'mdi:gate'
[12:53:34][C][switch.gpio:091]:   Restore Mode: always OFF
[12:53:34][C][switch.gpio:031]:   Pin: GPIO25
[12:53:34][C][switch.gpio:068]: GPIO Switch 'Buzzer'
[12:53:34][C][switch.gpio:091]:   Restore Mode: always OFF
[12:53:34][C][switch.gpio:031]:   Pin: GPIO14
[12:53:34][C][switch.gpio:068]: GPIO Switch 'Buzzer long'
[12:53:34][C][switch.gpio:091]:   Restore Mode: always OFF
[12:53:34][C][switch.gpio:031]:   Pin: GPIO14
[12:53:34][C][switch.gpio:068]: GPIO Switch 'GPIO 33'
[12:53:34][C][switch.gpio:091]:   Restore Mode: always OFF
[12:53:34][C][switch.gpio:031]:   Pin: GPIO33
[12:53:34][C][switch.gpio:068]: GPIO Switch 'GPIO 32'
[12:53:34][C][switch.gpio:091]:   Restore Mode: always OFF
[12:53:34][C][switch.gpio:031]:   Pin: GPIO32
[12:53:34][C][switch.gpio:068]: GPIO Switch 'Chaudière'
[12:53:34][C][switch.gpio:091]:   Restore Mode: always OFF
[12:53:34][C][switch.gpio:031]:   Pin: GPIO26
[12:53:34][C][switch.gpio:068]: GPIO Switch 'LED R'
[12:53:34][C][switch.gpio:091]:   Restore Mode: always OFF
[12:53:34][C][switch.gpio:031]:   Pin: GPIO23
[12:53:34][C][switch.gpio:068]: GPIO Switch 'LED G'
[12:53:34][C][switch.gpio:091]:   Restore Mode: always OFF
[12:53:34][C][switch.gpio:031]:   Pin: GPIO1
[12:53:34][C][switch.gpio:068]: GPIO Switch 'LED B'
[12:53:34][C][switch.gpio:091]:   Restore Mode: always OFF
[12:53:34][C][switch.gpio:031]:   Pin: GPIO3
[12:53:34][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Sonnette'
[12:53:34][C][gpio.binary_sensor:015]:   Device Class: 'window'
[12:53:34][C][gpio.binary_sensor:016]:   Pin: GPIO27
**[12:53:34][C][dallas.temp.sensor:029]: Dallas Temperature Sensor:
[12:53:34][C][dallas.temp.sensor:034]:   Address: 0x85000004549bbe28 (DS18B20)
[12:53:34][C][dallas.temp.sensor:035]:   Resolution: 12 bits
[12:53:34][C][dallas.temp.sensor:036]:   Update Interval: 30.0s
[12:53:34][C][dallas.temp.sensor:029]: Dallas Temperature Sensor:
[12:53:34][C][dallas.temp.sensor:034]:   Address: 0xb100000454650f28 (DS18B20)
[12:53:34][C][dallas.temp.sensor:035]:   Resolution: 12 bits
[12:53:34][C][dallas.temp.sensor:036]:   Update Interval: 30.0s
[12:53:34][C][dallas.temp.sensor:029]: Dallas Temperature Sensor:
[12:53:34][C][dallas.temp.sensor:034]:   Address: 0x8b00000454084928 (DS18B20)
[12:53:34][C][dallas.temp.sensor:035]:   Resolution: 12 bits
[12:53:34][C][dallas.temp.sensor:036]:   Update Interval: 30.0s**
[12:53:34][C][restart:068]: Restart Switch 'Domo restart'
[12:53:34][C][restart:070]:   Icon: 'mdi:restart'
[12:53:34][C][restart:091]:   Restore Mode: always OFF
[12:53:34][C][homeassistant.time:010]: Home Assistant Time:
[12:53:34][C][homeassistant.time:011]:   Timezone: 'CET-1CEST,M3.5.0,M10.5.0/3'
[12:53:34][C][captive_portal:088]: Captive Portal:
[12:53:34][C][mdns:115]: mDNS:
[12:53:34][C][mdns:116]:   Hostname: domo
[12:53:34][C][esphome.ota:073]: Over-The-Air updates:
[12:53:34][C][esphome.ota:074]:   Address: domo.local:3232
[12:53:34][C][esphome.ota:075]:   Version: 2
[12:53:34][C][esphome.ota:078]:   Password configured
[12:53:34][C][safe_mode:018]: Safe Mode:
[12:53:34][C][safe_mode:020]:   Boot considered successful after 60 seconds
[12:53:34][C][safe_mode:021]:   Invoke after 10 boot attempts
[12:53:34][C][safe_mode:023]:   Remain in safe mode for 300 seconds
[12:53:34][C][api:139]: API Server:
[12:53:34][C][api:140]:   Address: domo.local:6053
[12:53:34][C][api:142]:   Using noise encryption: YES
**[12:53:48][W][component:170]: Component dallas_temp.sensor cleared Warning flag
[12:53:49][W][dallas.temp.sensor:074]: 'Extérieur' - reading scratch pad failed bus reset
[12:53:49][W][component:157]: Component dallas_temp.sensor set Warning flag: bus reset failed
[12:53:55][W][component:170]: Component dallas_temp.sensor cleared Warning flag
[12:53:55][W][component:170]: Component dallas_temp.sensor cleared Warning flag
[12:53:55][W][dallas.temp.sensor:074]: 'Rez-de-chaussée' - reading scratch pad failed bus reset
[12:53:55][W][component:157]: Component dallas_temp.sensor set Warning flag: bus reset failed
[12:53:56][W][dallas.temp.sensor:074]: 'Etage' - reading scratch pad failed bus reset
[12:53:56][W][component:157]: Component dallas_temp.sensor set Warning flag: bus reset failed
[12:53:59][D][sensor:094]: 'Uptime Sensor': Sending state 271.92801 s with 0 decimals of accuracy
[12:54:18][W][component:170]: Component dallas_temp.sensor cleared Warning flag
[12:54:19][W][dallas.temp.sensor:074]: 'Extérieur' - reading scratch pad failed bus reset
[12:54:19][W][component:157]: Component dallas_temp.sensor set Warning flag: bus reset failed
[12:54:25][W][component:170]: Component dallas_temp.sensor cleared Warning flag
[12:54:25][W][component:170]: Component dallas_temp.sensor cleared Warning flag
[12:54:25][W][dallas.temp.sensor:074]: 'Rez-de-chaussée' - reading scratch pad failed bus reset
[12:54:25][W][component:157]: Component dallas_temp.sensor set Warning flag: bus reset failed
[12:54:26][W][dallas.temp.sensor:074]: 'Etage' - reading scratch pad failed bus reset
[12:54:26][W][component:157]: Component dallas_temp.sensor set Warning flag: bus reset failed**

Additional information

No response

ssieb commented 1 month ago

Was this ever working? If so, how long ago? The [12:53:49][W][dallas.temp.sensor:074]: 'Extérieur' - reading scratch pad failed bus reset indicates that the sensor is not responding to the presence detect pulse or else something else is pulling down the bus line.

sakrlog commented 1 month ago

I'm facing the same problem as well. I had this Tuya MS-103 device that I flashed to use esphome. It was working fine for over 6 months. On the latest update that change dallas->1wire, the temperature stopped working. An interesting fact, When I first deployed the updated code, it was working intermediately, now it is not at all.

esphome:
  name: azan
  friendly_name: Azan

bk72xx:
  board: generic-bk7231t-qfn32-tuya

# Enable logging
logger:

mdns:

# Enable Home Assistant API
api:

ota:
  platform: esphome
  password: ""

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Azan Fallback Hotspot"
    password: "RmVSNDtwUSDH"

captive_portal:

text_sensor:
  - platform: libretiny
    version:
      name: LibreTiny Version

one_wire:
  - platform: gpio
    pin: 7

sensor:
  - platform: dallas_temp
    address: 0x8e3c01f096982e28
    name: "Azan Temperature"

output:
  - platform: libretiny_pwm
    id: output_led_1
    pin:
      number: P9
      inverted: true
  - platform: libretiny_pwm
    id: output_led_2
    pin:
      number: P8
      inverted: true

light:
  - platform: monochromatic
    id: light_switch_1
    output: output_led_1
  - platform: monochromatic
    id: light_switch_2
    output: output_led_2

switch:
  - platform: gpio
    id: switch_1
    name: Relay 1
    pin: P6
    on_turn_on:
      - light.turn_on: light_switch_1
    on_turn_off:
      - light.turn_off: light_switch_1
  - platform: gpio
    id: switch_2
    name: Relay 2
    pin: P24
    on_turn_on:
      - light.turn_on: light_switch_2
    on_turn_off:
      - light.turn_off: light_switch_2

binary_sensor:
  - platform: gpio
    id: binary_switch_all
    pin:
      number: P1
      inverted: true
      mode: INPUT_PULLUP
    on_press:
      then:
        - switch.toggle: switch_1
        - switch.toggle: switch_2

status_led:
  pin:
    number: P10
    inverted: true

Not sure what to do at this point.

sebsebseb1982 commented 1 month ago

Was this ever working? If so, how long ago? The [12:53:49][W][dallas.temp.sensor:074]: 'Extérieur' - reading scratch pad failed bus reset indicates that the sensor is not responding to the presence detect pulse or else something else is pulling down the bus line.

Yes it was working since at least two years but it seems to be erratic since the last june updates. This night the measurements were resumed but it seems erratic :

image

sakrlog commented 1 month ago

Screenshot 2024-07-17 at 12 47 06 @sebsebseb1982 In my logs I was seeing "Scratch pad checksum invalid!". I unplugged the sensor and reinserted it. Now it is working. Waiting for it to stop

ltvanderkrogt commented 1 month ago

ESPHome 2024.7.1 fixed my ds18b20 issue! I have 4 sensors on 1 wire connected to a Wemos d1 mini. image

kevindebosscher commented 1 month ago

same problem over here since last update... Worked for years,

No sensor found: [15:12:24][C][gpio.one_wire:020]: GPIO 1-wire bus: [15:12:24][C][gpio.one_wire:021]: Pin: GPIO2 [15:12:24][W][gpio.one_wire:078]: Found no devices!

Know previously working addresses: [15:12:24][C][dallas.temp.sensor:029]: Dallas Temperature Sensor: [15:12:24][C][dallas.temp.sensor:034]: Address: 0xc9012063c8d0f028 (DS18B20) [15:12:24][C][dallas.temp.sensor:035]: Resolution: 12 bits [15:12:24][C][dallas.temp.sensor:036]: Update Interval: 30.0s [15:12:24][C][dallas.temp.sensor:029]: Dallas Temperature Sensor: [15:12:24][C][dallas.temp.sensor:034]: Address: 0x0c012063c40e0328 (DS18B20) [15:12:24][C][dallas.temp.sensor:035]: Resolution: 12 bits [15:12:24][C][dallas.temp.sensor:036]: Update Interval: 30.0s [15:12:24][C][dallas.temp.sensor:029]: Dallas Temperature Sensor: [15:12:24][C][dallas.temp.sensor:034]: Address: 0x91012063bbb27028 (DS18B20) [15:12:24][C][dallas.temp.sensor:035]: Resolution: 12 bits [15:12:24][C][dallas.temp.sensor:036]: Update Interval: 30.0s [15:12:24][C][dallas.temp.sensor:029]: Dallas Temperature Sensor: [15:12:24][C][dallas.temp.sensor:034]: Address: 0x21012063b0999728 (DS18B20) [15:12:24][C][dallas.temp.sensor:035]: Resolution: 12 bits [15:12:24][C][dallas.temp.sensor:036]: Update Interval: 30.0s

Faults: [15:15:38][W][component:170]: Component dallas_temp.sensor cleared Warning flag [15:15:38][W][dallas.temp.sensor:074]: 'HeatExchIN' - reading scratch pad failed bus reset [15:15:38][W][component:157]: Component dallas_temp.sensor set Warning flag: bus reset failed

sebsebseb1982 commented 1 month ago

Worked again after unplug & plug sensors

sakrlog commented 2 weeks ago

@sebsebseb1982 this case shouldn't have been closed. Sorry I didn't have the time to report again. Sometimes, unplugging and plugging again, makes the temp readable, but in any case, it will stop working again after a few hours

ESP32andmore commented 2 weeks ago

I report the same issue in #6119. One-Wire/Dallas_temp stopped working after 2024.6.6 with a ESP32 arduino build. I did get it to work two 2 weeks ago with 2024.7.4 by deleting the device, and adding it again with the original YAML reported here. But Monday I recompiled and it was not working again. I again deleted the device from the dashboard and re-added, but NOT working now. It does in fact work with another ESP32-S3 board with all versions. Samuel indicated there were no changes from 2024.6.6 to the code. The fact that it works with certain builds and not others leads one to the conclusion it might be build related. In all cases the hardware that it fails on is our testing rig for this board that has been confirmed to be fully functional as well the target board that is a mature design. Flashing 2024.6.6 the sensors are found and highly stable.

zimbo86 commented 1 week ago

my sensors stop working in the middle of the day. Working for weeks, [11:24:50][W][component:170]: Component dallas_temp.sensor cleared Warning flag [11:24:51][W][dallas.temp.sensor:074]: 'temp_water' - reading scratch pad failed bus reset [11:24:51][W][component:157]: Component dallas_temp.sensor set Warning flag: bus reset failed image

sakrlog commented 1 week ago

@zimbo86 this is 100% similar to the behavior I'm seeing

sysquadrat commented 5 days ago

Same issue here for one (1) out of six dallas temp-sensors. It failed since June 20th. The sensor is directly connected like the others. esphome see's the sensor.

sakrlog commented 5 days ago

Its interestingthat only one of the 6 is failing. Should we consider changing the senenor?

sysquadrat commented 3 days ago

Well I ordered 5 more now. Will check the sensor on another device to see if it works there. Sorry for the trouble.