Help With Rules

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
potzkiin
Normal user
Posts: 28
Joined: 04 Sep 2018, 09:15

Re: Help With Rules

#51 Post by potzkiin » 12 Sep 2018, 11:02

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

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Help With Rules

#52 Post by grovkillen » 12 Sep 2018, 11:24

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?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

potzkiin
Normal user
Posts: 28
Joined: 04 Sep 2018, 09:15

Re: Help With Rules

#53 Post by potzkiin » 12 Sep 2018, 11:50

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

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Help With Rules

#54 Post by grovkillen » 12 Sep 2018, 12:02

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.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

potzkiin
Normal user
Posts: 28
Joined: 04 Sep 2018, 09:15

Re: Help With Rules

#55 Post by potzkiin » 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

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Help With Rules

#56 Post by grovkillen » 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?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Help With Rules

#57 Post by grovkillen » 12 Sep 2018, 12:54

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.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

potzkiin
Normal user
Posts: 28
Joined: 04 Sep 2018, 09:15

Re: Help With Rules

#58 Post by potzkiin » 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.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Help With Rules

#59 Post by grovkillen » 12 Sep 2018, 14:16

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.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

potzkiin
Normal user
Posts: 28
Joined: 04 Sep 2018, 09:15

Re: Help With Rules

#60 Post by potzkiin » 12 Sep 2018, 14:17

ill send you a PM with the DOWNLOAD link.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Help With Rules

#61 Post by grovkillen » 14 Sep 2018, 10:15

Okay, I loaded your settings and you have internal pull-up and inverted logic activated on the relay. Remove those!
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

potzkiin
Normal user
Posts: 28
Joined: 04 Sep 2018, 09:15

Re: Help With Rules

#62 Post by potzkiin » 17 Sep 2018, 11:07

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
Attachments
sw1.jpg
sw1.jpg (85.15 KiB) Viewed 5566 times
mqtt.jpg
mqtt.jpg (33.5 KiB) Viewed 5568 times
relay01.jpg
relay01.jpg (83.27 KiB) Viewed 5568 times
sw1.jpg
sw1.jpg (85.15 KiB) Viewed 5568 times
devices
devices
devices.jpg (62.34 KiB) Viewed 5569 times

Post Reply

Who is online

Users browsing this forum: No registered users and 24 guests