How can control one GPIO from other ?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
neykov_t
Normal user
Posts: 15
Joined: 21 Jan 2017, 22:10

How can control one GPIO from other ?

#1 Post by neykov_t » 28 Jan 2017, 11:44

Hi, i play with sonoff RF and alredy manage to isntall easy easy, and control it.
Now i want to make some "extras".
As Sonoff have hardware buron connected to GPIO - 0 and relay caonected to GPIO 13, i try somehow to connect this.
Each time when i press buton it have to toggle realay output. Can i wrire some script or something else that can do that for me ?
Eny ideas please ?

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: How can control one GPIO from other ?

#2 Post by toffel969 » 28 Jan 2017, 17:29

Go to Advanced Tab and activate rules. Reboot.

Under Devices make devices as in attached pic
Then under the Rules Tab :

on pushbutton#Switch=0 do
if [Relais#Switch]=1
gpio,12,0
else
gpio,12,1

endif
endon

its on the forum at least 3x, please use search
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

neykov_t
Normal user
Posts: 15
Joined: 21 Jan 2017, 22:10

Re: How can control one GPIO from other ?

#3 Post by neykov_t » 01 Feb 2017, 10:10

Than you. It's work
But i face some strange behavior.
My Esp (i use sonofF RF ) is setup to use Domoticz protocol and send data via MQTT.
If it's connected to the wife, rule work as expected. But if there is no connection, rule work very strange, big delay or even not every time execute. So strange. Any suggestions ?

FranckkyDoo
Normal user
Posts: 21
Joined: 31 Oct 2016, 03:03

Re: How can control one GPIO from other ?

#4 Post by FranckkyDoo » 10 Feb 2017, 20:58

If you don't use connection, go In Config,and replace mqtt protocol by standalone protocol. Because the ESP gonna Keep trying to connect to your mqtt broker. And of course, without wifi connection, it impossible. So try standalone protocol and let me know if is better.

Hope that helpful!!
Doo

neykov_t
Normal user
Posts: 15
Joined: 21 Jan 2017, 22:10

Re: How can control one GPIO from other ?

#5 Post by neykov_t » 02 Mar 2017, 21:19

Hi,
if i switch to standalone protocol , would i have mqtt ?

My issue is that sometimes wifi connection may gone and then devece is ussles. I just need setup, where if wifi is temporary unavaliable , device switch can still operate normally, and when wifi is back,it will reconnect.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 29 guests