n8n webhook in dzevents
Posted: Monday 30 June 2025 13:54
Hi everyone,
i need an help with a script.
i want create a script that trigger a device. When triggered, the script has to call a n8n webhook, and get some data.
Something like that
the script have to wait until the call is ended.
the url is somethink like
and i need to pass some a JSON
Everything is working manually with curl
how can do that?
Thanx in advance
Fabrizio
i need an help with a script.
i want create a script that trigger a device. When triggered, the script has to call a n8n webhook, and get some data.
Something like that
Code: Select all
return {
active = true, -- set to false to disable this script
-- trigger
on = {
devices = {'Irrigatore'},
}
},
execute = function(dz, device, tginfo)
-- start webhook
-- return data from webhook
-- end webhook
end
the url is somethink like
Code: Select all
https://IP/webhook/irrigazione
Everything is working manually with curl
Code: Select all
curl -X GET https://IP/webhook/irrigazione -H "Content-Type: application/json" -d '{"umidita": 59, "temperatura_esterna": 31.5, "temperatura_terriccio":31.5}'
Thanx in advance
Fabrizio