Where to start ?

Hi all,

I received my Vera… And spent a good amount of time yesterday on the wiki trying to find out where to start if I want to write LUA scripts. I was able to telnet / ssh into my box, but I did not find a where to start… Can someone give me some lights ?

Thanks

Well, it all depends on what you’d like to do first. There are three main ‘places’ to put Lua code in Vera.

[ul][li]1: Add some conditions and other ‘actions’ to scenes/events. More detail in [url=http://wiki.micasaverde.com/index.php/Luup_Scenes_Events]http://wiki.micasaverde.com/index.php/Luup_Scenes_Events[/url].[/li]
[li]2: New devices. These allow you do define new ways for Vera to connect to the outside world. Check [url=http://wiki.micasaverde.com/index.php/Luup_Plugins]http://wiki.micasaverde.com/index.php/Luup_Plugins[/url] and [url=http://wiki.micasaverde.com/index.php/Luup_Plugins_ByHand]http://wiki.micasaverde.com/index.php/Luup_Plugins_ByHand[/url].[/li]
[li]3: Generic Plugins. These are generic Lua scripts that run at startup time and can do other background tasks that doesn’t require a UI.[/li][/ul]

In all cases, the Lua scripts have to use the Luup API, described in [url=http://wiki.micasaverde.com/index.php/Luup_Lua_extensions]http://wiki.micasaverde.com/index.php/Luup_Lua_extensions[/url].

If you first want to get some familiarity with the Lua language, you can simply call ‘lua’ in the Vera command line, or install it in your desktop machine (if you’re on Windows, try LfW: [url=http://luaforwindows.luaforge.net/]http://luaforwindows.luaforge.net/[/url]). Note that in those cases you’re using just Lua, and can’t access the Luup interface of Vera.