Page 1 of 3

Sonoff Touch

Posted: Sunday 30 April 2017 20:41
by Eddiever
I have a Sonoff Touch wall switch. I would like to change it's firmware through ESP Easy. I have been searching but haven't found the right firmware. Due to the fact it is using the 8285 chip instead of 8266.

Does anyone have a suggestion?

Re: Sonoff Touch

Posted: Monday 01 May 2017 11:38
by mayyam

Re: Sonoff Touch

Posted: Monday 01 May 2017 18:53
by Eddiever
mayyam, thanks. I just flashed it. Now to replace it with the active touch which is in normal use. But do I cut the power or should I just replace the circuitboard with the wiring still alive? Just kidding, always with the power off.

Re: Sonoff Touch

Posted: Tuesday 02 May 2017 20:53
by Eddiever
As I stated before I am very new and trying things out. Flashing worked. I can activate the ligth by hardware switch and from Domoticz. But somehow (I really don't know why) if I switch it manually the status in Domoticz won't change. Used some info from sincze
Switch 1.PNG
Switch 1.PNG (18.07 KiB) Viewed 7568 times
switch 2.PNG
switch 2.PNG (18.01 KiB) Viewed 7568 times
On action Domoticz:

Code: Select all

http://192.168.1.160/control?cmd=GPIO,12,1
I could really use some help. Who can?

Re: Sonoff Touch

Posted: Tuesday 02 May 2017 20:58
by mayyam
That's my config.
And I also use Rules:

Code: Select all

on System#Boot do
    gpio,12,1
    timerSet,1,1
  endif
endon

on Rules#Timer=1 do
    gpio,12,0
endon

on button#state do
  if [button#state]=1
    gpio,12,1
    endif
endon

on button#state do
  if [button#state]=0
    gpio,12,0
    endif
endon

Re: Sonoff Touch

Posted: Tuesday 02 May 2017 21:18
by Eddiever
Sorry mayyam, thought the code was from sincze.

Even if I set it up exactly like your example the state doesn't change within Domoticz. The IDX variable was wrong in my case. In Domoticz it has the value of 3. I changed that in both ESP devices.

From Domoticz:
domoticz.PNG
domoticz.PNG (121.15 KiB) Viewed 7565 times
What kind of stupid thing I am overlooking?

Re: Sonoff Touch

Posted: Tuesday 02 May 2017 21:25
by mayyam
On ESPEasy, in button device You have to give idx of realay device in domoticz and check "Send data" chceck box.

Re: Sonoff Touch

Posted: Tuesday 02 May 2017 21:34
by Eddiever
sonoff touch 1.PNG
sonoff touch 1.PNG (6.55 KiB) Viewed 7554 times
esp 1.PNG
esp 1.PNG (9.43 KiB) Viewed 7554 times
Changed it to 3 but still no state change when manually switched

Re: Sonoff Touch

Posted: Tuesday 02 May 2017 21:41
by mayyam
Do You have "Send data" checked?
Also On Config tab: Protocol, Controller IP and Controller Port - do You have right values ?

Re: Sonoff Touch

Posted: Tuesday 02 May 2017 21:47
by Eddiever
Switch 1.PNG
Switch 1.PNG (17.98 KiB) Viewed 7552 times
switch 2.PNG
switch 2.PNG (18.01 KiB) Viewed 7552 times

Re: Sonoff Touch

Posted: Tuesday 02 May 2017 21:49
by mayyam
And the Config tab?

Re: Sonoff Touch

Posted: Tuesday 02 May 2017 21:53
by Eddiever
The config:
config.PNG
config.PNG (22.48 KiB) Viewed 7549 times

Re: Sonoff Touch

Posted: Tuesday 02 May 2017 21:56
by mayyam
If Your Domoticz server is 192.168.1.200, and port is 8080 it looks right to me.

Re: Sonoff Touch

Posted: Tuesday 02 May 2017 22:01
by Eddiever
My server is indeed on 192.168.1.200 and the port is 8080. Thus it is strange :(

8080 is the default port, right?

Re: Sonoff Touch

Posted: Tuesday 02 May 2017 22:08
by mayyam
Right.
I Have no Domoticz password, so my Controller User and Controller Pass fields are empty, but maybe You have to fill them ?

Re: Sonoff Touch

Posted: Tuesday 02 May 2017 22:22
by Eddiever
Oh mayyam, how great (and stupid of me). That is it. Username/password. Darn me.

Thank you so much for your quick reply and help!

Re: Sonoff Touch

Posted: Tuesday 02 May 2017 22:26
by mayyam
:)
Try Rules. With Rules if Wifi will crash, Sonoff Touch will still work. Also, there is no latency when You switch it manually with Rules.

Code: Select all

on button#state do
if [button#state]=1
gpio,12,1
endif
endon

on button#state do
if [button#state]=0
gpio,12,0
endif
endon
I've also that rule:

Code: Select all

on System#Boot do
gpio,12,1
timerSet,1,1
endif
endon

on Rules#Timer=1 do
gpio,12,0
endon
It's for telling me (one second blink) that there is power back if the electric company fu..ed up again.

Re: Sonoff Touch

Posted: Tuesday 02 May 2017 22:31
by Eddiever
I have copied your rules and used them ;)

Great to know Rules in combination with actions if wifi is out. Will dive into that later on.

Re: Sonoff Touch

Posted: Tuesday 02 May 2017 22:33
by mayyam
You can also use the GPIO - 13 on the Wifi Status Led on the Hardware settings.

Re: Sonoff Touch

Posted: Tuesday 02 May 2017 22:37
by Eddiever
Already done that:

Code: Select all

on System#Boot do
gpio,12,1
gpio,13,0
timerSet,1,1
endif
endon

on Rules#Timer=1 do
gpio,12,0
gpio,13,1
endon

on button#state do
if [button#state]=1
gpio,12,1
gpio,13,0
endif
endon

on button#state do
if [button#state]=0
gpio,12,0
gpio,13,1
endif
endon