local scriptVar = 'getWSG'
return
{
on =
{
timer =
{
'every minute',
},
httpResponses =
{
scriptVar,
},
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = scriptVar,
},
execute = function(dz, item)
if item.isTimer then
dz.openURL(
{
url = "https://www.weerstation-grootegast.nl/weather28/ws_realtime.php",
method = 'GET',
callback = scriptVar,
})
elseif item.ok then -- statusCode == 2xx
local wsg = dz.utils.stringSplit(data,',')
dz.utils.dumpTable(wsg)
local weer = wsg.temp.weer._attr
-- get one value
dz.log('Temperatuur: ' .. weer.temp,dz.LOG_DEBUG)
-- get all values
for key, value in pairs(weer) do
dz.log(key .. ': '.. value,dz.LOG_DEBUG)
end
else
dz.log('problem retrieving data from WSG',dz.LOG_ERROR)
dz.log(item.data,dz.LOG_ERROR) --
end
end
}
Hopefully someone can help me with this or let me know that what I want to do is not possible.
jberinga wrote: Monday 08 February 2021 15:29
Is it possible to get data from a PHP page into Domozticz?
Hopefully someone can help me with this or let me know that what I want to do is not possible.