Page 1 of 1

Sonoff THR316D

Posted: 07 Oct 2023, 17:09
by cigale
Hello, I flashed the Sonoff THR316D with the WTS01 temperature probe
I can configure everything except the temperature probe, I can't get the address
I used the binary ESP_Easy_mega_20230304_climate_ESP32_4M316k.bin

Re: Sonoff THR316D

Posted: 07 Oct 2023, 19:42
by TD-er
You need to pull up GPIO-27
So you can set this as the boot state on the hardware tab.
Then reboot, or just give the command "gpio,27,1"

Re: Sonoff THR316D

Posted: 07 Oct 2023, 21:05
by cigale
Thanks, that was it, now it works
I couldn't find the information

Re: Sonoff THR316D

Posted: 07 Oct 2023, 22:46
by TD-er
The 3V3 pin of the RJ11 connector is controlled by this GPIO.

Re: Sonoff THR316D

Posted: 08 Oct 2023, 14:22
by cigale
thanks, now it works

Re: Sonoff THR316D

Posted: 11 Oct 2023, 15:09
by cigale
I still have a little problem with the configuration
I can't get the button to work
Is there anything special to do with it?
I enable Internal PullUp it works, but after a reboot it no longer works, then I disable Internal PullUp it works again, but after a reboot it no longer works, I re-enable it and it works until the next boot

Re: Sonoff THR316D

Posted: 11 Oct 2023, 15:32
by TD-er
Button: GPIO-0
Relay1: GPIO-21
Relay2: GPIO-4


The button is a push-button, so you should set the Switch Button Type to "Push Button Active High" (or Low, as long as it is set as push button)

This will then toggle the state each time you press the button.

I don't have the internal pull-up checked.

Re: Sonoff THR316D

Posted: 11 Oct 2023, 16:05
by cigale
That's what I did

Re: Sonoff THR316D

Posted: 11 Oct 2023, 16:20
by TD-er
You have the debounce set to 0.
That's not a good value for actual buttons which do bounce.
Try setting it to 100 msec.

Re: Sonoff THR316D

Posted: 11 Oct 2023, 16:35
by cigale
I just set it to 100ms, and it's still the same
I also tried with 200ms

Re: Sonoff THR316D

Posted: 11 Oct 2023, 16:46
by TD-er
I just added this as rule:

Code: Select all

on Button1#state do
  gpio,4,%eventvalue1%
endon
For this I may first need to get "in sync" so the first time I may need to press the button twice.

Changing it to this, should fix that:

Code: Select all

on Button1#state do
  gpiotoggle,4
endon

Re: Sonoff THR316D

Posted: 11 Oct 2023, 17:10
by cigale
thanks for your help, now it works