LuaTest - A Tool for Testing Scene Lua Code

Thanks for the feedback @Dav3m. I’m happy to hear that LuaTest is helping you make progress with your code.

If you had come across LuaTest several hours earlier, you wouldn’t appreciate it as much. ;D

Aint that the truth!!!
;D

Rex, like others have said, “this is the best thing ever!”
Being able to debug by adding print statements and not having to solely rely on luup log…priceless!
Prior to this, I was hitting a wall trying to interface to my Wallyhome flood & temp sensors. But after testing with LuaTest, I got it working in a couple hours! Found all my mistakes.
Thanks Rex.

When I followed all of the installation instructions, the site says “No handler” when I pull it up.

You have added the necessary lines in Startup Lua and saved them, and restarted?

Rex, is there a limit to the size of the code that I can debug in the LuaTest window?
It was working great, but as I added some more lines of code and try to save the code, I get a page error: Unable to load the web page because the server sent no data.
Error code: ERR_EMPTY_RESPONSE

I thought it was a text copy and paste issue, but even when I try typing the exact code, I get an error.

help…

Rex, is there a limit to the size of the code that I can debug in the LuaTest window?

There is a limit although I have never hit it. The constraint is the maximum length of the http request supported by the browser and Vera.

You could work around this by moving any code that is already debugged to global functions in Startup Lua.

[quote=“garrettwp, post:38, topic:180205”]Because you are running UI7 you will not be able to do this remotely due to the complex authentication involved.

  • Garrett[/quote]

Rex–

I assume this tool only works on UI7?

Don

I have been using this on UI5. Works great!

I really like this tool. It’s value to me is unexplainable. Thanks.

i have received the value of lasttrip as : “urn:micasaverde-com:serviceId:SecuritySensor1”,“LastTrip” value = “1451157523”. Can any one tell me how to conver this valus to real time ? Regards,

print (os.date("%c", value))

Hi, I have installed LUA Test and it has worked before. But now it gives an error ‘No Handler’. Can you help me please ?

[quote=“RexBeckett, post:37, topic:180205”][quote=“ntkmp42, post:36, topic:180205”]Is there a URL which will allow me to run Luatest via relay instead of with local access directly to my vera’s IP address? E.g. something which I should append to the “https://vera-us-oem-relay41.mios.com…” in my browser.
Thanks![/quote]

I’ve never tried running it remotely. It seems a little risky to me to be testing scene code when you cannot see/hear what happens. I also think there is a good chance that the edit function could be compromised by running through a relay.

If you want to try it, I would expect the following to work:

https://vera-us-oem-relay41.mios.com/<verausername>/<verapassword>/<veraserial>/data_request?id=lr_LuaTest&file=<filename.lua>

Hello- i didn’t want to waste anyone’s time here but i cannot figure out how to log into the lua test program. when i try “:3480/data_request?id=lr_LuaTest” it just times out. I might be missing a fundamental frist step here but I’m usually pretty good with this stuff. Is there an issue with U17? Are there any good stickies to walk me through this?
thanks in advance

Brilliant tool, many thanks!

A suggestion - the absolute paths in the HTML aren’t necessary, and prevent using the “port_3480” path instead of actual port 3480 (which is relevant for me as I have my device behind a password protected proxy).

It’s simple to replace the occurrences of "/ and '/ removing the / - except the two "/ which are obviously not in HTML code - and then it works fine with the relative paths.

Hi RexBeckett,
thank you so much for this awesome debugging tool, this is a real game changer, bringing hope and confidence.
Could you please tell me if there is a “max size limit” on the amount of Lua code that one could type in the LuaTest window?
I have tried to type in a 350 lines portion of code and it would refuse to save it.
These 350 lines are working fine if I type them in the Lua of a scene on VERA Plus running UI7 (1.7.2138).
Thank you in advance for your help and have a nice day.
Ciao

Surely this thread should be a sticky?

There probably is a size limit on the HTTP - Get request used to send the info to Vera.

MCV did not support the Put request when Rex wrote this … a Put request does not have a size limit.

You really shouldn’t try to debug 350 lines of code at a time. If you split it up into modules it’s much easier to test, document, and use. You can incorporate as many as you like using the require keyword, or put some of the debugged code into Lua Startup.

Ok, thank you. Ciao.

I’m getting the “No Handler” message now as well. Any ideas what might be wrong? This was working great the last time I tried to use this a few months ago.