Author Topic: http command using LUA  (Read 230 times)

Offline Lucas68

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
http command using LUA
« on: June 02, 2018, 12:08:14 pm »
Hi,

Sorry for the noob question. I just got a Vera Edge from my fren and I'm trying to figure out how to send http command using LUA, but i just cant figure out how.

I was trying to create a "Virtual switch" that will send a http command of let say:
http://192.168.1.123:4000/turnoff

and put the command in LUA code of the device, but I cant find something like that.

Then I try to create lua scene, but it requires a trigger which i dont have any sensor yet at the moment, is it possible for me to create a variable of lets say xxx=1. and the scene will check if xxx=1 and run the http command if it is?

I've spent whole day trying to look for more info, but most of the explanation is quite confusing for me as I dont code, I just want to send a simple command. Thanks so much!

Online cw-kid

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1570
  • Karma: +16/-2
Re: http command using LUA
« Reply #1 on: June 13, 2018, 07:28:00 am »
To send out http commands from Vera I use:

luup.inet.wget("HTTP-COMMAND")

luup.inet.wget("http://192.168.1.123:4000/turnoff")


Online cw-kid

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1570
  • Karma: +16/-2
Re: http command using LUA
« Reply #2 on: June 13, 2018, 07:34:43 am »
You may also need to enable this security setting see here.