Help With Rules
Moderators: grovkillen, Stuntteam, TD-er
Help With Rules
hello,
im trying to setup a physical SW with Relay and Mqtt.
so far i managed to control relay via the switch
the problem is when i controlling via mqtt the sw status remain as it was before and it need 2 pulses to sync to the current status and toggle the relay..
this is the rule im using:
on System#Boot do
gpio,0,1 // Prevent relay turning on during boot
endon
on sw1#sw1 do
if [sw1#sw1]=0
gpio,0,1
gpio,16,1
else
gpio,0,0
gpio,16,0
endif
endon
if anyone can helo make the rule better so the mqtt command will sync the button to correct status as well?
im trying to setup a physical SW with Relay and Mqtt.
so far i managed to control relay via the switch
the problem is when i controlling via mqtt the sw status remain as it was before and it need 2 pulses to sync to the current status and toggle the relay..
this is the rule im using:
on System#Boot do
gpio,0,1 // Prevent relay turning on during boot
endon
on sw1#sw1 do
if [sw1#sw1]=0
gpio,0,1
gpio,16,1
else
gpio,0,0
gpio,16,0
endif
endon
if anyone can helo make the rule better so the mqtt command will sync the button to correct status as well?
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
Code: Select all
on System#Boot do
gpio,0,1 // Prevent relay turning on during boot
endon
on sw1#sw1 do
Event,toggleSwitch
endon
On toggleSwitch Do
if [sw1#sw1]=0
gpio,0,1
gpio,16,1
else
gpio,0,0
gpio,16,0
endif
EndOn
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Help With Rules
im using
"payload": "GPIO,0,1 or 0",
"topic": "/test/cmd"
that's controlling the relay...but button get out of sync....
"payload": "GPIO,0,1 or 0",
"topic": "/test/cmd"
that's controlling the relay...but button get out of sync....
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
So use my example? That is what making it stay in sync, by letting the unit itself handle the state. Thus the event name "toggle" switch.
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Help With Rules
yes i try it and i got the same results..
Re: Help With Rules
as i understand i need some rule to listen to my mqtt command an execute the switch mode according to the mqtt topic...
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
Please be more informative. The rule I posted should work but you may please post your entire setup since I don't know what gpio 0 is doing for example. And what is the exact topic and payload you're sending? What is the unit name etc etc.
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Help With Rules
rule:
on System#Boot do
gpio,0,1 // Prevent relay turning on during boot
endon
on sw1#sw1 do
Event,toggleSwitch
endon
On toggleSwitch Do
if [sw1#sw1]=0
gpio,0,1
gpio,16,1
else
gpio,0,0
gpio,16,0
endif
EndOn



i don't want to use switch toggle in mqtt.. as i want to be able to use mqtt set 1 or 0 or on or off.
on System#Boot do
gpio,0,1 // Prevent relay turning on during boot
endon
on sw1#sw1 do
Event,toggleSwitch
endon
On toggleSwitch Do
if [sw1#sw1]=0
gpio,0,1
gpio,16,1
else
gpio,0,0
gpio,16,0
endif
EndOn



i don't want to use switch toggle in mqtt.. as i want to be able to use mqtt set 1 or 0 or on or off.
- Attachments
-
- Hardware.jpg (53.4 KiB) Viewed 23250 times
-
- Devices.jpg (38.91 KiB) Viewed 23250 times
-
- Config.jpg (80.24 KiB) Viewed 23262 times
Last edited by potzkiin on 04 Sep 2018, 13:46, edited 1 time in total.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
If you want to be able to set given 1 or 0 I suggest you use event values for that and tweak my rules to work with them. See wiki please.
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
Because then you can set
GPIO,16,%eventvalue%
GPIO,16,%eventvalue%
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Help With Rules
if you can help me with the rule? im pretty new to this..
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
First of all. I suggest you only monitor the GPIO state of the relay by assigning it to a "Generic Switch" task. Then you can act upon the switch being pressed and if the relay switch is 0 then it will turn to 1 if you use the toggleSwitch example I suggested.
If you want to also be able to turn the relay on or off specifically you can use another event called setSwitch and pass along a 1 or a 0. You will find this if you study the wiki.
If you want to also be able to turn the relay on or off specifically you can use another event called setSwitch and pass along a 1 or a 0. You will find this if you study the wiki.
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Help With Rules
went trough the wiki for days..can find a solution.
i found not only me struggling with this issue over the net..
i found not only me struggling with this issue over the net..
Re: Help With Rules
can i do something like this?
wherever the relay togle the input SW change also?
on Relay01#Relay01 do
if [Relay01#Relay01]=0
gpio,12,0
elese
gpio,12,1
endif
endon
i really dont know how to do what you suggested.
wherever the relay togle the input SW change also?
on Relay01#Relay01 do
if [Relay01#Relay01]=0
gpio,12,0
elese
gpio,12,1
endif
endon
i really dont know how to do what you suggested.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
You should try this then.
I suggest you rename the value name to something like "State" since it's bad practice to use the same name for task name and value name.
By using this you can use topic /test/cmd (or whatever your MQTT controller settings are) and send one of three different payloads:
Code: Select all
On Switch01#State Do
Event,toggleRelay
EndOn
On toggleRelay Do
if [Relay01#State]=0
event,setRelay,1
else
event,setRelay,0
endif
EndOn
On setRelay Do
GPIO,12,%eventvalue%
EndOn
By using this you can use topic /test/cmd (or whatever your MQTT controller settings are) and send one of three different payloads:
Code: Select all
event,toggleRelay
event,setRelay,1
event,setRelay,0
Last edited by grovkillen on 04 Sep 2018, 17:34, edited 1 time in total.
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Help With Rules
First Thnaks for all your effort to help is much appreciated!
i changed the value to "State" as you suggested
also the rule to fit my names...but i guessing i did something wrong because there is no switch action or mqtt action with event,toggeleRelay01
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
elese
event,setRelay01,0
endif
EndOn
On setRelay01 Do
GPIO,12,%eventvalue%
EndOn
i changed the value to "State" as you suggested
also the rule to fit my names...but i guessing i did something wrong because there is no switch action or mqtt action with event,toggeleRelay01
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
elese
event,setRelay01,0
endif
EndOn
On setRelay01 Do
GPIO,12,%eventvalue%
EndOn
- Attachments
-
- state.jpg (40.43 KiB) Viewed 23389 times
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
Code: Select all
toggeleRelay01
I also see that I misspelled "else" with "elese". I have updated the previous post 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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Help With Rules
Please note that not all GPIO pins are behaving the same.
GPIO0 and 16 are 'special ones'.
- GPIO 0-15 all have a built-in pull-up resistor, just like in an Arduino. GPIO16 has a built-in pull-down resistor.
- GPIO15 is always pulled low, so you can’t use the internal pull-up resistor. You have to keep this in mind when using GPIO15 as an input to read a switch or connect it to a device with an open-collector (or open-drain) output, like I²C.
- GPIO0 is pulled high during normal operation, so you can’t use it as a Hi-Z input.
- GPIO2 can’t be low at boot, so you can’t connect a switch to it.
GPIO0 and 16 are 'special ones'.
- GPIO 0-15 all have a built-in pull-up resistor, just like in an Arduino. GPIO16 has a built-in pull-down resistor.
- GPIO15 is always pulled low, so you can’t use the internal pull-up resistor. You have to keep this in mind when using GPIO15 as an input to read a switch or connect it to a device with an open-collector (or open-drain) output, like I²C.
- GPIO0 is pulled high during normal operation, so you can’t use it as a Hi-Z input.
- GPIO2 can’t be low at boot, so you can’t connect a switch to it.
Re: Help With Rules
Thanks for the info!TD-er wrote: ↑04 Sep 2018, 20:28 Please note that not all GPIO pins are behaving the same.
GPIO0 and 16 are 'special ones'.
- GPIO 0-15 all have a built-in pull-up resistor, just like in an Arduino. GPIO16 has a built-in pull-down resistor.
- GPIO15 is always pulled low, so you can’t use the internal pull-up resistor. You have to keep this in mind when using GPIO15 as an input to read a switch or connect it to a device with an open-collector (or open-drain) output, like I²C.
- GPIO0 is pulled high during normal operation, so you can’t use it as a Hi-Z input.
- GPIO2 can’t be low at boot, so you can’t connect a switch to it.
Re: Help With Rules
on System#Boot dogrovkillen wrote: ↑04 Sep 2018, 17:21Check spelling.Code: Select all
toggeleRelay01
I also see that I misspelled "else" with "elese". I have updated the previous post now.
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,12,%eventvalue%
EndOn
i attached the log, i can see the commands but no relay toggle.
- Attachments
-
- log.jpg (46.37 KiB) Viewed 23334 times
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
Sorry, totally my fault. I'm writing these messages on my phone in the forest of northern Sweden (hunting moose).
Correct syntax for event value is it use "="
And commands over MQTT should be these:
Correct syntax for event value is it use "="
Code: Select all
On Switch01#State Do
Event,toggleRelay
EndOn
On toggleRelay Do
if [Relay01#State]=0
event,setRelay=1
else
event,setRelay=0
endif
EndOn
On setRelay Do
GPIO,12,%eventvalue%
EndOn
Code: Select all
event,toggleRelay
event,setRelay=1
event,setRelay=0
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Help With Rules
your activity on the woods sound like so much fun
....in my place it is not allowed,
any way...
when i call the mqtt with event,setRelay01=1 i can see the rule respond but no relay toggle and also there is no switch action.(even no mqtt topic when pressing on the sw1)
this is my rule:
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,12,%eventvalue%
EndOn

any way...
when i call the mqtt with event,setRelay01=1 i can see the rule respond but no relay toggle and also there is no switch action.(even no mqtt topic when pressing on the sw1)
this is my rule:
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,12,%eventvalue%
EndOn
- Attachments
-
- log.jpg (58.81 KiB) Viewed 23578 times
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
It looks like the rules I provided are working as they should. But you now suggest that you want a switch press to send a MQTT message as well, news to me. You do that with the publish command and you can place that in the sw1#State event.
Regarding the relay not responding, are you sure it's connected to GPIO 12? And is the relay01 task correctly configured with name and GPIO?
Regarding the relay not responding, are you sure it's connected to GPIO 12? And is the relay01 task correctly configured with name and GPIO?
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
I see now that your running ancient version R147. The code I provide are for later releases. Sorry! Dude, we really need a better forum that can snatch the info from the unit so we don't do mistakes like this.
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Help With Rules
What stable version do you suggest?
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
Latest nightly https://github.com/letscontrolit/ESPEasy/releases
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
But you should always test on a none production unit, so everything is working all right before you start using it for real
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Help With Rules
Thanks! Will upload tommorow:-)
Re: Help With Rules
Hi again.
i updated the version. to Release mega-20180904
but got the same problem.
1.the SW1 won't toggle the relay.(i cant see any log for switch press either..)
its seems that this rule:
"On setRelay01 Do
GPIO,12,%eventvalue%
EndOn"
when setting it to GPIO 12 where the switch is connected it making the value constant 1 or 0 and make it ignoring the actual input of the switch.
if i remove the GPIO12 from this rule the sw will respond to switch press. but relay wont toggle.
2.mqtt command event,setRelay01=1 change the status of SW1 but wont toggle the relay.
i updated the version. to Release mega-20180904
but got the same problem.
1.the SW1 won't toggle the relay.(i cant see any log for switch press either..)
its seems that this rule:
"On setRelay01 Do
GPIO,12,%eventvalue%
EndOn"
when setting it to GPIO 12 where the switch is connected it making the value constant 1 or 0 and make it ignoring the actual input of the switch.
if i remove the GPIO12 from this rule the sw will respond to switch press. but relay wont toggle.
2.mqtt command event,setRelay01=1 change the status of SW1 but wont toggle the relay.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
The fact that the MQTT command is setting the switch state and not the relay suggest to me that the GPIO is mixed up.
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Help With Rules
Hi,
i uploaded the devices and rule.
gpio 12 is the switch input
gpio 0 is the relay..
i uploaded the devices and rule.
gpio 12 is the switch input
gpio 0 is the relay..
- Attachments
-
- Devices.jpg (115.23 KiB) Viewed 23743 times
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
Then you need to use GPIO,0,%eventvalue% not 12. But remember that GPIO 0 will be high on boot. This will cause the relay to trigger if the unit reboots.
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Help With Rules
Im using this rule:
on System#Boot do
gpio,0,1 // Prevent relay turning on during boot
endon
on System#Boot do
gpio,0,1 // Prevent relay turning on during boot
endon
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
Yes but setting the switch to 1 or 0 doesn't make any sense. The switch is only used to get human interaction. The setRelay event should thus be used to set the GPIO-0 to 1 (or 0).
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Help With Rules
Sorry..but i cant understand...im setting a start point when boot and calling gpio 0 (the relay) to start point of 1or0 of the relay .Im setting the relay not the switch.
Im confused..
Im confused..
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
Just try to change this part
To this
Code: Select all
On setRelay Do
GPIO,12,%eventvalue%
EndOn
Code: Select all
On setRelay Do
GPIO,0,%eventvalue%
EndOn
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Help With Rules
Everlasting questions about rules... Perhaps somebody can have a look on this:
MQTT import shows switching of state, the log reports Vent01auf= 1 or 0, but no action on ports or MQTT-publishing happens. Where is my mistake?
Code: Select all
on Water#state do
event, Vent01auf=%eventvalue%
endon
on Vent01auf=1 do
Pulse,16,1,100
Pulse,12,1,50
Pulse,13,0,50 //start watering (open Vent1)
Publish aussen/state/WM/Garten01/Water/Vent1,1
timerSet,1,300 //timer 1 set for 5 minutes
endon
on Vent01auf=0 do
timerSet,1,0 //timer1 set to halt
Pulse,16,1,100
Pulse,12,0,50
Pulse,13,1,50 //stop watering (close Vent1)
Publish aussen/state/WM/Garten01/Water/Vent1,0
endon
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
Your not really sending any eventvalue in this part:werner_g wrote: ↑10 Sep 2018, 12:45 Everlasting questions about rules... Perhaps somebody can have a look on this:
MQTT import shows switching of state, the log reports Vent01auf= 1 or 0, but no action on ports or MQTT-publishing happens. Where is my mistake?Code: Select all
on Water#state do event, Vent01auf=%eventvalue% endon on Vent01auf=1 do Pulse,16,1,100 Pulse,12,1,50 Pulse,13,0,50 //start watering (open Vent1) Publish aussen/state/WM/Garten01/Water/Vent1,1 timerSet,1,300 //timer 1 set for 5 minutes endon on Vent01auf=0 do timerSet,1,0 //timer1 set to halt Pulse,16,1,100 Pulse,12,0,50 Pulse,13,1,50 //stop watering (close Vent1) Publish aussen/state/WM/Garten01/Water/Vent1,0 endon
Code: Select all
on Water#state do
event, Vent01auf=%eventvalue%
endon
Code: Select all
on Water#state do
event, Vent01auf=[Water#state]
endon
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Help With Rules
Thanks for your input, grovkillen, but this little rule-modification brings my ESP to stop operation. Something is really wrong with your (and of course my) code! Please have a look again.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
What version did you use? And you cannot use events like this on Vent01auf=1 do
You probably need to use a dummy device and assign the event value to that one and then do a if statement to see what to do.
But it would certainly be a nice way of doing case statements possible.
You probably need to use a dummy device and assign the event value to that one and then do a if statement to see what to do.
But it would certainly be a nice way of doing case statements possible.
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
You could try:
on Vent01auf=1.00 do
&
on Vent01auf=0.00 do
on Vent01auf=1.00 do
&
on Vent01auf=0.00 do
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Help With Rules
Hi grovkillen, I am using mega-20180625 and have a dozend ESP's running with that. I just wanted to have an event (gpio12, gpio13 and publish) available for using it in different dependencies (SW-switch, HW-switch, sensor-values etc.). To write a code case by case run's OK, but soon I oversize 2048 chars. It sounds too complicated for me to arrange a dummy device.
Oh, I've just see you latest input. Thanks, I will try this the other day.
Oh, I've just see you latest input. Thanks, I will try this the other day.
Re: Help With Rules
Vent01auf=1.00 or Vent01auf=0.00: this are my events I want to use.
Re: Help With Rules
hi again...
i change the rules as you suggested but there are more issues,
- if i manually change the relay with the command /control?cmd=GPIO,0,1
AND then toggle sw1, the relay toggles. but only once(additional sw1 press is doing nothing).
- Also if i send payload: event,toggleRelay01 it only changes once to 0 from 1. and another event wont change the relay state.
- mqtt setRelay01/0 or 1 wont toggle the relay.
Logging: Info (2)
465812041: WD : Uptime 7764 ConnectFailures 2 FreeMem 19656
465837752: EVENT: toggleRelay01
465837779: ACT : Event,setRelay01=0
465837803: Command: event
465837803: EVENT: setRelay01=0
465837821: ACT : GPIO,0,0
465837823: SW : GPIO 0 Set to 0
465842041: WD : Uptime 7764 ConnectFailures 2 FreeMem 19656
465872041: WD : Uptime 7765 ConnectFailures 2 FreeMem 19728
465892175: EVENT: sw1#state=1.00
465892184: ACT : Event,toggleRelay01
465892241: Command: event
465892242: EVENT: toggleRelay01
465892270: ACT : Event,setRelay01=0
465892303: Command: event
465892303: EVENT: setRelay01=0
465892321: ACT : GPIO,0,0
465892323: SW : GPIO 0 Set to 0
465902041: WD : Uptime 7765 ConnectFailures 2 FreeMem 18832
465921973: SW : Switch state 0 Output value 0
465921975: EVENT: sw1#state=0.00
465921985: ACT : Event,toggleRelay01
465922039: Command: event
465922040: EVENT: toggleRelay01
465922068: ACT : Event,setRelay01=0
465922096: SW : Switch state 1 Output value 1
465922099: EVENT: sw1#state=1.00
465922109: ACT : Event,toggleRelay01
465922221: ACT : GPIO,0,0
465922223: SW : GPIO 0 Set to 0
465922228: Command: event
465922229: EVENT: toggleRelay01
465922254: ACT : Event,setRelay01=0
465922286: Command: event
465922287: EVENT: setRelay01=0
465922304: ACT : GPIO,0,0
465922306: SW : GPIO 0 Set to 0
465932041: WD : Uptime 7766 ConnectFailures 2 FreeMem 19728
465935298: SW : GPIO 0 Set to 0
465939671: SW : GPIO 0 Set to 1
465939678: SW : Switch state 1 Output value 0
465939683: EVENT: Relay01#status=0.00
465953978: EVENT: sw1#state=1.00
465953987: ACT : Event,toggleRelay01
465954044: Command: event
465954045: EVENT: toggleRelay01
465954072: ACT : Event,setRelay01=0
465954105: Command: event
465954105: EVENT: setRelay01=0
465954123: ACT : GPIO,0,0
465954125: SW : GPIO 0 Set to 0
465956475: EVENT: sw1#state=1.00
465956485: ACT : Event,toggleRelay01
465956540: Command: event
465956541: EVENT: toggleRelay01
465956570: ACT : Event,setRelay01=0
465956601: Command: event
465956602: EVENT: setRelay01=0
465956620: ACT : GPIO,0,0
465956622: SW : GPIO 0 Set to 0
465957975: EVENT: sw1#state=1.00
465957985: ACT : Event,toggleRelay01
465958044: Command: event
465958044: EVENT: toggleRelay01
465958070: ACT : Event,setRelay01=0
465958097: Command: event
465958098: EVENT: setRelay01=0
465958116: ACT : GPIO,0,0
465958118: SW : GPIO 0 Set to 0
465959042: EVENT: toggleRelay01
465959069: ACT : Event,setRelay01=0
465959098: Command: event
465959099: EVENT: setRelay01=0
465959117: ACT : GPIO,0,0
465959120: SW : GPIO 0 Set to 0
465959173: SW : Switch state 1 Output value 1
465959175: EVENT: sw1#state=1.00
465959184: ACT : Event,toggleRelay01
465960173: SW : Switch state 1 Output value 1
465960175: EVENT: sw1#state=1.00
465960184: ACT : Event,toggleRelay01
465960239: Command: event
465960239: EVENT: toggleRelay01
465960268: ACT : Event,setRelay01=0
465960293: SW : Switch state 0 Output value 0
465960295: EVENT: sw1#state=0.00
465960305: ACT : Event,toggleRelay01
465961321: Command: event
465961322: EVENT: toggleRelay01
465961349: ACT : Event,setRelay01=0
465961382: Command: event
465961383: EVENT: toggleRelay01
465961411: ACT : Event,setRelay01=0
465961438: Command: event
465961439: EVENT: toggleRelay01
465961468: ACT : Event,setRelay01=0
465961985: SW : GPIO 0 Set to 0
465961999: Command: event
465962000: EVENT: toggleRelay01
465962025: ACT : Event,setRelay01=0
465962048: WD : Uptime 7766 ConnectFailures 2 FreeMem 19088
465962049: Command: event
465962050: EVENT: setRelay01=0
465962067: ACT : GPIO,0,0
465962069: SW : GPIO 0 Set to 0
465971855: SW : GPIO 0 Set to 1
465971873: SW : Switch state 1 Output value 0
465971878: EVENT: Relay01#status=0.00
465973935: SW : Switch state 0 Output value 1
465973939: EVENT: Relay01#status=1.00
465973996: Command: event
465973997: EVENT: toggleRelay01
465974025: ACT : Event,setRelay01=0
465974050: Command: event
465974050: EVENT: setRelay01=0
465974068: ACT : GPIO,0,0
465974072: SW : GPIO 0 Set to 0
465977941: SW : GPIO 0 Set to 0
465985990: EVENT: sw1#state=1.00
465985999: ACT : Event,toggleRelay01
465986055: Command: event
465986056: EVENT: toggleRelay01
465986083: ACT : Event,setRelay01=0
465986111: Command: event
465986112: EVENT: setRelay01=0
465986129: ACT : GPIO,0,0
465986131: SW : GPIO 0 Set to 0
465990197: EVENT: sw1#state=1.00
465990206: ACT : Event,toggleRelay01
465990262: Command: event
465990262: EVENT: toggleRelay01
465990290: ACT : Event,setRelay01=0
465990323: Command: event
465990324: EVENT: setRelay01=0
465990342: ACT : GPIO,0,0
465990344: SW : GPIO 0 Set to 0
465992041: WD : Uptime 7767 ConnectFailures 2 FreeMem 18160
465996965: SW : GPIO 0 Set to 1
465996995: SW : Switch state 1 Output value 0
465996998: EVENT: Relay01#status=0.00
466002100: EVENT: sw1#state=1.00
466002109: ACT : Event,toggleRelay01
466002165: Command: event
466002166: EVENT: toggleRelay01
466002194: ACT : Event,setRelay01=0
466002227: Command: event
466002228: EVENT: setRelay01=0
466002246: ACT : GPIO,0,0
466002249: SW : GPIO 0 Set to 0
466012829: EVENT: sw1#state=1.00
466012838: ACT : Event,toggleRelay01
466012894: Command: event
466012895: EVENT: toggleRelay01
466012923: ACT : Event,setRelay01=0
466012954: Command: event
466012954: EVENT: setRelay01=0
466012972: ACT : GPIO,0,0
466012975: SW : GPIO 0 Set to 0
466013929: EVENT: sw1#state=1.00
466013938: ACT : Event,toggleRelay01
466013992: Command: event
466013993: EVENT: toggleRelay01
466014022: ACT : Event,setRelay01=0
466014053: Command: event
466014053: EVENT: setRelay01=0
466014071: ACT : GPIO,0,0
466014073: SW : GPIO 0 Set to 0
466014829: EVENT: sw1#state=0.00
466014839: ACT : Event,toggleRelay01
466014894: Command: event
466014895: EVENT: toggleRelay01
466014921: ACT : Event,setRelay01=0
466014954: Command: event
466014955: EVENT: setRelay01=0
466014973: ACT : GPIO,0,0
466014975: SW : GPIO 0 Set to 0
466016229: EVENT: sw1#state=1.00
466016239: ACT : Event,toggleRelay01
466016295: Command: event
466016296: EVENT: toggleRelay01
466016324: ACT : Event,setRelay01=0
466016356: Command: event
466016357: EVENT: setRelay01=0
466016375: ACT : GPIO,0,0
466016378: SW : GPIO 0 Set to 0
466022043: WD : Uptime 7767 ConnectFailures 2 FreeMem 19728
466052043: WD : Uptime 7768 ConnectFailures 2 FreeMem 19728
466082043: WD : Uptime 7768 ConnectFailures 2 FreeMem 19728
466089033: SW : GPIO 0 Set to 1
466089041: SW : Switch state 1 Output value 0
466089044: EVENT: Relay01#status=0.00
466100643: EVENT: toggleRelay01
466100668: ACT : Event,setRelay01=0
466100690: Command: event
466100691: EVENT: setRelay01=0
466100708: ACT : GPIO,0,0
466100710: SW : GPIO 0 Set to 0
466100738: SW : Switch state 0 Output value 1
466100741: EVENT: Relay01#status=1.00
466103704: EVENT: setRelay01=0
466103721: ACT : GPIO,0,0
466103723: SW : GPIO 0 Set to 0
466104643: EVENT: toggleRelay01
466104667: ACT : Event,setRelay01=0
466104692: Command: event
466104693: EVENT: setRelay01=0
466104710: ACT : GPIO,0,0
466104712: SW : GPIO 0 Set to 0
466112043: WD : Uptime 7769 ConnectFailures 2 FreeMem 19728
i change the rules as you suggested but there are more issues,
- if i manually change the relay with the command /control?cmd=GPIO,0,1
AND then toggle sw1, the relay toggles. but only once(additional sw1 press is doing nothing).
- Also if i send payload: event,toggleRelay01 it only changes once to 0 from 1. and another event wont change the relay state.
- mqtt setRelay01/0 or 1 wont toggle the relay.
Logging: Info (2)
465812041: WD : Uptime 7764 ConnectFailures 2 FreeMem 19656
465837752: EVENT: toggleRelay01
465837779: ACT : Event,setRelay01=0
465837803: Command: event
465837803: EVENT: setRelay01=0
465837821: ACT : GPIO,0,0
465837823: SW : GPIO 0 Set to 0
465842041: WD : Uptime 7764 ConnectFailures 2 FreeMem 19656
465872041: WD : Uptime 7765 ConnectFailures 2 FreeMem 19728
465892175: EVENT: sw1#state=1.00
465892184: ACT : Event,toggleRelay01
465892241: Command: event
465892242: EVENT: toggleRelay01
465892270: ACT : Event,setRelay01=0
465892303: Command: event
465892303: EVENT: setRelay01=0
465892321: ACT : GPIO,0,0
465892323: SW : GPIO 0 Set to 0
465902041: WD : Uptime 7765 ConnectFailures 2 FreeMem 18832
465921973: SW : Switch state 0 Output value 0
465921975: EVENT: sw1#state=0.00
465921985: ACT : Event,toggleRelay01
465922039: Command: event
465922040: EVENT: toggleRelay01
465922068: ACT : Event,setRelay01=0
465922096: SW : Switch state 1 Output value 1
465922099: EVENT: sw1#state=1.00
465922109: ACT : Event,toggleRelay01
465922221: ACT : GPIO,0,0
465922223: SW : GPIO 0 Set to 0
465922228: Command: event
465922229: EVENT: toggleRelay01
465922254: ACT : Event,setRelay01=0
465922286: Command: event
465922287: EVENT: setRelay01=0
465922304: ACT : GPIO,0,0
465922306: SW : GPIO 0 Set to 0
465932041: WD : Uptime 7766 ConnectFailures 2 FreeMem 19728
465935298: SW : GPIO 0 Set to 0
465939671: SW : GPIO 0 Set to 1
465939678: SW : Switch state 1 Output value 0
465939683: EVENT: Relay01#status=0.00
465953978: EVENT: sw1#state=1.00
465953987: ACT : Event,toggleRelay01
465954044: Command: event
465954045: EVENT: toggleRelay01
465954072: ACT : Event,setRelay01=0
465954105: Command: event
465954105: EVENT: setRelay01=0
465954123: ACT : GPIO,0,0
465954125: SW : GPIO 0 Set to 0
465956475: EVENT: sw1#state=1.00
465956485: ACT : Event,toggleRelay01
465956540: Command: event
465956541: EVENT: toggleRelay01
465956570: ACT : Event,setRelay01=0
465956601: Command: event
465956602: EVENT: setRelay01=0
465956620: ACT : GPIO,0,0
465956622: SW : GPIO 0 Set to 0
465957975: EVENT: sw1#state=1.00
465957985: ACT : Event,toggleRelay01
465958044: Command: event
465958044: EVENT: toggleRelay01
465958070: ACT : Event,setRelay01=0
465958097: Command: event
465958098: EVENT: setRelay01=0
465958116: ACT : GPIO,0,0
465958118: SW : GPIO 0 Set to 0
465959042: EVENT: toggleRelay01
465959069: ACT : Event,setRelay01=0
465959098: Command: event
465959099: EVENT: setRelay01=0
465959117: ACT : GPIO,0,0
465959120: SW : GPIO 0 Set to 0
465959173: SW : Switch state 1 Output value 1
465959175: EVENT: sw1#state=1.00
465959184: ACT : Event,toggleRelay01
465960173: SW : Switch state 1 Output value 1
465960175: EVENT: sw1#state=1.00
465960184: ACT : Event,toggleRelay01
465960239: Command: event
465960239: EVENT: toggleRelay01
465960268: ACT : Event,setRelay01=0
465960293: SW : Switch state 0 Output value 0
465960295: EVENT: sw1#state=0.00
465960305: ACT : Event,toggleRelay01
465961321: Command: event
465961322: EVENT: toggleRelay01
465961349: ACT : Event,setRelay01=0
465961382: Command: event
465961383: EVENT: toggleRelay01
465961411: ACT : Event,setRelay01=0
465961438: Command: event
465961439: EVENT: toggleRelay01
465961468: ACT : Event,setRelay01=0
465961985: SW : GPIO 0 Set to 0
465961999: Command: event
465962000: EVENT: toggleRelay01
465962025: ACT : Event,setRelay01=0
465962048: WD : Uptime 7766 ConnectFailures 2 FreeMem 19088
465962049: Command: event
465962050: EVENT: setRelay01=0
465962067: ACT : GPIO,0,0
465962069: SW : GPIO 0 Set to 0
465971855: SW : GPIO 0 Set to 1
465971873: SW : Switch state 1 Output value 0
465971878: EVENT: Relay01#status=0.00
465973935: SW : Switch state 0 Output value 1
465973939: EVENT: Relay01#status=1.00
465973996: Command: event
465973997: EVENT: toggleRelay01
465974025: ACT : Event,setRelay01=0
465974050: Command: event
465974050: EVENT: setRelay01=0
465974068: ACT : GPIO,0,0
465974072: SW : GPIO 0 Set to 0
465977941: SW : GPIO 0 Set to 0
465985990: EVENT: sw1#state=1.00
465985999: ACT : Event,toggleRelay01
465986055: Command: event
465986056: EVENT: toggleRelay01
465986083: ACT : Event,setRelay01=0
465986111: Command: event
465986112: EVENT: setRelay01=0
465986129: ACT : GPIO,0,0
465986131: SW : GPIO 0 Set to 0
465990197: EVENT: sw1#state=1.00
465990206: ACT : Event,toggleRelay01
465990262: Command: event
465990262: EVENT: toggleRelay01
465990290: ACT : Event,setRelay01=0
465990323: Command: event
465990324: EVENT: setRelay01=0
465990342: ACT : GPIO,0,0
465990344: SW : GPIO 0 Set to 0
465992041: WD : Uptime 7767 ConnectFailures 2 FreeMem 18160
465996965: SW : GPIO 0 Set to 1
465996995: SW : Switch state 1 Output value 0
465996998: EVENT: Relay01#status=0.00
466002100: EVENT: sw1#state=1.00
466002109: ACT : Event,toggleRelay01
466002165: Command: event
466002166: EVENT: toggleRelay01
466002194: ACT : Event,setRelay01=0
466002227: Command: event
466002228: EVENT: setRelay01=0
466002246: ACT : GPIO,0,0
466002249: SW : GPIO 0 Set to 0
466012829: EVENT: sw1#state=1.00
466012838: ACT : Event,toggleRelay01
466012894: Command: event
466012895: EVENT: toggleRelay01
466012923: ACT : Event,setRelay01=0
466012954: Command: event
466012954: EVENT: setRelay01=0
466012972: ACT : GPIO,0,0
466012975: SW : GPIO 0 Set to 0
466013929: EVENT: sw1#state=1.00
466013938: ACT : Event,toggleRelay01
466013992: Command: event
466013993: EVENT: toggleRelay01
466014022: ACT : Event,setRelay01=0
466014053: Command: event
466014053: EVENT: setRelay01=0
466014071: ACT : GPIO,0,0
466014073: SW : GPIO 0 Set to 0
466014829: EVENT: sw1#state=0.00
466014839: ACT : Event,toggleRelay01
466014894: Command: event
466014895: EVENT: toggleRelay01
466014921: ACT : Event,setRelay01=0
466014954: Command: event
466014955: EVENT: setRelay01=0
466014973: ACT : GPIO,0,0
466014975: SW : GPIO 0 Set to 0
466016229: EVENT: sw1#state=1.00
466016239: ACT : Event,toggleRelay01
466016295: Command: event
466016296: EVENT: toggleRelay01
466016324: ACT : Event,setRelay01=0
466016356: Command: event
466016357: EVENT: setRelay01=0
466016375: ACT : GPIO,0,0
466016378: SW : GPIO 0 Set to 0
466022043: WD : Uptime 7767 ConnectFailures 2 FreeMem 19728
466052043: WD : Uptime 7768 ConnectFailures 2 FreeMem 19728
466082043: WD : Uptime 7768 ConnectFailures 2 FreeMem 19728
466089033: SW : GPIO 0 Set to 1
466089041: SW : Switch state 1 Output value 0
466089044: EVENT: Relay01#status=0.00
466100643: EVENT: toggleRelay01
466100668: ACT : Event,setRelay01=0
466100690: Command: event
466100691: EVENT: setRelay01=0
466100708: ACT : GPIO,0,0
466100710: SW : GPIO 0 Set to 0
466100738: SW : Switch state 0 Output value 1
466100741: EVENT: Relay01#status=1.00
466103704: EVENT: setRelay01=0
466103721: ACT : GPIO,0,0
466103723: SW : GPIO 0 Set to 0
466104643: EVENT: toggleRelay01
466104667: ACT : Event,setRelay01=0
466104692: Command: event
466104693: EVENT: setRelay01=0
466104710: ACT : GPIO,0,0
466104712: SW : GPIO 0 Set to 0
466112043: WD : Uptime 7769 ConnectFailures 2 FreeMem 19728
Re: Help With Rules
i read somewhere that a virtual switch could help...can you suggest ho to make it with rules?
or maybe it is not relevant at all...
or maybe it is not relevant at all...
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
Sounds to me that you're not actually using the correct name of this part: if [Relay01#Status]=0. Observe that my example uses "state" where you use "status"!
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Help With Rules
actually This is my current rule:
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
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
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
And there you have it, you are not using YOUR name of the relay value... you use my example "state" not YOUR name "status"!
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Help With Rules
OK, thanks for the input i didn't noticed that.
i changed the name to be state
when pressing the SW1 nothing happening to relay.
on the mqtt console i can see it any press make the status go from 0 to 1 with single press.
/test/sw1/state 0
/test/sw1/state 1
i changed the name to be state
when pressing the SW1 nothing happening to relay.
on the mqtt console i can see it any press make the status go from 0 to 1 with single press.
/test/sw1/state 0
/test/sw1/state 1
- Attachments
-
- Devices.jpg (58.15 KiB) Viewed 23703 times
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Help With Rules
Sounds like you have the setup for the switch wrong, do you have it as a "normal" switch in the settings?
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Who is online
Users browsing this forum: Ahrefs [Bot] and 12 guests