Most likely just a basic question, but after reading the documentation, it is still not clear to me what i'm doing wrong

I do have multiple motion sensors (Called: Beweging aaa, Beweging bbb, etc) and multiple contact sensors (Called: Deur ccc, Deur ddd, etc). The notification should look like : "Triggered by Deur ccc" or "Triggered by Deur ddd" based on the sensor that triggerd this script.
Probably i can add all sensors locally, but i thought it should also be possible by using "Beweging*" and "*deur" .
When one of the sensors becomes active, the script is triggered (so, that part works at least), but it ends up with an error in the log file.
It looks like the data is not available at the place where i want to show it?
Can somebody explain how/why this is happening? and what i can do to fix it.
Code: Select all
An error occurred when calling event handler
2019-07-23 20:58:06.289 Error: dzVents: Error: (2.4.26) Deur/Beweging - : ...i/domoticz/scripts/dzVents/generated_scripts/Alarm01.lua:15: attempt to index field 'data' (a nil value)
The script :
Code: Select all
return {
on = {
devices = {
"*deur",
"Beweging*"
},
},
logging = { level = domoticz.LOG_DEBUG,
marker = "Deur/Beweging - " },
execute = function(dz, triggeredItem, info)
if (triggeredItem.active) then -- state == 'On'
dz.notify('info', 'The item ' .. dz.data.triggeredItem.name .. ' was triggered')
dz.notify("Domoticz", 'Device : ' ..dz.data.triggeredItem.name .. ' << item that triggered this ', dz.PRIORITY_NORMAL,dz.SOUND_DEFAULT, "" , "telegram")
end
end
}