(Last Updated: July 15, 2020)

Hacking the plugin table list



  • I've got a few plugins that were ported over from Vera to openLuup, plus a few plugins developed under openLuup with the files being installed manually. Most of these plugins are now in the AltUI app store. However my openLuup doesn't know about them because they are not listed in user_data.json under "InstalledPlugins2". I would like to make openLuup/ALtUI aware of them ie all of them to be found in the plugin list. I could delete all my devices and install the plugins from the store but that would result in new device numbers that would need to be rehashed in scenes, etc.

    Looks like I need to do the following to make it easier:

    • Go to the Alternate App Store under the openLuup console (not under AltUI).
    • Find the apps, push the JSON buttons and copy the JSON code for each app ready for later.
    • Stop openLuup using the console "Lua shutdown" command (ie that means "openLuup shutdown"?)
    • Back up user_data.json.
    • In user_data.json, "InstalledPlugins2", paste the JSON code for all the apps of interest being ultra careful to make sure all the curly brackets and commas, etc are all happy.
    • Return the edited version of user_data.json to where it lives and restart or reboot to start up openLuup again.

    Questions:

    • Do I need to link these definitions to the devices already installed somehow? ie are the definitions by themselves sufficient? ie are they are self contained. I couldn't see any connections.
    • Some of the apps in the store are more recent versions of what I have installed. What do I have to do the plugin definition in user_data.json to make the App Store think I have an out of date plugin so I can then force an update? Is it just a matter of changing the version number to something different like say 'xyz'?

    Hope this makes some sense.



  • Er, um, ...

    @a-lurker said in Hacking the plugin table list:

    Looks like I need to do the following to make it easier:

    ... Good Grief, what did you think of first, that was harder?

    @a-lurker said in Hacking the plugin table list:

    Hope this makes some sense.

    No, none at all.

    Can you just try this, before resorting to hacking:

    • go to the App Store (my preference, these days, is to use the openLuup console page for this... so much faster!)
    • find the plugin you want properly installed
    • click the Install button
    • wait for the reload
      • you could watch the update progress on the Alt App Store plugin in AltUI, ...
      • ... or simply refresh the openLuup Devices page
    • check on the Plugins page that the version is what you want and the files menu is filled

    This is how it's supposed to work, so I need to know if you find otherwise.

    Clearly, if you have any doubts about the process, you should backup first (but you probably do anyway.)



  • Just noticed this embedded in your post:

    @a-lurker said in Hacking the plugin table list:

    the console "Lua shutdown" command (ie that means "openLuup shutdown"?)

    No, it doesn't mean that at all – sorry that the words are ambiguous. They're actually meant to resonate with the "Lua Startup" terminology. Unlike Vera, openLuup allows you to run some Lua code before shutdown/restart in case there's some clean-up you need to do, or whatever.

    So this menu items takes you to another Lua code editor which allows you to specify this code. That's why it's included in the same page group as all the other code editors.



  • @akbooer said in Hacking the plugin table list:

    the words are ambiguous

    Maybe "Lua Startup Code" and "Lua Shutdown Code"? Anyway been caught out before; pushing buttons I have should never have touched. The Format command was always a goodie for beginners - was that drive A or C? The good ship lollipop heading straight for the reef!

    How are you meant to stop openLuup by the way?



  • @akbooer said in Hacking the plugin table list:

    Good Grief, what did you think of first, that was harder?

    Nothing like a good challenge.

    OK looks like even though I have these plugins already installed manually, I can go to the App Store; install the apps and all be OK including updating my manually installed versions. I'm pretty sure it didn't work this way in Vera. May be that's the point; this is not Vera?



  • In vera you’ll get a device created for every new installed plugin. And a reload every time it’s updated.

    It’s so bad I had to disable auto updates and check from time to time. So, ol approach is superior, again 😉



  • @a-lurker said in Hacking the plugin table list:

    May be that's the point; this is not Vera?

    Voilà!

    @a-lurker said in Hacking the plugin table list:

    been caught out before; pushing buttons I have should never have touched.

    I try to make things idiot-proof, as you know 😉 so for anything potentially fatal, there's usually a check before you do it. It's why the console's Reload Luup Engine menu item has an Are you sure? alert (unlike AltUI), and also why there is an AreYouSure parameter to the openLuup plugin actions EmptyRoom101 and EmptyTrash.

    @a-lurker said in Hacking the plugin table list:

    How are you meant to stop openLuup by the way?

    openLuup User Guide, p.14:

    SHUTDOWN

    • on exit (from the HTTP request id=exit) will exit with status of 0 (successful exit)

    so, externally:

    http://openLuupIP:3480/data_request?id=exit
    

    or, from Lua:

    luup.inet.wget "http://0.0.0.0:3480/data_request?id=exit"
    

    ...there is no safety net in these cases.


Log in to reply