Plugin: LuaView

Patrick,
not sure what changed, but now ACE is working on chrome on my Mac. :wink:

[quote=“sebby, post:52, topic:199700”]Patrick,
not sure what changed, but now ACE is working on chrome on my Mac. ;)[/quote]

I was going to ask you to test that, so awesome! All I did was wrap the editor div in another div, as part of another change, but I wondered if that would affect the Mac issue. Happy for that good news!

Another fantastic Plugin! Thanks, rigpapa!!

Now that I’ve converted all my Vera scenes to Reactor, it might be cool for this plugin to also centralize any LUA code used in Reactor devices too (Activities etc). A possible future enhancement perhaps?

Possibly. Here’s the rub: All of the code LuaView shows executes in the same environment, so it makes sense to show them all together–startup Lua and scene Lua execute in the same environment. In contrast, Run Lua action code in a ReactorSensor runs under Reactor’s plugin context, and that’s enforced by Luup as a sandbox–the environment of startup Lua and scenes is not accessible to Run Lua (which is to say, if you create a global variable or function in one environment, it is not visible/accessible in the other). Presenting them all together, I fear, may lead to confusion.

Per the above, would it be possible to add a separate tab for Lua code contained within Reactor sensors. With a growing sensor library 20+, containing quite a bit of Lua stitched into various sensors, I’m starting to lose track of the mods I’ve made…

The Github stable branch for LuaView now contains two updates:

  1. I finally got the time to dig in and figure out how to keep the code, the Vera web UI, and the Vera itself in sync (this doesn’t apply to openLuup). For Startup Lua in particular, the web UI would be unaware that the Lua had changed, so I had to issue an advisory dialog in some cases to remind you to refresh the browser to keep it in sync. I believe we’re now past that.
  2. I’ve added a backup function of a sort–it displays all of your scene and startup Lua in a single page as plain text, with helpful headers, so you can save that file locally. Copy-paste from the file to restore.
  3. I’ve added a “Reload” button to the editor UI so you can reload Luup to see the effect of your changes (changes to Startup and scene Lua only take effect on reload).

Barring any accidents, this will become release 1.6 next week.

To install: go to the Github link above, click “Clone or download”, choose “Download ZIP”, unzip the downloaded file, and drag (as a group) the unzipped files to the uploader at Apps > Develop Apps > Luup Files.

1 Like

Ooh, I haven’t dicovered this plugin before :slight_smile: It would have saved a lot of time before, thanks @rigpapa. When I move soon I will replace all my old plugins with all yours plus the Alt-Hue etc. Today I am worried about that stability of my production unit (7.29) and I dont want to touch it. :grinning:

7.29 was a good release and has been the go-to for a long time. You should be confident doing whatever other work you need to do on it.

1 Like

Version 1.6 now released, with changes previously mentioned here.

I’m having an issue; I just installed luaview; but it does not seem to save my edits… the sections turn yellow after I edit something; but it never seems to save my changes. I can change the luup code in the scenes just fine.

Do you have any “X” marked lines in your code when shown in LuaView?

No, code looks good; no X marked.
I also don’t have a file downloaded when I click the “Back up lua” button …

Did you do a hard refresh after installing?

Good Call; I tried switching browsers and no issues now.
Thank you!

1 Like

What browser were you using before?

Hi Rigpapa,
I recently changed subnet on my home network and found that Luaview save me a lot of time opening each scene to examine for possible I.p modifications however it did not list and Lua that had been directly added to reactor activities and I had to wait for things to fail to realise this. Might it be possible to modify luaview to also reference reactor Lua activities please?
Again great apps and thanks again

1 Like

I’ve started to notice that when I’m in LuaView, if I go to the logs and try to scroll through them , as soon as I touch the embedded log view , it terminates my session ?

See screen snippet below, showing what it reports…

If I go an re-authenticate my session via Vera, as soon as I go back into LuaView and do the same thing it’s terminates me again ?? I can bounce around other menu screens/views etc. Even within LuaView itself (view my start script, not problem) it’s just when I go in to the log view and try to move it, that this occurs.

Any ideas of the cause ?

If you’re doing it through remote access (why else would you need a login session?), then that’s probably an issue. The update of the log file is highly interactive – lots of data back and forth between the Vera and the browser – and it may simply overwhelm the cloud remote access service, hit some limit in API request count or rate, or perhaps look like nefarious activity to some IDS or other security device/service on their network.

Hey @rigpapa

Thanks for responding - I’m not connected remotely I always connect to Vera locally. (So much so that if I’m out the house I vpn in to connect / so nothing should be going via the Vera servers ?)

I’m wondering if it is related to the errors I’m seeing in the log via this other post ?