OpenGarage has a API (https://github.com/OpenGarage/OpenGarag ... I1.1.0.pdf) with this you can go to the url and the data is shown, this looks like:
I tried:
Code: Select all
return {
on = {
timer = {
'every 10 minutes' -- just an example to trigger the request
},
httpResponses = {
'trigger' -- must match with the callback passed to the openURL command
}
},
execute = function(domoticz, item)
if (item.isTimer) then
domoticz.openURL({
url = 'http://192.168.178.16/jc',
method = 'GET',
callback = 'trigger', -- see httpResponses above.
})
end
if (item.isHTTPResponse) then
if (item.statusCode == 200) then
if (item.isJSON) then
local someValue = item.json.someValue -- just an example
-- update some device in Domoticz
domoticz.devices('myTextDevice').updateText(someValue)
end
else
domoticz.log('There was a problem handling the request', domoticz.LOG_ERROR)
domoticz.log(item, domoticz.LOG_ERROR)
end
end
end
}
Code: Select all
2019-11-26 13:51:00 nil