PLEG and Luup Actions

Hello,

I’m unable to start Luup code in an action of the PLEG …

Ive turned on the Debug mode, and when clicking on the Action button “Do it now”, I get the following

Sat Aug 02 12:34:38.554 - RunNext:Condition:Ouvrir Index:1 Sat Aug 02 12:34:38.556 - RunNext:Lua Continue Sat Aug 02 12:34:38.556 - SaveActionDB:{}

In the Luup part of the action I have

luup.call_action(Window, "Up", {}, id_Volet ) where the id_Volet is a global Variable defined in the Startup Luup

If Also Tried without the variable

 luup.call_action(Window, "Up", {}, 34 )

Same result …

When I’m trying to call a global function in the Luup part I get this

Sat Aug 02 12:26:48.232 - RunNext:Condition:Ouvrir Index:1 Sat Aug 02 12:26:48.234 - RunNext:[string "FileLog ("PLEG Ouvrir Volets")..."]:11: attempt to call global 'FileLog' (a nil value) Sat Aug 02 12:26:48.235 - SaveActionDB:{}

FileLog is a global function which log events in a specific file …

I’m alittle lost here

Thanks in advance

Each PLEG (Actually every Plugin Instance) has it’s own LUA namespace.
Also Vera has one LUA namespace for ALL scenes.

A Global variable in the “Scene” namespace is not know in the PLEG namespace.

Ok taht is too bad :frowning:

but why is this command not working

luup.call_action(Window, "Up", {}, 34 )

this is a simple command without any variable ?

Or is there a way to start a scene in the action ?

Because the arguments you are passing to luup.call_action are incorrect.

And yes you can run a Scene.
Use the Advanced Tab for an action, select the PLEG device, and use the action RunScene.

Sorry I do not understand why incorrect, I’m using the same syntax in a scene and everything is working well ?

And you have Window defined as a global variable there that is NOT defined in PLEG.

Sometimes the most obvious things are not seen … I was thinking about the device I’d buy not this one !!! Thanks and sorry :-/