Would appreciate any ideas, as I’m out of them atm. The guys over here https://github.com/arendst/Tasmota/issues/15856 managed to get it working with Tasmota (it’s a huge thread discussing other models and not just TH16R3)
I am having a similar issue with the Sonoff THR316 Origin and the WTS01 sensor. They are both sold as a bundle from Sonoff, and the sensor attaches to the sonoff via a 4-pin RJ9 connection.
Over the past few days I tried many solutions I could find online and I am unable to get the sensor to work with ESPhome and to report any temperature values.
ESPhome (version 2024.9.1) always gives me the error: [gpio.one_wire:078]: Found no devices!
I did manage to get the sensor working on Tasmota, selecting the GPIO25 as a SSerBr Tx and typing the SSerialMode 3 in the console. As advised in this thread: arendst/Tasmota#19373 (comment)
I basically took the default recommended config from Sonoff THR316 | devices.esphome.io and adjusted it for ESPhome 2024.9.1. Since that did not work, I added some debugging code when trying to troubleshoot, however this did not get me far. I am hoping some wiser people can help me out here.
Here is my ESPhome config for reference, where the sensor is not working:
# Sonoff THR316 Smart Temperature and Humidity Monitoring Switch
# Assumes that a DS18B20 temperature sensor is connected
substitutions:
friendly_name: "2-Boiler"
name: 2-boiler
esphome:
name: $name
on_boot:
- priority: 90
then:
# supply the external sensor with 3v power by pulling this GPIO high
- switch.turn_on: sensor_power
# Make sure the relay is in a known state at startup
- switch.turn_off: relay
# Default to running the climate control in Home mode
# - climate.control:
# id: climate_control
# preset: "Home"
esp32:
board: nodemcu-32s
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "${friendly_name} Fallback Hotspot"
password: "1234567890"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
- platform: esphome
#optional
web_server:
port: 80
time:
- platform: homeassistant
id: homeassistant_time
sensor:
- platform: wifi_signal
name: $friendly_name Wifi RSSI
update_interval: 60s
- platform: uptime
id: uptime_sensor
internal: True
on_raw_value:
then:
- text_sensor.template.publish:
id: uptime_human
state: !lambda |-
int seconds = round(id(uptime_sensor).raw_state);
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
return (
(days ? to_string(days) + "d " : "") +
(hours ? to_string(hours) + "h " : "") +
(minutes ? to_string(minutes) + "m " : "") +
(to_string(seconds) + "s")
).c_str();
- platform: template
name: $friendly_name ESP32 Internal Temp
device_class: temperature
unit_of_measurement: °C
id: esp32_temp
lambda: return temperatureRead();
# External DS18B20 Digital Temperature Sensor
# - platform: dallas_temp
# name: $friendly_name Temperature
# id: temp
# update_interval: 10s
switch:
- platform: gpio
name: $friendly_name
pin: GPIO21
id: relay
restore_mode: RESTORE_DEFAULT_OFF
on_turn_on:
- delay: 500ms
- light.turn_on: switch_led
on_turn_off:
- delay: 500ms
- light.turn_off: switch_led
- platform: restart
name: $friendly_name Restart
# This is needed to power the external sensor.
# It receives 3v3 from this pin, which is pulled up on boot.
- platform: gpio
pin: 27
id: sensor_power
restore_mode: ALWAYS_ON
text_sensor:
- platform: template
name: $friendly_name Uptime
id: uptime_human
icon: mdi:clock-start
- platform: wifi_info
ip_address:
name: $friendly_name IP
ssid:
name: $friendly_name SSID
bssid:
name: $friendly_name BSSID
light:
- platform: status_led
id: switch_led
internal: True
pin:
number: GPIO16
inverted: True
- platform: status_led
id: wifi_status_led
internal: True
pin:
number: GPIO15
inverted: True
- platform: status_led
id: auto_led
internal: True
pin:
number: GPIO13
inverted: True
interval:
- interval: 30s
then:
if:
condition:
wifi.connected:
then:
- light.turn_on: wifi_status_led
else:
- light.turn_off: wifi_status_led
# DS18B20 Digital Temperature Sensor Hub
one_wire:
- platform: gpio
pin: 25
id: dallas
button:
- platform: template
name: Test 1-wire bus
on_press:
- lambda: |-
id(dallas).search();
id(dallas).dump_config();