How to get 1-wire Dallas/Maxim temperature sensors working after updates

OK, LONG Hacking Session to get 1-wire Dallas/Maxim temperature sensors working after updates

I just updated HA OS , HA Core and ESPHOME 06/21/24
ESPHome 2024.6.1 HA 2024.6.3
The settings and code for the new version requires several changes to be able to use the Dallas/Maxim temperature sensors (AND the ota syntax is changed too… see below) . The information here:
1-Wire Bus - ESPHome Shows little of the required changes. I will try to update it.
The problems arise especially when using two (or more) ESP32 pins for 1-wire temperature sensors. There is a new syntax for multiple pins. Here’s the original that was working:

esp32:
  board: esp32dev
  framework:
    type: arduino
    
# -----(  IO Devices   )---------------------------

dallas:      
  - pin: GPIO23
    id: ONEW_1
  - pin: GPIO16
    id: ONEW_2

sensor:
  - platform: dallas
    dallas_id: ONEW_1
    address: 0xcf00000065d36e28
    name: "Temperature At Panel"
    unit_of_measurement: "°F"
    icon: "mdi:water-percent"
    filters:
      - lambda: return x * (9.0/5.0) + 32.0; # Convert Celsius to Fahrenheit

  - platform: dallas
    dallas_id: ONEW_2
    address: 0x120516a471c3ff28
    name: "POOL Heater Output"
    unit_of_measurement: "°F"
    icon: "mdi:water-percent"
    filters:
      - lambda: return x * (9.0/5.0) + 32.0; # Convert Celsius to Fahrenheit

  - platform: dallas
    dallas_id: ONEW_2
    address: 0xd80517a246a3ff28
    name: "POOL Temperature"
    unit_of_measurement: "°F"
    icon: "mdi:water-percent"
    filters:
      - lambda: return x * (9.0/5.0) + 32.0; # Convert Celsius to Fahrenheit

HERE is the new working version after 2 hours of guessing:


esp32:
  board: esp32dev
  framework:
    type: arduino
    
# -----(  IO Devices   )---------------------------
one_wire:              - CHANGES
  - platform: gpio  - CHANGES

    pin: GPIO23
    id: ONEW_1
    
  - platform: gpio   
    pin: GPIO16
    id: ONEW_2

sensor:
  - platform: dallas_temp     - CHANGES
    one_wire_id: ONEW_1     - CHANGES  (I made this up, but it works…)
    address: 0xcf00000065d36e28
    name: "Temperature At Panel"
    unit_of_measurement: "°F"
    icon: "mdi:water-percent"
    filters:
      - lambda: return x * (9.0/5.0) + 32.0; # Convert Celsius to Fahrenheit

  - platform: dallas_temp    - CHANGES
    one_wire_id: ONEW_2     - CHANGES
    address: 0x120516a471c3ff28
    name: "POOL Heater Output"
    unit_of_measurement: "°F"
    icon: "mdi:water-percent"
    filters:
      - lambda: return x * (9.0/5.0) + 32.0; # Convert Celsius to Fahrenheit

  - platform: dallas_temp    - CHANGES
    one_wire_id: ONEW_2   - CHANGES
    address: 0xd80517a246a3ff28
    name: "POOL Temperature"
    unit_of_measurement: "°F"
    icon: "mdi:water-percent"
    filters:
      - lambda: return x * (9.0/5.0) + 32.0; # Convert Celsius to Fahrenheit

AND THEN the OTA changes to this:

# Allow Over-The-Air updates

ota:
  password: "xxxxxxxx"
  platform: esphome

Can anyone suggest where and how to update the documentation???

THANKS!!!
Regards, Terry King
…In The Woods In Vermont and On The Nile in Egypt
The one who dies with the most Parts LOSES! WHAT DO YOU NEED??

1 Like

Please format code correctly. Put it between three backticks like this:

```
CODE HERE
```

…then it’s legible, as opposed to what you posted.

All the changes are already listed in the changelog (in particular, OTA and 1-wire / dallas_temp) and the relevant reference pages:

one_wire_id is listed here:

Hi Thanks… I didn’t look in AllTheRightPlaces…

What is missing is an example back in https://esphome.io/components/one_wire#one-wire

that shows an example of entering multiple Pin Ids and where to put them…

Regards, Terry

1 Like

Check the pinned topic in this forum category. https://community.home-assistant.io/t/heads-up-for-esphome-2024-6/741377/24?u=tom_l

Please correct post one as @troon requested.

2 Likes

Hi, ThisForumNewbie just found the elusive “BackTick” on my keyboard.

I’m from Vermont so I’m used to checking for (and finding) Ticks.

Regards, Terry King
…In The Woods In Vermont and On The Nile in Egypt
The one who dies with the most Parts LOSES! WHAT DO YOU NEED??

2 Likes

Hi Tom, THANKS… I will try to get better at finding my way here…

I have NOT been able to get 2-factor signon to work for GitHub so i’m outside that fence.

What really needs to be added to the Docs:
HERE is that EACH instance of a PIN with an ID needs to have a PLATFORM entry. Took me an hour to figure THAT error out. I suggest this example be included there:

one_wire:
  - platform: gpio
    pin: GPIOXX
    id: bus1
  - platform: gpio
    pin: GPIOYY
    id: bus2

Regards Terry

1 Like