(solved)rule and event within rule syntax

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
riker1
Normal user
Posts: 320
Joined: 26 Dec 2017, 18:02

(solved)rule and event within rule syntax

#1 Post by riker1 » 13 Nov 2019, 17:57

New doku linked:
https://espeasy.readthedocs.io/en/lates ... Rules.html

Hi

I am consued as I do see different syntax in the wiki itself and rules tutorial,

want to trigger an event with

https://www.letscontrolit.com/wiki/inde ... rial_Rules

Code: Select all

on <trigger> do
 if <test1>
   event <EventName1>
 endif
endon
but later I did see :

Code: Select all

Event,StartTimer=1,[INT#11]

I want to use an event with value

is this now correct?

Code: Select all

event,eventname=eventvalue?
or

Code: Select all

event eventname=evenvalue?
thanks for clarification

T
Last edited by riker1 on 14 Nov 2019, 07:21, edited 1 time in total.

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

Re: rule and event within rule syntax

#2 Post by grovkillen » 13 Nov 2019, 18:28

Both comma and space are allowed but preferred is comma.

You can have up to four event values.

Event=1,2,3,4

Use in the block:

%eventvalue1%
...
%eventvalue4%

But for backwards compatibility you don't need the number if you only have one event value.

Event=1

%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 :idea: :idea: :idea:

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

Re: rule and event within rule syntax

#3 Post by grovkillen » 13 Nov 2019, 18:29

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:

TD-er
Core team member
Posts: 1922
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: rule and event within rule syntax

#4 Post by TD-er » 13 Nov 2019, 20:21

Like stated here: https://espeasy.readthedocs.io/en/lates ... mmand.html ("Event Command" section)

Event,SingleValue=123

This is triggering an event called "SingleValue" and it only has one value (123)

So you're acting on the event name like this:

Code: Select all

on SingleValue do
  Publish,%sysname%/Info,An event has been sent (%eventvalue%)!
endon
Event,Multi=1,2,3,99
will trigger an event called "Multi" which has 4 values. In the rules block you can access these with %eventvalue1% ... %eventvalue4%

riker1
Normal user
Posts: 320
Joined: 26 Dec 2017, 18:02

(solved): rule and event within rule syntax

#5 Post by riker1 » 14 Nov 2019, 07:20

thanks

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests