Page 1 of 1

(solved)rule and event within rule syntax

Posted: 13 Nov 2019, 17:57
by riker1
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

Re: rule and event within rule syntax

Posted: 13 Nov 2019, 18:28
by grovkillen
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%

Re: rule and event within rule syntax

Posted: 13 Nov 2019, 18:29
by grovkillen

Re: rule and event within rule syntax

Posted: 13 Nov 2019, 20:21
by TD-er
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%

(solved): rule and event within rule syntax

Posted: 14 Nov 2019, 07:20
by riker1
thanks