Http post in lua

How do I make a http post in a scene using LUA. Could someone post an example of the syntax please.

Good afternoon,

The following link should help you in that process: Luup Scenes Events - MiCasaVerde


Thanks. I did look there but i cant get it to work.

I tried this:

local http = require(“socket.http”)

http.TIMEOUT = 5

result, status = http.request(“”, “run=run”)

But is doesn’t work. If I run the URL direct in a browser it works fine. But i’d like to have this command work as part of a scene.

On a Vera or Ezlo hub ?

Its a vera hun running UI7

On a Vera firmware hub you can just do this in your lua code:

  luup.inet.wget("") --Your comment here

thank you. Do I need the socket request an timeout code also?

Think you can just add a ,5 to the request.

luup.inet.wget("",5) --Your comment here

That’s perfect. Works a treat. Thank you.

1 Like

Best Home Automation shopping experience. Shop at getvera!

© 2021 Ezlo Innovation, All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules