Code: Select all
return {
on = {
devices = {
'Beldrukker' -- change to the name sensor of the doorbell button
},
},
logging = {
level = domoticz.LOG_DEBUG, -- Adjust loglevel to your needs
marker = 'Deurbel' -- Ajust logmarker yo your needs
},
execute = function(domoticz, device)
-- debugging
domoticz.log('Device ' .. device.name .. ' was changed to'..device.state, domoticz.LOG_DEBUG)
if (device.active) then
-- debug
domoticz.log("button was pushed, sending notification",domoticz.LOG_INFO)
-- notify the user
domoticz.notify("Deurbel","Er staat iemand voor de deur....",domoticz.PRIORITY_HIGH) -- adjust message to you needs
else
-- debug
domoticz.log("button was released, do nothig...",domoticz.LOG_DEBUG)
end
end
}