Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local cameras = {
- {
- ['name'] = 'Voordeur',
- ['ip'] = '192.168.2.220'
- }, {
- ['name'] = 'Achterdeur',
- ['ip'] = '192.168.2..211'
- }
- }
- return {
- on = {
- timer = { 'every minute' },
- httpResponses = { 'cameraStatus' }
- },
- logging = {
- marker = "Camera"
- },
- execute = function(domoticz, item)
- for i, camera in pairs(cameras) do
- if (item.isTimer) then
- domoticz.openURL({
- url = 'http://'..camera['ip']..'',
- callback = 'cameraStatus'
- })
- end
- if (item.isHTTPResponse) then
- if (item.ok) then
- domoticz.log("Camera '"..camera['name'].."' is online!")
- else
- domoticz.log("Camera '"..camera['name'].."' is offline!")
- sendTelegram("*Let op!*%0ACamera '"..camera['name'].."' is offline!", "private")
- end
- end
- end
- end
- }
Advertisement
Add Comment
Please, Sign In to add comment