I'm trying to do a very simple LUA script to take the last value stored in a sensor ro status and be forwarded to a website (like a widget). Is my first time attempting LUA and I'm not a coder/developer by far. What I'm trying to do is something like the below:
http://domain/something.php?value1=a&value2=b
and then having this executed to a fix interval of time, ie every few minutes.
Looking into some LUA examples I found this, but still a bit lost on how to make this work within Domoticz:
Code: Select all
require'socket.http'
require'ltn12'
response_body = {}
request_body = "a=1"
socket.http.request{
url = "http://mysite.com/test.php";,
method = "GET",
headers = {
["Content-Length"] = string.len(request_body)
},
source = ltn12.source.string(request_body),
sink = ltn12.sink.table(response_body)
}