Sonoff TH10 and DS18B20 in ESPHome

Tags: #<Tag:0x00007f739024d7a8>

I am busy moving all of my ESP-based devices to ESPhome. The one remaining device I have is a Sonoff TH10 with DS18B20 temperature sensor. Does nayone have a sample connfig to control the switch, button and temperature sensor for use in HA?

Thanks!

Hi, were you able to get it working? Thinking about doing the same

No - currently still on Tasmota as I couldn’t figure it out. Switch and button are pretty straightforward, but I couldn’t find any info on the temp sensor.

Ok will keep you posted :slight_smile:

Solved it by following this explanation: https://esphome.io/components/sensor/dallas.html
Just add first this config:

dallas:
  - pin: GPIO14

Then compile & download the binary and upload it through the tasmota web interface.
In the output you will then see the address of the sensor appearing and then you can edit the config and add this:

sensor:
  - platform: dallas
    address: 0x2A03189779311128
    name: "Zwembad Temperatuur"

That’s it :wink: works as a charm
Good luck!

image

Great - mny thanks for posting! Will give it a try.

Do you mind sharing your whole config (button, switch etc.)?

Of course not:

substitutions:
  device_name: zwembad_temperatuur
  friendly_name: "Zwembad Temperatuur"
  dallas_address: "0xDC03219779B4F228"
  sonoff_type: "TH10"

esphome:
  name: ${device_name}
  platform: ESP8266
  board: esp8285
  arduino_version: 2.4.2

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap:
    ssid: ${friendly_name} FB
    password: !secret esphome_admin_password

captive_portal:

logger:

api:
  password: !secret esphome_admin_password

web_server:
  port: 80

ota:
  password: !secret esphome_admin_password

dallas:
  - pin: GPIO14
sensor:
  - platform: wifi_signal
    name: ${friendly_name} ${sonoff_type} WiFi Signal
    update_interval: 60s
  - platform: dallas
    address: ${dallas_address}
    name: ${friendly_name} ${sonoff_type}
  - platform: uptime
    name: ${friendly_name} ${sonoff_type} Uptime 
    id: uptime_sec
    update_interval: 120s
binary_sensor:
  - platform: status
    name: ${friendly_name} ${sonoff_type} Status
switch:
  - platform: restart
    name: ${friendly_name} ${sonoff_type} Restart
  - platform: gpio
    name: ${friendly_name} ${sonoff_type}
    pin: GPIO12
    id: relay
    #restore_mode: ALWAYS_OFF
text_sensor:
  - platform: wifi_info
    ip_address:
      name: ${friendly_name} ${sonoff_type} IP
    ssid:
      name: ${friendly_name} ${sonoff_type} SSID
    bssid:
      name: ${friendly_name} ${sonoff_type} BSSID