Page 2 of 2

Re: Help With Rules

Posted: 12 Sep 2018, 11:02
by potzkiin
yep that was the problem with SW. i change it to active low.

so now sw1 change the status 1 to 0 and so on...

but no relay toggle.

also when i send setRelay01=0 or 1 the relay change status and sw1 stays at previous state without change.
here is the log:

1760467: EVENT: sw1#state=1.00
1760477: ACT : Event,toggleRelay01
1760532: Command: event
1760532: EVENT: toggleRelay01
1760555: ACT : Event,setRelay01=1
1760587: Command: event
1760588: EVENT: setRelay01=1
1760605: ACT : GPIO,0,1
1760607: SW : GPIO 0 Set to 1
1772041: WD : Uptime 30 ConnectFailures 0 FreeMem 19728
1774067: EVENT: sw1#state=0.00
1774076: ACT : Event,toggleRelay01
1774129: Command: event
1774130: EVENT: toggleRelay01
1774153: ACT : Event,setRelay01=1
1774187: Command: event
1774188: EVENT: setRelay01=1
1774205: ACT : GPIO,0,1
1774210: SW : GPIO 0 Set to 1



2124325: EVENT: setRelay01=0
2124342: ACT : GPIO,0,0
2124344: SW : GPIO 0 Set to 0
2132041: WD : Uptime 36 ConnectFailures 0 FreeMem 19728
2134826: EVENT: setRelay01=1
2134843: ACT : GPIO,0,1
2134845: SW : GPIO 0 Set to 1
2134920: SW : Switch state 1 Output value 0
2134923: EVENT: Relay01#state=0.00

Re: Help With Rules

Posted: 12 Sep 2018, 11:24
by grovkillen
You don't really need to care about the switch's state do you? It's only acting as a event trigger. No matter if it change from 1->0 or 0->1

But as for the relay not toggling. What's the GPIO for it, is it 0 or 12?

Re: Help With Rules

Posted: 12 Sep 2018, 11:50
by potzkiin
GPIO 0 is the relay.
gpio 12 is the sw.

for now i don't nee the state of the sw as it will always be as the state of the relay so..i

Re: Help With Rules

Posted: 12 Sep 2018, 12:02
by grovkillen
And sending a GPIO,0,1 or GPIO,0,1 makes the relay turn on/off?

The log is showing me that the rule is working as intended. I'm really at the wits end here.

Re: Help With Rules

Posted: 12 Sep 2018, 12:44
by potzkiin
yes im sending via http://10.0.80.108/control?cmd=GPIO,0,0 or 0,1 and the relay toggle.
also via mqtt command with payload":"event,setRelay01=1/0

Re: Help With Rules

Posted: 12 Sep 2018, 12:53
by grovkillen
potzkiin wrote: 12 Sep 2018, 12:44 yes im sending via http://10.0.80.108/control?cmd=GPIO,0,0 or 0,1 and the relay toggle.
also via mqtt command with payload":"event,setRelay01=1/0
So it's only the "toggleRelay" that is not working, or only semi-working?

Re: Help With Rules

Posted: 12 Sep 2018, 12:54
by grovkillen
grovkillen wrote: 12 Sep 2018, 12:53
potzkiin wrote: 12 Sep 2018, 12:44 yes im sending via http://10.0.80.108/control?cmd=GPIO,0,0 or 0,1 and the relay toggle.
also via mqtt command with payload":"event,setRelay01=1/0
So it's only the "toggleRelay" that is not working, or only semi-working?
Would you mind getting a "webdump" (use my app) and send the zip file to me? I can send you the URL for where to upload the zip if you are willing to let me test it on a unit here.

Re: Help With Rules

Posted: 12 Sep 2018, 13:55
by potzkiin
the relay respond to 1 and 0 with mqtt and http command.
the mqtt event,toggleRelay01,not working.

the SW1 wont toggle the relay.

Re: Help With Rules

Posted: 12 Sep 2018, 14:16
by grovkillen
potzkiin wrote: 12 Sep 2018, 13:55 the relay respond to 1 and 0 with mqtt and http command.
the mqtt event,toggleRelay01,not working.

the SW1 wont toggle the relay.
I cannot do much more for you sir. It's a guessing game right now.

Re: Help With Rules

Posted: 12 Sep 2018, 14:17
by potzkiin
ill send you a PM with the DOWNLOAD link.

Re: Help With Rules

Posted: 14 Sep 2018, 10:15
by grovkillen
Okay, I loaded your settings and you have internal pull-up and inverted logic activated on the relay. Remove those!

Re: Help With Rules

Posted: 17 Sep 2018, 11:07
by potzkiin
Thanks for all the help!!!!!!!!! :)
now it is working great!!!!
here is all the configuration so everyone can use it ...

Code: Select all

on System#Boot do
gpio,0,1 // Prevent relay turning on during boot
endon

On sw1#state Do
Event,toggleRelay01
EndOn

On toggleRelay01 Do
if [Relay01#state]=0
Event,setRelay01=1
else
Event,setRelay01=0
endif
EndOn

On setRelay01 Do
 GPIO,0,%eventvalue%
EndOn