Seite 2 von 2

#11 RE: Skript

Verfasst: So 24. Apr 2011, 23:14
von Franky
Hello Filip,

can you give me a sample of the syntax (notation) of the condition in events? Is the attached sample correct? I have try many possibilities, but it does not works.

Thanks for your help in advance.

[img]1[/img]

#12 RE: Skript

Verfasst: So 1. Mai 2011, 17:34
von DOMIQ
For events you should use full channel name and Lua operators.
Any channel value will be automatically converted from string to number, if it is possible.
For example:

Code: Alles auswählen

VAR.ala_og == 1
MEM.season == 'summer'
LCN.relay.0.20.1 == 1 and LCN.output.0.30.1 <= 1200

The best way to see what can be used as condition is to telnet to port 4224 and send ?[ENTER] - all current channel values will be shown.

#13 RE: Skript

Verfasst: Di 3. Mai 2011, 22:34
von Franky
Thank you.

Is it possible to make a counter - variable in the channel, like C.VAR.alarm=VAR.alarm+1 ?

Is in this case CHANNEL name=C.VAR.alarm value=VAR.alarm+1 the correct syntax?

#14 RE: Skript

Verfasst: Do 5. Mai 2011, 21:52
von DOMIQ
To make a counter you need to do it in Logic:

Code: Alles auswählen

ctr = use "VAR.counter"
function ctr:increment()
  ctr:set(ctr.value + 1)
end

And then use this in Events/Timers as Channel command

Code: Alles auswählen

Name: C.LOGIC
Value: ctr:increment()