Code: Select all
return {
on = {
devices = {
'Keypad Access Control'
}
},
execute = function(domoticz, device)
if (device.state == 'On') then
domoticz.log('Device ' .. device.name .. ' is ingeschakeld om: ' .. device.lastUpdate.raw .. '', domoticz.LOG_INFO)
else
domoticz.log('Device ' .. device.name .. ' is uitgeschakeld om: ' .. device.lastUpdate.raw .. '', domoticz.LOG_INFO)
end
end
}
You can see it in the log:
Code: Select all
2018-09-24 23:03:23.723 Status: User: Admin initiated a switch command (21/Keypad Access Control/On)
2018-09-24 23:03:23.838 Status: dzVents: Info: Handling events for: "Keypad Access Control", value: "On"
2018-09-24 23:03:23.839 Status: dzVents: Info: ------ Start internal script: myAlarm_keypad: Device: "Keypad Access Control (ideAlarm)", Index: 21
2018-09-24 23:03:23.839 Status: dzVents: Info: Device Keypad Access Control is ingeschakeld om: 2018-09-24 22:48:13
2018-09-24 23:03:23.839 Status: dzVents: Info: ------ Finished myAlarm_keypad
2018-09-24 23:04:06.894 Status: User: Admin initiated a switch command (21/Keypad Access Control/Off)
2018-09-24 23:04:07.009 Status: dzVents: Info: Handling events for: "Keypad Access Control", value: "Off"
2018-09-24 23:04:07.009 Status: dzVents: Info: ------ Start internal script: myAlarm_keypad: Device: "Keypad Access Control (ideAlarm)", Index: 21
2018-09-24 23:04:07.009 Status: dzVents: Info: Device Keypad Access Control is uitgeschakeld om: 2018-09-24 23:03:23
2018-09-24 23:04:07.010 Status: dzVents: Info: ------ Finished myAlarm_keypad
Switch ON at: 23:03:23
In the log: 22:48:13
Switch OFF at: 23:04:07
In the log: 23:03:23
It must be like this:
Switch ON at: 23:03:23
In the log: 23:03:23
Switch OFF at: 23:04:07
In the log: 23:04:07
Can somebody help me with this?