Hi, is there any way to support Sonoff WTS01Temperature Sensor via one_wire dallas component im using sonoff THR320 with esphome firmware and WTS01 sensor.
Tasmota has support for it and there is a long thread there with enough information for someone motivated enough to make it work for esphome too. So far no one has been motivated enough to make it work for esphome, as far as I can tell.
I encountered a similar issue and ended up creating a pull request on the ESPHome project to add support for the Sonoff WTS01 (DS18B20 variant). The implementation is largely inspired by Tasmota’s native support.
Feel free to try it out as an external component:
esphome:
on_boot:
- priority: 90
then:
# Make sure the sensor power is on at startup
- switch.turn_on: sensor_power
# Add WTS01 component from PR#8539
external_components:
- source: github://pr#8539
components: [ wts01 ]
switch:
# This is needed to power the external sensor.
# It receives 3v3 from this pin, which is pulled up on boot.
- platform: gpio
pin: GPIO27
id: sensor_power
restore_mode: ALWAYS_ON
uart:
id: uart_bus
rx_pin: GPIO25 # for data
baud_rate: 9600
sensor:
- platform: wts01
name: "Sonoff THR Temperature"
# All other options from Sensor