Seite 1 von 2

#1 Skript

Verfasst: Fr 22. Apr 2011, 19:32
von Franky
Hallo Leute,

das müsste doch gehen, oder?

licht_sz = use 'LCN.output.0.30.2'
licht_az = use 'LCN.output.0.11.2'

if licht_sz.value == 1 then
licht_az:on()
end

Wieso geht das nicht? Mus man das Skript noch irgendwie aktivieren?

Habe auch schon versucht die Variable licht_sz über events zu steuern, damit das Testskript klappt. Geht auch nicht. :confused:

Habe auch gerade noch mal das probiert:

event = use 'LCN.relais.0.7.2'

if event == 1 then
print ("Hi")
end

Geht auch nicht. Warum??? Was mache ich falsch?

LG Franky, der es in diesem Zusammenhang cool fände, wenn etwas mehr Beispielskripts verfügbar wären, die auch den aktuellen Befehlssatz möglichst umfassend beinhalten würden (Push - Notifications, etc.).

#2 RE: Skript

Verfasst: Fr 22. Apr 2011, 22:57
von DOMIQ
Please have a look at the "LUA with Base" thread, I added specific examples.

As for notifications, try something like this (update LCN IDs etc):

  1. 1. Create event rule
  2. 2. In the Channel field, add E.LCN.sensor.0.20.6
  3. 3. In the Match field, add 1
  4. 4. In the Commands field, add Channel, name C.REMOTE.notify value Something is moving
Now you have notification on the BMI on module 20. There is also C.REMOTE.message channel, that works in a similar way, but will deliver messages only if Remote is connected.

Updated information about available channels is here: [url http://domiq.pl/attachments/015_DOMIQ%20%20Channels.pdf]http://domiq.pl/attachments/015_DOMIQ%20%20Channels.pdf[/url]

#3 RE: Skript

Verfasst: Fr 22. Apr 2011, 23:44
von Franky
Hey Filip,

it does not works. :confused:

I have the attached events.[img]Events.jpg[/img]

The e-commands works correct, but I have no push - message on the iphone and the URL - command was not send.

#4 RE: Skript

Verfasst: Sa 23. Apr 2011, 00:07
von norden
Hallo Franky,

ich habe das eben bei mir probiert. In Deinem 2. Beispiel habe ich event in event.value geändert.
Das 1. Beispiel funktioniert auch so. Das Skript wird jedoch immer nur einmal (nach dem Speichern)
ausgeführt.

Filip hat im Thread "LUA with Base" erklärt wie es auch bei "Wertwechsel" funktioniert.

function licht_sz:onchange(new,old)

xxxxxxxx

end

Gruß
Dieter

#5 RE: Skript

Verfasst: Sa 23. Apr 2011, 00:12
von Franky
Hi Dieter,

habs mal geändert und genauso gemacht - geht nicht.:scared:

#6 RE: Skript

Verfasst: Sa 23. Apr 2011, 00:21
von DOMIQ
I will need to look at the translation files ;-)
Please add it with "Ausgang hinzufugen", what you did now you were setting variable.
In english last option is called "Add Channel".

It should look like this after adding:
CHANNEL name=C.REMOTE.notify value=Something is moving!

#7 RE: Skript

Verfasst: Sa 23. Apr 2011, 00:37
von Franky
Hey Filip,

perfect, it works.

Thank you so much and happy eastern.

#8 RE: Skript

Verfasst: Sa 23. Apr 2011, 15:55
von Franky
Hi Filip,

is it possible, to send a HTTP.www - address from the Base in the Internet (after event)?

#9 RE: Skript

Verfasst: Sa 23. Apr 2011, 16:23
von DOMIQ
You mean HTTP POST request? C.HTTP.get channel is essentially doing HTTP GET, but you won't see what it got...

#10 RE: Skript

Verfasst: Sa 23. Apr 2011, 17:40
von Franky
Yes I mean http post request. Whats the syntax?