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

Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3888
  • Karma: +478/-10
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #30 on: October 25, 2014, 06:21:44 am »
What a great tool this is Rex.
Try for a while things in lua but I never got very far. This really helps me big steps forward.

The only thing missing is to add automatic or context help on the function you are using. But I know this is asking too much.

But I'd already be very happy, with a lua help for beginners.
Or links to good help sites, with good examples as part of this tool.

Thanks for the feedback, @Peter.

LuaTest uses a very simple browser interface. This was deliberate to allow it to be used on a variety of platforms. It does mean, though, that sophisticated options like context-sensitive help are not possible.

If you would like more advanced development and debugging aids, I recommend Zero Brane Studio for Vera. This is an excellent IDE for Lua that runs the code on Vera and provides a comprehensive set of debugging tools. It does require the purchase of a subscription.

If you haven't already done so, check out the online Lua Manual. I also recommend getting the Programming in Lua book. This is also available as a online version at http://www.lua.org/pil/ or as a PDF download.

I have found many useful Lua code snippets on the web. There are numerous examples on stackoverflow and github sites that come up when Googling anything that starts with Lua.


Offline joer.

  • Full Member
  • ***
  • Posts: 128
  • Karma: +1/-0
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #31 on: November 11, 2014, 10:30:17 pm »
Hi,

Just wanted to say I have had my Vera for 4-5 months now.
I have been scripting lua now since then and its been painstaking if you get something wrong with vera restarts, or tweaking, and looking up variables and functions.

I downloaded this luatest tool just this week and have accomplished more and figured out some bugs and tweaks in minutes. This may be the single greatest tool I have used yet for Vera! 

Thanks again!

Offline JoeyD

  • Sr. Member
  • ****
  • Posts: 410
  • Karma: +36/-5
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #32 on: December 18, 2014, 07:13:15 pm »
I echo all the sentiments on the great utility of this tool!

Thanks RexBeckett for this (among other) contributions!!

Offline mdp716

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #33 on: January 02, 2015, 09:18:26 pm »
Rex,

It has been said before, but seriously, this is one fine piece of work.  More or less a newb to both LUA and Vera 3 and I have spent hours earlier today trying to figure out what was wrong with my "IF THEN ELSEIF THEN ELSE END" statement and was getting entirely frustrated with the response I was seeing in the log files (basically they were Microsoft answers, ...technically correct, but totally useless in solving the problem) and I nailed it in a matter of seconds using this tool.

If they don't incorporate it in the next UI release I will have to seriously question the powers that be...

Thanks so much!


Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3888
  • Karma: +478/-10
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #34 on: January 03, 2015, 05:28:23 am »
I'm glad it helped, @mdp716. Thanks for the feedback.

Quote
...they were Microsoft answers, ...technically correct, but totally useless in solving the problem...

I had a good chuckle over that. I've had a few of those from MS products.

Offline ntkmp42

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #35 on: January 06, 2015, 08:09:28 am »
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!

Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3888
  • Karma: +478/-10
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #36 on: January 06, 2015, 08:59:27 am »
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>

Offline garrettwp

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6372
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #37 on: January 06, 2015, 01:34:01 pm »
Because you are running UI7 you will not be able to do this remotely due to the complex authentication involved.

- Garrett


Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3888
  • Karma: +478/-10
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #38 on: January 06, 2015, 05:20:35 pm »
Good point, Garrett. I failed to spot the significance of the OP's server name.  ???

Offline Dav3m

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #39 on: January 27, 2015, 06:38:07 pm »
Rex, I'll add my 2 cents to the  thread - Thanks for this awesome facility. I used it to debug some (simple) code I was writing to interface with my Ambibox (http://www.ambibox.ru/en/) TV backlight through a telnet API. It allowed me to figure out what was going on in no time, wish I'd come across it several hours earlier.

It made the difference between just giving up and even thinking of trying to turn the code into a full plugin.

Thanks!

Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3888
  • Karma: +478/-10
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #40 on: January 28, 2015, 04:50:05 am »
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

Offline konradwalsh

  • Hero Member
  • *****
  • Posts: 564
  • Karma: +19/-6
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #41 on: January 28, 2015, 05:53:02 am »
If you had come across LuaTest several hours earlier, you wouldn't appreciate it as much.  ;D

Aint that the truth!!!!!!!!!!!!!!!!!!!
 ;D

Offline kyb2012

  • Full Member
  • ***
  • Posts: 118
  • Karma: +4/-0
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #42 on: February 15, 2015, 11:01:42 pm »
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.

Offline NewVerdeUser

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #43 on: February 19, 2015, 10:51:01 pm »
When I followed all of the installation instructions, the site says "No handler" when I pull it up.

Offline akbooer

  • Master Member
  • *******
  • Posts: 5288
  • Karma: +229/-67
  • "Less is more"
Re: LuaTest - A Tool for Testing Scene Lua Code
« Reply #44 on: February 20, 2015, 02:59:31 am »
You have added the necessary lines in Startup Lua and saved them, and restarted?
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.