Page 1 of 1

Sonoff + wall manual switch

Posted: 06 Mar 2017, 09:29
by vojtishek
Hi everyone,

I saw video when was introduced ability to on/off sonoff with manual switch connected to gpio14 and GND.
I was not succesfull on espeasy flashed sonoff.

Do you have any experience with that?

Goal is to implement sonoff next to wall switch to be able to control it from domoticz as well as change state via manual switch.

Thanks
Vojta

Re: Sonoff + wall manual switch

Posted: 25 Mar 2017, 14:02
by vojtishek
I´ve was able to use gpio14 for it but over the wifi and there is delay of course.

Could you please advise how to put script inside espeasy firmware to switch on/off light via manual switch with immediate reaction?

Your help much appreciated.

Thank you
Vojta

Re: Sonoff + wall manual switch

Posted: 25 Mar 2017, 21:47
by Mr Moose
Hello,

I have the same function in my ESP12. Try this:

A new Device:
Device: Switch Input
Name: Input
1st GPIO: GPIO 14
Pullup: X
Inverted: X
Switch Type: Switch
Switch Button Type: Push Button Active Low
Value Name 1: Pushbutton

Rules:
on Input#Pushbutton do
if [Input#Pushbutton]=1
event switchon
else
event switchoff
endif
endon

on switchon do
gpio 12,1
endon

on switchoff do
gpio 12,0
endon

Re: Sonoff + wall manual switch

Posted: 25 Mar 2017, 22:12
by vojtishek
Mr Moose wrote: 25 Mar 2017, 21:47 Hello,

I have the same function in my ESP12. Try this:

A new Device:
Device: Switch Input
Name: Input
1st GPIO: GPIO 14
Pullup: X
Inverted: X
Switch Type: Switch
Switch Button Type: Push Button Active Low
Value Name 1: Pushbutton

Rules:
on Input#Pushbutton do
if [Input#Pushbutton]=1
event switchon
else
event switchoff
endif
endon

on switchon do
gpio 12,1
endon

on switchoff do
gpio 12,0
endon
Thanks a lot, I will try and let you know.

Re: Sonoff + wall manual switch

Posted: 26 Mar 2017, 01:20
by paxi
If you use a standard wall switch configure "switch button" type to "normal switch". Just to be safe wire a 1k resistor in series with the switch.