UI7 PLugin Development

is there a guide for plugin development for UI7? I’ve been looking through all the resources that are listed in here and there is no single location that lists everything as a tutorial. so far i’ve looked at all the links in here: [url=http://wiki.mios.com/index.php/Category:Development]http://wiki.mios.com/index.php/Category:Development[/url] and [url=http://wiki.micasaverde.com/index.php/Plugin_Creation_Tutorial]http://wiki.micasaverde.com/index.php/Plugin_Creation_Tutorial[/url], but all the information is very disjointed. The page here: [url=http://wiki.micasaverde.com/index.php/Luup_Plugins_ByHand]http://wiki.micasaverde.com/index.php/Luup_Plugins_ByHand[/url] gives an excellent overview of the implementation file, but i can’t find the same thing for the other files that are required for a plugin. I’ve downloaded the code for the HouseModes plugin to see how all things tie together and that is helping, but was wondering if there was a better source of documentation. Specifically i was wondering how the calls from the UI happen from different locations (i.e. in a scene as a triggger, in a scene as an action, in the plugin screen, etc.).

Sorry MCV is not APPLE or GOOGLE
The best thing to do is find plugins that do kind of what you want to do … and see how it is implemented.

  1. Triggers are defined in the D_XXX.json file
    See the “eventList2” portion of this file.

  2. A scene action is defined in the S_XXX.xml file in the section.
    It is typically implemented in the I_XXX.xml file in the section.
    Most new developers use this only as a wrapper that calls the action code in an L_XXX.lua file.

  3. Adding UI entries to the Device panel in Vera for the UI is done in the D_XXX.json file.
    This is done by entries in the “Tabs” section.
    If you have a unique UI you can code it in JavaScript and be invoked from an entry in the D_XXX.json file.

    i.e. something like:
    “Label”: {
    “lang_tag”: “edit”,
    “text”: “Edit”
    “Position”: “2”,
    “TabType”: “javascript”,
    “ScriptName”: “J_XXX.js”,
    “Function”: “xxxInit”

My remarks :

-I now use a lot request handler : http://wiki.micasaverde.com/index.php/Luup_Lua_extensions#function:_register_handler
You can with that construct a plugin backend on your Vera and a frontend calling the “webservices” of your plugin.
Be careful, your plugin must have just one instance.

  • Do not not bother with UI5

Thanks Gents, appreciate the help and tips.

Be careful, your plugin must have just one instance

PLEG uses this and has multiple instances … I am not sure which instance get’s the request … does not matter.

[quote=“RichardTSchaefer, post:5, topic:192078”]

Be careful, your plugin must have just one instance

PLEG uses this and has multiple instances … I am not sure which instance get’s the request … does not matter.[/quote]

This is the last instance which registers its handler which will receive the requests.
As each instance has its own execution environment, they can’t talk or reuse the same resources.
For saving memory, it’s better to have a parent which holds the code and the handler.

fyi ALTUI is a singleton LUUP device using that exact same handler method for front end / back end communication and also vera <=> vera communication for multi controller support
it works well, although limited to http GET hence limiting the length of arguments we can pass in!

POST support is supposed to be in the next release … That’s what MCV has been telling me … as part of the solution to the Save problem. They want us to move away from RUNLUA (Current Post Method) … that still means that the LUA test environments may still suffer from the RUNLUA problem. I did not get the feeling that they have found/fixed the RUNLUA problem.

outstanding ! crossing fingers

But it will be only for UI7… so a choice will have to be done : break compatibility with UI5 or not.

RUNLUA works great on UI5