Author Topic: LuaTest - A Tool for Testing Scene Lua Code  (Read 23195 times)

Offline kyb2012

  • Full Member
  • ***
  • Posts: 118
  • Karma: +4/-0
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #45 on: February 20, 2015, 06:38:03 pm »
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...
« Last Edit: February 20, 2015, 06:39:40 pm by kyb2012 »

Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3888
  • Karma: +477/-10
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #46 on: February 21, 2015, 05:11:36 am »
Quote
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.
 

Offline Don Diego

  • Hero Member
  • *****
  • Posts: 540
  • Karma: +298/-3
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #47 on: November 01, 2015, 12:59:32 pm »
Because you are running UI7 you will not be able to do this remotely due to the complex authentication involved.

- Garrett

Rex--

  I assume this tool only works on UI7?

   Don
Vera 3 (@1.5.622) (3); Vera Plus (2);
Trane/Schlage TStats (1); Schlage Deadbolt (2); Kwikset Lock (3);  GE 45602 Dimmer (14); GE 45603 Dimmer (17); HSM-100 (16); Everspring Siren (8), Everspring Temp/Humidity (4); HSM 200 (1)

Offline MarkAgain

  • Full Member
  • ***
  • Posts: 128
  • Karma: +3/-0
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #48 on: November 03, 2015, 12:34:27 pm »
I have been using this on UI5.  Works great!

Offline sre

  • Full Member
  • ***
  • Posts: 110
  • Karma: +0/-1
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #49 on: December 26, 2015, 03:38:45 pm »
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,
 

Offline akbooer

  • Master Member
  • *******
  • Posts: 5122
  • Karma: +221/-67
  • "Less is more"
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #50 on: December 26, 2015, 03:47:00 pm »
Code: [Select]
print (os.date("%c", value))
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P.
Razberry, MySensors Arduino, HomeWave, AltUI, DataYours, openLuup, ZWay, ZeroBrane Studio.

Offline sre

  • Full Member
  • ***
  • Posts: 110
  • Karma: +0/-1
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #51 on: October 27, 2016, 08:29:15 pm »
Hi,  I have installed LUA Test and it has worked before.  But now it gives an error 'No Handler'.  Can you help me please ?

Offline NO2nice

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #52 on: November 20, 2016, 09:16:44 pm »
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!

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:

Code: [Select]
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 "<veraip>: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

Offline rge

  • Jr. Member
  • **
  • Posts: 90
  • Karma: +9/-0
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #53 on: January 13, 2017, 02:56:45 am »
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.

Offline RobertoA109

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #54 on: January 21, 2017, 03:13:11 am »
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

Offline rge

  • Jr. Member
  • **
  • Posts: 90
  • Karma: +9/-0
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #55 on: January 24, 2017, 03:26:55 pm »
Surely this thread should be a sticky?

Offline RichardTSchaefer

  • Master Member
  • *******
  • Posts: 9566
  • Karma: +729/-135
    • RTS Services Plugins
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #56 on: January 24, 2017, 05:03:25 pm »
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.

Offline akbooer

  • Master Member
  • *******
  • Posts: 5122
  • Karma: +221/-67
  • "Less is more"
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #57 on: January 24, 2017, 05:12:42 pm »
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.

3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P.
Razberry, MySensors Arduino, HomeWave, AltUI, DataYours, openLuup, ZWay, ZeroBrane Studio.

Offline RobertoA109

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #58 on: February 07, 2017, 04:58:05 am »
Ok, thank you. Ciao.

Offline sjf2626

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #59 on: April 02, 2017, 03:40:48 pm »
Hi,  I have installed LUA Test and it has worked before.  But now it gives an error 'No Handler'.  Can you help me please ?
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.