Don't know but maybe you could try changing the local networks settings in the domoticz Gui. (change 127.0.0.1 to 127.0.0.*
Setup -> Settings -> System setup -> local networks (NO USERNAME/PASSWORD)
Moderator: leecollings
Don't know but maybe you could try changing the local networks settings in the domoticz Gui. (change 127.0.0.1 to 127.0.0.*
Code: Select all
2019-07-08 10:35:00.505 Status: dzVents: Info: getStr from log: ------ Start internal script: getFailedVent2:, trigger: every 5 minutes
2019-07-08 10:35:00.508 Status: dzVents: Debug: getStr from log: OpenURL: url = http://127.0.0.1:8079/json.htm?type=command¶m=getlog&lastlogtime=1562574601&loglevel=4
2019-07-08 10:35:00.508 Status: dzVents: Debug: getStr from log: OpenURL: method = GET
2019-07-08 10:35:00.508 Status: dzVents: Debug: getStr from log: OpenURL: post data = nil
2019-07-08 10:35:00.509 Status: dzVents: Debug: getStr from log: OpenURL: headers = nil
2019-07-08 10:35:00.509 Status: dzVents: Debug: getStr from log: OpenURL: callback = getDomoticzErrorLog
2019-07-08 10:35:00.512 Status: dzVents: Info: getStr from log: ------ Finished getFailedVent2
2019-07-08 10:35:01.526 Status: dzVents: Info: Handling httpResponse-events for: "getDomoticzErrorLog
2019-07-08 10:35:01.526 Status: dzVents: Info: getStr from log: ------ Start internal script: getFailedVent2: HTTPResponse: "getDomoticzErrorLog"
2019-07-08 10:35:02.002 Status: dzVents: Debug: getStr from log: No (new) occurrences of string Error opening url: http://192.168.1.123 in the domoticz log
2019-07-08 10:35:02.005 Status: dzVents: Info: getStr from log: ------ Finished getFailedVent2
2019-07-08 10:35:02.002 Error: dzVents: Debug: getStr from log: Show ALL:
2019-07-08 10:35:02.002 {
2019-07-08 10:35:02.002 "LastLogTime" : "1562574603",
2019-07-08 10:35:02.002 "result" : [
2019-07-08 10:35:02.002 {
2019-07-08 10:35:02.002 "level" : 4,
2019-07-08 10:35:02.002 "message" : "2019-07-08 10:30:03.086 Error: dzVents: Debug: getStr from log: Show ALL: \n{\n \"LastLogTime\" : \"1562574302\",\n \"result\" : [\n {\n \"level\" : 4,\n \"message\" : \"2019-07-08 10:25:02.153 Error: dzVents: Debug: getStr from log: Show ALL: \\n{\\n \\\"LastLogTime\\\" : \\\"1562574001\\\",\\n \\\"result\\\" : [\\n {\\n \\\"level\\\" : 4,\\n \\\"message\\\" : \\\"2019-07-08 10:20:01.962 Error: dzVents: Debug: getStr from log: Show ALL: \\\\n{\\\\n \\\\\\\"LastLogTime\\\\\\\" : \\\\\\\"1562573701\\\\\\\",\\\\n \\\\\\\"result\\\\\\\" : [\\\\n {\\\\n \\\\\\\"level\\\\\\\" : 4,\\\\n \\\\\\\"message\\\\\\\" : \\\\\\\"2019-07-08 10:15:01.509 Error: dzVents: Debug: getStr from log: Show ALL: \\\\\\\\n{\\\\\\\\n \\\\\\\\\\\\\\\"LastLogTime\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"1562314225\\\\\\\\\\\\\\\",\\\\\\\\n \\\\\\\\\\\\\\\"result\\\\\\\\\\\\\\\" : [\\\\\\\\n {\\\\\\\\n \\\\\\\\\\\\\\\"level\\\\\\\\\\\\\\\" : 4,\\\\\\\\n \\\\\\\\\\\\\\\"message\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"2019-06-30 23:42:15.245 Error: Darksky: Error getting http data!.\\\\\\\\\\\\\\\"\\\\\\\\n },\\\\\\\\n {\\\\\\\\n \\\\\\\\\\\\\\\"level\\\\\\\\\\\\\\\" : 4,\\\\\\\\n \\\\\\\\\\\\\\\"message\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"2019-06-30 23:42:19.269 Error: Weersvoorspelling hardware (7) thread seems to have ended unexpectedly\\\\\\\\\\\\\\\"\\\\\\\\n },\\\\\\\\n {\\\\\\\\n \\\\\\\\\\\\\\\"level\\\\\\\\\\\\\\\" : 4,\\\\\\\\n \\\\\\\\\\\\\\\"message\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"2019-07-03 04:05:21.421 Error: PVOutput (Input): Error login!\\\\\\\\\\\\\\\"\\\\\\\\n },\\\\\\\\n {\\\\\\\\n \\\\\\\\\\\\\\\"level\\\\\\\\\\\\\\\" : 4,\\\\\\\\n \\\\\\\\\\\\\\\"message\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"2019-07-03 04:10:26.748 Error: PVOutput (Input): Error login!\\\\\\\\\\\\\\\"\\\\\\\\n },\\\\\\\\n {\\\\\\\\n \\\\\\\\\\\\\\\"level\\\\\\\\\\\\\\\" : 4,\\\\\\\\n \\\\\\\\\\\\\\\"message\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"2019-07-03 11:30:47.780 Error: Prowl: \\\\\\\\\\\\\\\"\\\\\\\\n },\\\\\\\\n {\\\\\\\\n \\\\\\\\\\\\\\\"level\\\\\\\\\\\\\\\" : 4,\\\\\\\\n \\\\\\\\\\\\\\\"message\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"2019-07-03 11:30:47.782 Error: SMTP Mailer: Error sending Email to: <******@gmail.com> !\\\\\\\\\\\\\\\"\\\\\\\\n },\\\\\\\\n {\\\\\\\\n \\\\\\\\\\\\\\\"level\\\\\\\\\\\\\\\" : 4,\\\\\\\\n \\\\\\\\\\\\\\\"message\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"2019-07-03 11:30:47.782 Error: Failed to send Email notification!\\\\\\\\\\\\\\\"\\\\\\\\n },\\\\\\\\n {\\\\\\\\n \\\\\\\\\\\\\\\"level\\\\\\\\\\\\\\\" : 4,\\\\\\\\n \\\\\\\\\\\\\\\"message\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"2019-07-03 12:19:25.807 Error: RFLink: Unhandled switch command: 00\\\\\\\\\\\\\\\"\\\\\\\\n },\\\\\\\\n {\\\\\\\\n \\\\\\\\\\\\\\\"level\\\\\\\\\\\\\\\" : 4,\\\\\\\\n \\\\\\\\\\\\\\\"message\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"2019-07-05 10:10:24.600 Error: GCM: Could not send message, HTTP Error\\\\\\\\\\\\\\\"\\\\\\\\n },\\\\\\\\n {\\\\\\\\n \\\\\\\\\\\\\\\"level\\\\\\\\\\\\\\\" : 4,\\\\\\\\n \\\\\\\\\\\\\\\"message\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"2019-07-05 10:10:24.732 Error: Prowl: \\\\\\\\\\\\\\\"\\\\\\\\n },\\\\\\\\n {\\\\\\\\n \\\\\\\\\\\\\\\"level\\\\\\\\\\\\\\\" : 4,\\\\\\\\n \\\\\\\\\\\\\\\"message\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"2019-07-05 10:10:25.323 Error: HTTP: \\\\\\\\\\\\\\\"\\\\\\\\n },\\\\\\\\n {\\\\\\\\n \\\\\\\\\\\\\\\"level\\\\\\\\\\\\\\\" : 4,\\\\\\\\n \\\\\\\\\\\\\\\"message\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"2019-07-05 10:10:25.336 Error: SMTP Mailer: Error sending Email to: <*****@gmail.com> !\\\\\\\\\\\\\\\"\\\\\\\\n },\\\\\\\\n {\\\\\\\\n \\\\\\\\\\\\\\\"level\\\\\\\\\\\\\\\" : 4,\\\\\\\\n \\\\\\\\\\\\\\\"message\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"2019-07-05 10:10:25.338 Error: Failed to send Email notification!\\\\\\\\\\\\\\\"\\\\\\\\n }\\\\\\\\n ],\\\\\\\\n \\\\\\\\\\\\\\\"status\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"OK\\\\\\\\\\\\\\\",\\\\\\\\n \\\\\\\\\\\\\\\"title\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"GetLog\\\\\\\\\\\\\\\"\\\\\\\\n}\\\\\\\\n\\\\\\\"\\\\n }\\\\n ],\\\\n \\\\\\\"status\\\\\\\" : \\\\\\\"OK\\\\\\\",\\\\n \\\\\\\"title\\\\\\\" : \\\\\\\"GetLog\\\\\\\"\\\\n}\\\\n\\\"\\n }\\n ],\\n \\\"status\\\" : \\\"OK\\\",\\n \\\"title\\\" : \\\"GetLog\\\"\\n}\\n\"\n }\n ],\n \"status\" : \"OK\",\n \"title\" : \"GetLog\"\n}\n"
2019-07-08 10:35:02.002 }
2019-07-08 10:35:02.002 ],
2019-07-08 10:35:02.002 "status" : "OK",
2019-07-08 10:35:02.002 "title" : "GetLog"
2019-07-08 10:35:02.002 }
2019-07-08 10:35:02.002
Are the subsequent runs OK now ?
Time to REM out the debug-lines?2019-07-09 23:35:00.635 Status: dzVents: Info: getStr from log: ------ Start internal script: getFailedVent2:, trigger: every 5 minutes
2019-07-09 23:35:00.638 Status: dzVents: Debug: getStr from log: OpenURL: url = http://127.0.0.1:8079/json.htm?type=com ... loglevel=4
2019-07-09 23:35:00.639 Status: dzVents: Debug: getStr from log: OpenURL: method = GET
2019-07-09 23:35:00.639 Status: dzVents: Debug: getStr from log: OpenURL: post data = nil
2019-07-09 23:35:00.639 Status: dzVents: Debug: getStr from log: OpenURL: headers = nil
2019-07-09 23:35:00.640 Status: dzVents: Debug: getStr from log: OpenURL: callback = getDomoticzErrorLog
2019-07-09 23:35:00.643 Status: dzVents: Info: getStr from log: ------ Finished getFailedVent2
2019-07-09 23:35:01.452 Status: dzVents: Info: Handling httpResponse-events for: "getDomoticzErrorLog
2019-07-09 23:35:01.453 Status: dzVents: Info: getStr from log: ------ Start internal script: getFailedVent2: HTTPResponse: "getDomoticzErrorLog"
2019-07-09 23:35:01.518 Status: dzVents: Debug: getStr from log: Show ALL:
2019-07-09 23:35:01.518 {
2019-07-09 23:35:01.518 "status" : "OK",
2019-07-09 23:35:01.518 "title" : "GetLog"
2019-07-09 23:35:01.518 }
2019-07-09 23:35:01.518
2019-07-09 23:35:01.531 Status: dzVents: Debug: getStr from log: No (new) occurrences of string Error opening url: http://192.168.1.123 in the domoticz log
2019-07-09 23:35:01.534 Status: dzVents: Info: getStr from log: ------ Finished getFailedVent2
Hi Waarenwaaren wrote: ↑Monday 10 June 2019 15:06Maybe this can get you started.bldewit wrote: ↑Monday 10 June 2019 13:41 It would be great if we could use an error message in the log as a trigger for a script. This way one could send a message after not being able to connect to a URL when switching network connected devices or for instance send the same command again after X seconds.
Is there a way to read the log and use the text in (e.g.) a LUA script?
When not yet familiar with dzVents please start with reading Get started Before implementing. Special attention please for
"In Domoticz go to Setup > Settings > Other and in the section EventSystem make sure the checkbox 'dzVents disabled' is not checked. Also make sure that in the Security section in the settings you allow 127.0.0.1 to not need a password. dzVents uses that port to send certain commands to Domoticz. Finally make sure you have set your current location in Setup > Settings > System > Location, otherwise there is no way to determine nighttime/daytime state."
Probably the location of the post moved. I guess it was this oneniki_lauda wrote: ↑Sunday 26 April 2020 10:24 The url you gave is not working any more can you point me in the right direction?
Code: Select all
2021-01-23 14:51:00.559 Error: dzVents: Info: getStr from log: ------ Start internal script: Log Error: HTTPResponse: "getDomoticzErrorLog"
Code: Select all
2021-01-23 14:51:00.396 Status: dzVents: Info: getStr from log: ------ Start internal script: Log Error:, trigger: "every minute"
2021-01-23 14:51:00.396 Status: dzVents: Debug: getStr from log: OpenURL: url = http://127.0.0.1:9200/json.htm?type=command¶m=getlog&lastlogtime=1611409800&loglevel=4
2021-01-23 14:51:00.396 Status: dzVents: Debug: getStr from log: OpenURL: method = GET
2021-01-23 14:51:00.396 Status: dzVents: Debug: getStr from log: OpenURL: post data = nil
2021-01-23 14:51:00.396 Status: dzVents: Debug: getStr from log: OpenURL: headers = nil
2021-01-23 14:51:00.396 Status: dzVents: Debug: getStr from log: OpenURL: callback = getDomoticzErrorLog
2021-01-23 14:51:00.397 Status: dzVents: Info: getStr from log: ------ Finished Log Error
2021-01-23 14:51:00.559 Status: dzVents: Debug: getStr from log: Show ALL:
2021-01-23 14:51:00.559 {
2021-01-23 14:51:00.559 "status" : "OK",
2021-01-23 14:51:00.559 "title" : "GetLog"
2021-01-23 14:51:00.559 }
2021-01-23 14:51:00.559
2021-01-23 14:51:00.559 Status: dzVents: Debug: getStr from log: No (new) occurrences of string Error in the domoticz log
2021-01-23 14:51:00.559 Status: dzVents: Info: getStr from log: ------ Finished Log Error
2021-01-23 14:51:00.559 Error: dzVents: Info: getStr from log: ------ Start internal script: Log Error: HTTPResponse: "getDomoticzErrorLog"
Code: Select all
myHttpResponse = "getDomoticzErrorLog"
return {
on = { httpResponses = { myHttpResponse },
timer = { "every minute"},
},
logging = { level = domoticz.LOG_DEBUG,
marker = "getStr from log" },
data = { lastlogtime = { initial = 0 }},
execute = function(dz, trigger)
local searchStr = "Error" -- Change to reflect the messages you want to catch
local function askDomoticzForLogLines()
local lastLogTime = dz.data.lastlogtime -- get time last logrequest
local logLevel = 4 -- loglevel (1=normal,2=Status,4=error,268435455=all
local jsonString = "/json.htm?type=command" ..
"¶m=getlog" ..
"&lastlogtime=" .. tostring(lastLogTime) ..
"&loglevel=" .. tostring(logLevel)
local logURL = dz.settings["Domoticz url"] .. jsonString
dz.openURL ({ url = logURL,
method = "GET",
callback = myHttpResponse
})
dz.data.lastlogtime = dz.time.dDate -- store current Time as seconds from epoch
end
local function findString()
if trigger.json.result ~= nil then -- Only when there are errormessages in the log
local resultTable = trigger.json.result
for i = #resultTable,1,-1 do -- traverse backwards to get latest violation first
local s = resultTable[i].message
local found = s:find(searchStr,1,true) -- searcg plain string starting at pos 1 (no pattern)
local dzVents = s:find("dzVents")
if found and not(dzVents) then
return true
end
end
end
end
if trigger.isDevice or trigger.isTimer then
askDomoticzForLogLines() -- get the relevant loglines
elseif trigger.ok then
dz.log("Show ALL: \n" .. trigger.data,dz.LOG_DEBUG)
if findString() then
dz.log("Log " .. searchStr .. " found! ",dz.LOG_DEBUG)
dz.notify("Log " .. searchStr .. " found! ",dz.PRIORITY_HIGH)
else
dz.log("No (new) occurrences of string " .. searchStr .. " in the domoticz log ",dz.LOG_DEBUG)
end
else
dz.log("Access problem to log. Data found: " .. trigger.data,dz.LOG_ERROR)
end
end
}
That should not be a problem. Domoticz recognize the word Error and report that in the log as a log message with type Error.madpatrick wrote: ↑Saturday 23 January 2021 14:54 I've changed the script a little bit to get a message when any error is in the log file, but i see a error line in the log running the script.
Not sure that it means or whether it is an problem
Code: Select all
Error: CheckAuthToken(83ac3e6a227dda5d7c0af393a3a99d27_NQtYzBiYzc3NjNkNDYy) : session id not found
In below version you can filter out 0 or more strings you don't want to be reported on.madpatrick wrote: ↑Saturday 23 January 2021 20:09 Is it possible to filter out the reporting which a specific word is in an error message.
Code: Select all
scriptVar = "getDomoticzErrorLog"
return
{
on =
{
httpResponses =
{
scriptVar,
},
timer =
{
"every minute"
},
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = scriptVar,
},
data =
{
lastlogtime =
{
initial = 0
}
},
execute = function(dz, item)
local searchStr = "Error" -- Change to reflect the messages you want to catch
local ignoreStrings = -- Enter all strings to be ignored in this table
{
'CheckAuthToken',
'dzVents: Info:',
'dzVents: !Info:',
'dzVents: Debug:',
}
local function trueError(str)
for _, ignore in ipairs(ignoreStrings) do
if str:find(ignore) then return false end
end
return true
end
local function askDomoticzForLogLines()
local lastLogTime = dz.data.lastlogtime -- get time last logrequest
local logLevel = 4 -- loglevel (1=normal,2=Status,4=error,268435455=all
local jsonString = "/json.htm?type=command" .. "¶m=getlog" .. "&lastlogtime=" .. tostring(lastLogTime) .. "&loglevel=" .. tostring(logLevel)
dz.openURL(
{
url = dz.settings["Domoticz url"] .. jsonString
callback = scriptVar
})
dz.data.lastlogtime = os.time() -- store current Time as seconds from epoch
end
local function findString()
if item.json.result then -- Only when there are errormessages in the log
local rt = item.json.result
for i = #rt, 1, -1 do -- traverse backwards to get latest violation first
local msg = rt[i].message
if msg:find('%s%s' .. searchStr) and trueError(msg) then return msg end
end
end
end
if item.isDevice or item.isTimer then
askDomoticzForLogLines() -- get the relevant loglines
elseif item.json then
dz.log("Show ALL: \n" .. item.data,dz.LOG_DEBUG)
local line = findString()
if line then
dz.log("Log " .. searchStr .. " found! ",dz.LOG_DEBUG)
dz.notify("Log " .. line .. " found! ",dz.PRIORITY_HIGH)
else
dz.log("No (new) occurrences of string " .. searchStr .. " in the domoticz log ",dz.LOG_DEBUG)
end
else
dz.log("Access problem to log. Data found: " .. item.data,dz.LOG_ERROR)
end
end
}
Change line
Code: Select all
url = dz.settings["Domoticz url"] .. jsonString
Code: Select all
url = dz.settings["Domoticz url"] .. jsonString,
Can you share the log and your script both between code tags and not as image? That will allow me to add some extra debug statements to help solving your issue.
Code: Select all
2021-04-20 12:24:22.097 (Virtual devices) Light/Switch (test_switch)
2021-04-20 12:24:22.096 Status: User: Admin initiated a switch command (2/test_switch/On)
2021-04-20 12:24:22.122 Status: dzVents: Info: Handling events for: "test_switch", value: "On"
2021-04-20 12:24:22.122 Status: dzVents: Info: getDomoticzErrorLog: ------ Start internal script: Script #5: Device: "test_switch (Virtual devices)", Index: 2
2021-04-20 12:24:22.122 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: url = http://127.0.0.1:8080/json.htm?type=command¶m=getlog&lastlogtime=1618913951&loglevel=4
2021-04-20 12:24:22.122 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: method = GET
2021-04-20 12:24:22.122 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: post data = nil
2021-04-20 12:24:22.122 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: headers = nil
2021-04-20 12:24:22.122 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: callback = getDomoticzErrorLog
2021-04-20 12:24:22.122 Status: dzVents: Info: getDomoticzErrorLog: ------ Finished Script #5
2021-04-20 12:24:22.122 Status: EventSystem: Script event triggered: /root/dev-domoticz/dzVents/runtime/dzVents.lua
2021-04-20 12:24:22.159 Status: dzVents: Info: Handling httpResponse-events for: "getDomoticzErrorLog"
2021-04-20 12:24:22.159 Status: dzVents: Info: getDomoticzErrorLog: ------ Start internal script: Script #5: HTTPResponse: "getDomoticzErrorLog"
2021-04-20 12:24:22.160 Status: dzVents: Debug: getDomoticzErrorLog: Show ALL:
2021-04-20 12:24:22.160 {
2021-04-20 12:24:22.160 "status" : "OK",
2021-04-20 12:24:22.160 "title" : "GetLog"
2021-04-20 12:24:22.160 }
2021-04-20 12:24:22.160
2021-04-20 12:24:22.160 Status: dzVents: Info: getDomoticzErrorLog: ------ Finished Script #5
2021-04-20 12:24:22.160 Error: dzVents: Debug: getDomoticzErrorLog: No (new) occurrences of string Error: Error opening url: http://www.TESTERROR in the domoticz log
2021-04-20 12:24:22.302 Error: Error opening url: http://www.TESTERROR
Code: Select all
scriptVar = "getDomoticzErrorLog"
return
{
on =
{
httpResponses =
{
scriptVar,
},
devices =
{
"test_switch"
},
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = scriptVar,
},
data =
{
lastlogtime =
{
initial = 0
}
},
execute = function(dz, item)
local searchStr = "http://www.TESTERROR" -- Change to reflect the messages you want to catch
local ignoreStrings = -- Enter all strings to be ignored in this table
{
'CheckAuthToken',
'dzVents: Info:',
'dzVents: !Info:',
'dzVents: Debug:',
}
local function trueError(str)
for _, ignore in ipairs(ignoreStrings) do
if str:find(ignore) then return false end
end
return true
end
local function askDomoticzForLogLines()
local lastLogTime = dz.data.lastlogtime -- get time last logrequest
local logLevel = 4 -- loglevel (1=normal,2=Status,4=error,268435455=all
local jsonString = "/json.htm?type=command" .. "¶m=getlog" .. "&lastlogtime=" .. tostring(lastLogTime) .. "&loglevel=" .. tostring(logLevel)
dz.openURL(
{
url = dz.settings["Domoticz url"] .. jsonString,
callback = scriptVar
})
dz.data.lastlogtime = os.time() -- store current Time as seconds from epoch
end
local function findString()
if item.json.result then -- Only when there are errormessages in the log
local rt = item.json.result
for i = #rt, 1, -1 do -- traverse backwards to get latest violation first
local msg = rt[i].message
if msg:find('%s%s' .. searchStr) and trueError(msg) then return msg end
end
end
end
if item.isDevice or item.isTimer then
askDomoticzForLogLines() -- get the relevant loglines
elseif item.json then
dz.log("Show ALL: \n" .. item.data,dz.LOG_DEBUG)
local line = findString()
if line then
dz.log("Log " .. searchStr .. " found! ",dz.LOG_DEBUG)
dz.notify("Log " .. line .. " found! ",dz.PRIORITY_HIGH)
else
dz.log("No (new) occurrences of string " .. searchStr .. " in the domoticz log ",dz.LOG_DEBUG)
end
else
dz.log("Access problem to log. Data found: " .. item.data,dz.LOG_ERROR)
end
end
}
Please note that the script only find real errors. So no test messages send to the OS file with the domoticz log.
Code: Select all
local scriptVar = "getDomoticzErrorLog"
return
{
on =
{
httpResponses =
{
scriptVar,
},
devices =
{
"test_switch",
},
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = scriptVar,
},
data =
{
lastlogtime =
{
initial = 0,
},
previousTime =
{
initial = 0,
},
},
execute = function(dz, item)
local searchStr = "Error: Error opening url: http://www.TESTERROR" -- Change to reflect the messages you want to catch
local ignoreStrings = -- Enter all strings to be ignored in this table
{
'CheckAuthToken',
'dzVents: Info:',
'dzVents: !Info:',
'dzVents: Debug:',
}
local function trueError(str)
for _, ignore in ipairs(ignoreStrings) do
if str:find(ignore) then return false end
end
return true
end
local function askDomoticzForLogLines()
local lastLogTime = dz.data.lastlogtime -- get time last logrequest
local logLevel = 4 -- loglevel (1=normal,2=Status,4=error,268435455=all
local jsonString = "/json.htm?type=command" .. "¶m=getlog" .. "&lastlogtime=" .. tostring(lastLogTime) .. "&loglevel=" .. tostring(logLevel)
dz.openURL(
{
url = dz.settings["Domoticz url"] .. jsonString,
callback = scriptVar
})
dz.data.previousTime = dz.data.lastlogtime
dz.data.lastlogtime = os.time() - 1 -- store current Time as seconds from epoch
end
local function findString()
if item.json.result then -- Only when there are errormessages in the log
local rt = item.json.result
for i = #rt, 1, -1 do -- traverse backwards to get latest violation first
local msg = rt[i].message
if msg:find('%s%s' .. searchStr) and trueError(msg) then return msg end
end
dz.log('No resulting loglines found for the set logLevel / searchstrings in the last ' .. ( os.time() - dz.data.previousTime ) .. ' seconds.',dz.LOG_DEBUG)
else
dz.log('No resulting loglines found for the set logLevel in the last ' .. ( os.time() - dz.data.previousTime ) .. ' seconds.',dz.LOG_DEBUG)
end
end
if item.isDevice or item.isTimer then
askDomoticzForLogLines() -- get the relevant loglines
elseif item.json then
local line = findString()
if line then
dz.log("Log " .. searchStr .. " found! ",dz.LOG_DEBUG)
dz.notify("Log " .. line .. " found! ",dz.PRIORITY_HIGH)
else
dz.log("Show ALL: \n" .. item.data,dz.LOG_DEBUG)
dz.log("No (new) occurrences of string " .. searchStr .. " in the domoticz log ",dz.LOG_DEBUG)
dz.openURL('http://www.TESTERROR') -- Force real error to log (only during debug)
end
else
dz.log("Access problem to log. Data found: " .. item.data,dz.LOG_ERROR)
end
end
}
Code: Select all
2021-04-20 13:31:01.259 Status: User: Admin initiated a switch command (2/test_switch/On)
2021-04-20 13:31:01.286 Status: dzVents: Info: Handling events for: "test_switch", value: "On"
2021-04-20 13:31:01.286 Status: dzVents: Info: getDomoticzErrorLog: ------ Start internal script: Script #5: Device: "test_switch (Virtual devices)", Index: 2
2021-04-20 13:31:01.286 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: url = http://127.0.0.1:8080/json.htm?type=command¶m=getlog&lastlogtime=1618918167&loglevel=4
2021-04-20 13:31:01.286 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: method = GET
2021-04-20 13:31:01.286 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: post data = nil
2021-04-20 13:31:01.286 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: headers = nil
2021-04-20 13:31:01.286 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: callback = getDomoticzErrorLog
2021-04-20 13:31:01.287 Status: dzVents: Info: getDomoticzErrorLog: ------ Finished Script #5
2021-04-20 13:31:01.287 Status: EventSystem: Script event triggered: /root/dev-domoticz/dzVents/runtime/dzVents.lua
2021-04-20 13:31:01.346 Status: dzVents: Info: Handling httpResponse-events for: "getDomoticzErrorLog"
2021-04-20 13:31:01.346 Status: dzVents: Info: getDomoticzErrorLog: ------ Start internal script: Script #5: HTTPResponse: "getDomoticzErrorLog"
2021-04-20 13:31:01.347 Status: dzVents: Debug: getDomoticzErrorLog: No resulting loglines found for the set logLevel / searchstrings in the last 94 seconds.
2021-04-20 13:31:01.347 Status: dzVents: Debug: getDomoticzErrorLog: No (new) occurrences of string Error opening url in the domoticz log
2021-04-20 13:31:01.347 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: url = http://www.TESTERROR
2021-04-20 13:31:01.347 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: method = GET
2021-04-20 13:31:01.347 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: post data = nil
2021-04-20 13:31:01.347 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: headers = nil
2021-04-20 13:31:01.347 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: callback = nil
2021-04-20 13:31:01.347 Status: dzVents: Info: getDomoticzErrorLog: ------ Finished Script #5
2021-04-20 13:31:01.347 Status: EventSystem: Script event triggered: /root/dev-domoticz/dzVents/runtime/dzVents.lua
2021-04-20 13:31:01.347 Error: dzVents: Debug: getDomoticzErrorLog: Show ALL:
2021-04-20 13:31:01.347 {
2021-04-20 13:31:01.347 "LastLogTime" : "1618918168",
2021-04-20 13:31:01.347 "result" :
2021-04-20 13:31:01.347 [
2021-04-20 13:31:01.347 {
2021-04-20 13:31:01.347 "level" : 4,
2021-04-20 13:31:01.347 "message" : "2021-04-20 13:29:28.565 Error: dzVents: Debug: getDomoticzErrorLog: Show ALL: \n{\n\t\"LastLogTime\" : \"1618918157\",\n\t\"result\" : \n\t[\n\t\t{\n\t\t\t\"level\" : 4,\n\t\t\t\"message\" : \"2021-04-20 13:29:17.334 Error: dzVents: Debug: getDomoticzErrorLog: Show ALL: \\n{\\n\\t\\\"LastLogTime\\\" : \\\"1618917940\\\",\\n\\t\\\"result\\\" : \\n\\t[\\n\\t\\t{\\n\\t\\t\\t\\\"level\\\" : 4,\\n\\t\\t\\t\\\"message\\\" : \\\"2021-04-20 13:25:13.881 Error: dzVents: Debug: getDomoticzErrorLog: Log Error: Error opening url: http://www.TESTERROR found! \\\"\\n\\t\\t},\\n\\t\\t{\\n\\t\\t\\t\\\"level\\\" : 4,\\n\\t\\t\\t\\\"message\\\" : \\\"2021-04-20 13:25:14.063 Error: Error opening url: http://test_off_error\\\"\\n\\t\\t},\\n\\t\\t{\\n\\t\\t\\t\\\"level\\\" : 4,\\n\\t\\t\\t\\\"message\\\" : \\\"2021-04-20 13:25:35.675 Error: Error opening url: http://www.TESTERROR\\\"\\n\\t\\t},\\n\\t\\t{\\n\\t\\t\\t\\\"level\\\" : 4,\\n\\t\\t\\t\\\"message\\\" : \\\"2021-04-20 13:25:40.648 Error: Error opening url: http://test_off_error\\\"\\n\\t\\t}\\n\\t],\\n\\t\\\"status\\\" : \\\"OK\\\",\\n\\t\\\"title\\\" : \\\"GetLog\\\"\\n}\\n\"\n\t\t},\n\t\t{\n\t\t\t\"level\" : 4,\n\t\t\t\"message\" : \"2021-04-20 13:29:17.356 Error: Error opening url: http://www.TESTERROR\"\n\t\t},\n\t\t{\n\t\t\t\"level\" : 4,\n\t\t\t\"message\" : \"2021-04-20 13:29:17.477 Error: Error opening url: http://www.TESTERROR\"\n\t\t}\n\t],\n\t\"status\" : \"OK\",\n\t\"title\" : \"GetLog\"\n}\n"
2021-04-20 13:31:01.347 },
2021-04-20 13:31:01.347 {
2021-04-20 13:31:01.347 "level" : 4,
2021-04-20 13:31:01.347 "message" : "2021-04-20 13:29:28.586 Error: Error opening url: http://www.TESTERROR"
2021-04-20 13:31:01.347 },
2021-04-20 13:31:01.347 {
2021-04-20 13:31:01.347 "level" : 4,
2021-04-20 13:31:01.347 "message" : "2021-04-20 13:29:28.707 Error: Error opening url: http://test_off_error"
2021-04-20 13:31:01.347 }
2021-04-20 13:31:01.347 ],
2021-04-20 13:31:01.347 "status" : "OK",
2021-04-20 13:31:01.347 "title" : "GetLog"
2021-04-20 13:31:01.347 }
2021-04-20 13:31:01.347
2021-04-20 13:31:01.368 Error: Error opening url: http://www.TESTERROR
2021-04-20 13:31:01.489 Error: Error opening url: http://www.TESTERROR
2021-04-20 13:31:58.663 (Virtual devices) Light/Switch (test_switch)
2021-04-20 13:31:58.662 Status: User: Admin initiated a switch command (2/test_switch/Off)
2021-04-20 13:31:58.685 Status: dzVents: Info: Handling events for: "test_switch", value: "Off"
2021-04-20 13:31:58.686 Status: dzVents: Info: getDomoticzErrorLog: ------ Start internal script: Script #5: Device: "test_switch (Virtual devices)", Index: 2
2021-04-20 13:31:58.686 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: url = http://127.0.0.1:8080/json.htm?type=command¶m=getlog&lastlogtime=1618918260&loglevel=4
2021-04-20 13:31:58.686 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: method = GET
2021-04-20 13:31:58.686 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: post data = nil
2021-04-20 13:31:58.686 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: headers = nil
2021-04-20 13:31:58.686 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: callback = getDomoticzErrorLog
2021-04-20 13:31:58.686 Status: dzVents: Info: getDomoticzErrorLog: ------ Finished Script #5
2021-04-20 13:31:58.686 Status: EventSystem: Script event triggered: /root/dev-domoticz/dzVents/runtime/dzVents.lua
2021-04-20 13:31:58.725 Status: dzVents: Info: Handling httpResponse-events for: "getDomoticzErrorLog"
2021-04-20 13:31:58.725 Status: dzVents: Info: getDomoticzErrorLog: ------ Start internal script: Script #5: HTTPResponse: "getDomoticzErrorLog"
2021-04-20 13:31:58.727 Status: dzVents: Debug: getDomoticzErrorLog: No resulting loglines found for the set logLevel / searchstrings in the last 58 seconds.
2021-04-20 13:31:58.727 Status: dzVents: Debug: getDomoticzErrorLog: No (new) occurrences of string Error opening url in the domoticz log
2021-04-20 13:31:58.727 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: url = http://www.TESTERROR
2021-04-20 13:31:58.727 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: method = GET
2021-04-20 13:31:58.727 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: post data = nil
2021-04-20 13:31:58.727 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: headers = nil
2021-04-20 13:31:58.727 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: callback = nil
2021-04-20 13:31:58.727 Status: dzVents: Info: getDomoticzErrorLog: ------ Finished Script #5
2021-04-20 13:31:58.727 Status: EventSystem: Script event triggered: /root/dev-domoticz/dzVents/runtime/dzVents.lua
2021-04-20 13:31:58.727 Error: dzVents: Debug: getDomoticzErrorLog: Show ALL:
2021-04-20 13:31:58.727 {
2021-04-20 13:31:58.727 "LastLogTime" : "1618918261",
2021-04-20 13:31:58.727 "result" :
2021-04-20 13:31:58.727 [
2021-04-20 13:31:58.727 {
2021-04-20 13:31:58.727 "level" : 4,
2021-04-20 13:31:58.727 "message" : "2021-04-20 13:31:01.347 Error: dzVents: Debug: getDomoticzErrorLog: Show ALL: \n{\n\t\"LastLogTime\" : \"1618918168\",\n\t\"result\" : \n\t[\n\t\t{\n\t\t\t\"level\" : 4,\n\t\t\t\"message\" : \"2021-04-20 13:29:28.565 Error: dzVents: Debug: getDomoticzErrorLog: Show ALL: \\n{\\n\\t\\\"LastLogTime\\\" : \\\"1618918157\\\",\\n\\t\\\"result\\\" : \\n\\t[\\n\\t\\t{\\n\\t\\t\\t\\\"level\\\" : 4,\\n\\t\\t\\t\\\"message\\\" : \\\"2021-04-20 13:29:17.334 Error: dzVents: Debug: getDomoticzErrorLog: Show ALL: \\\\n{\\\\n\\\\t\\\\\\\"LastLogTime\\\\\\\" : \\\\\\\"1618917940\\\\\\\",\\\\n\\\\t\\\\\\\"result\\\\\\\" : \\\\n\\\\t[\\\\n\\\\t\\\\t{\\\\n\\\\t\\\\t\\\\t\\\\\\\"level\\\\\\\" : 4,\\\\n\\\\t\\\\t\\\\t\\\\\\\"message\\\\\\\" : \\\\\\\"2021-04-20 13:25:13.881 Error: dzVents: Debug: getDomoticzErrorLog: Log Error: Error opening url: http://www.TESTERROR found! \\\\\\\"\\\\n\\\\t\\\\t},\\\\n\\\\t\\\\t{\\\\n\\\\t\\\\t\\\\t\\\\\\\"level\\\\\\\" : 4,\\\\n\\\\t\\\\t\\\\t\\\\\\\"message\\\\\\\" : \\\\\\\"2021-04-20 13:25:14.063 Error: Error opening url: http://test_off_error\\\\\\\"\\\\n\\\\t\\\\t},\\\\n\\\\t\\\\t{\\\\n\\\\t\\\\t\\\\t\\\\\\\"level\\\\\\\" : 4,\\\\n\\\\t\\\\t\\\\t\\\\\\\"message\\\\\\\" : \\\\\\\"2021-04-20 13:25:35.675 Error: Error opening url: http://www.TESTERROR\\\\\\\"\\\\n\\\\t\\\\t},\\\\n\\\\t\\\\t{\\\\n\\\\t\\\\t\\\\t\\\\\\\"level\\\\\\\" : 4,\\\\n\\\\t\\\\t\\\\t\\\\\\\"message\\\\\\\" : \\\\\\\"2021-04-20 13:25:40.648 Error: Error opening url: http://test_off_error\\\\\\\"\\\\n\\\\t\\\\t}\\\\n\\\\t],\\\\n\\\\t\\\\\\\"status\\\\\\\" : \\\\\\\"OK\\\\\\\",\\\\n\\\\t\\\\\\\"title\\\\\\\" : \\\\\\\"GetLog\\\\\\\"\\\\n}\\\\n\\\"\\n\\t\\t},\\n\\t\\t{\\n\\t\\t\\t\\\"level\\\" : 4,\\n\\t\\t\\t\\\"message\\\" : \\\"2021-04-20 13:29:17.356 Error: Error opening url: http://www.TESTERROR\\\"\\n\\t\\t},\\n\\t\\t{\\n\\t\\t\\t\\\"level\\\" : 4,\\n\\t\\t\\t\\\"message\\\" : \\\"2021-04-20 13:29:17.477 Error: Error opening url: http://www.TESTERROR\\\"\\n\\t\\t}\\n\\t],\\n\\t\\\"status\\\" : \\\"OK\\\",\\n\\t\\\"title\\\" : \\\"GetLog\\\"\\n}\\n\"\n\t\t},\n\t\t{\n\t\t\t\"level\" : 4,\n\t\t\t\"message\" : \"2021-04-20 13:29:28.586 Error: Error opening url: http://www.TESTERROR\"\n\t\t},\n\t\t{\n\t\t\t\"level\" : 4,\n\t\t\t\"message\" : \"2021-04-20 13:29:28.707 Error: Error opening url: http://test_off_error\"\n\t\t}\n\t],\n\t\"status\" : \"OK\",\n\t\"title\" : \"GetLog\"\n}\n"
2021-04-20 13:31:58.727 },
2021-04-20 13:31:58.727 {
2021-04-20 13:31:58.727 "level" : 4,
2021-04-20 13:31:58.727 "message" : "2021-04-20 13:31:01.368 Error: Error opening url: http://www.TESTERROR"
2021-04-20 13:31:58.727 },
2021-04-20 13:31:58.727 {
2021-04-20 13:31:58.727 "level" : 4,
2021-04-20 13:31:58.727 "message" : "2021-04-20 13:31:01.489 Error: Error opening url: http://www.TESTERROR"
2021-04-20 13:31:58.727 }
2021-04-20 13:31:58.727 ],
2021-04-20 13:31:58.727 "status" : "OK",
2021-04-20 13:31:58.727 "title" : "GetLog"
2021-04-20 13:31:58.727 }
2021-04-20 13:31:58.727
2021-04-20 13:31:58.747 Error: Error opening url: http://www.TESTERROR
2021-04-20 13:31:58.868 Error: Error opening url: http://test_off_error
2021-04-20 13:31:59.849 (RFlink) Temp + Humidity (Spalna)
2021-04-20 13:32:06.848 Status: EventSystem: reset all events...
2021-04-20 13:32:06.848 Status: dzVents: Write file: /root/dev-domoticz/scripts/dzVents/generated_scripts/Script #4.lua
2021-04-20 13:32:06.848 Status: dzVents: Write file: /root/dev-domoticz/scripts/dzVents/generated_scripts/Script #5.lua
2021-04-20 13:32:16.043 Status: EventSystem: reset all events...
2021-04-20 13:32:16.043 Status: dzVents: Write file: /root/dev-domoticz/scripts/dzVents/generated_scripts/Script #4.lua
2021-04-20 13:32:16.043 Status: dzVents: Write file: /root/dev-domoticz/scripts/dzVents/generated_scripts/Script #5.lua
2021-04-20 13:32:21.902 Status: EventSystem: reset all device statuses...
2021-04-20 13:32:36.236 (Virtual devices) Light/Switch (test_switch)
2021-04-20 13:32:36.236 Status: User: Admin initiated a switch command (2/test_switch/On)
2021-04-20 13:32:36.262 Status: dzVents: Info: Handling events for: "test_switch", value: "On"
2021-04-20 13:32:36.262 Status: dzVents: Info: getDomoticzErrorLog: ------ Start internal script: Script #5: Device: "test_switch (Virtual devices)", Index: 2
2021-04-20 13:32:36.262 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: url = http://127.0.0.1:8080/json.htm?type=command¶m=getlog&lastlogtime=1618918317&loglevel=4
2021-04-20 13:32:36.262 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: method = GET
2021-04-20 13:32:36.262 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: post data = nil
2021-04-20 13:32:36.262 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: headers = nil
2021-04-20 13:32:36.262 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: callback = getDomoticzErrorLog
2021-04-20 13:32:36.262 Status: dzVents: Info: getDomoticzErrorLog: ------ Finished Script #5
2021-04-20 13:32:36.262 Status: EventSystem: Script event triggered: /root/dev-domoticz/dzVents/runtime/dzVents.lua
2021-04-20 13:32:36.299 Status: dzVents: Info: Handling httpResponse-events for: "getDomoticzErrorLog"
2021-04-20 13:32:36.300 Status: dzVents: Info: getDomoticzErrorLog: ------ Start internal script: Script #5: HTTPResponse: "getDomoticzErrorLog"
2021-04-20 13:32:36.302 Status: dzVents: Debug: getDomoticzErrorLog: No resulting loglines found for the set logLevel / searchstrings in the last 39 seconds.
2021-04-20 13:32:36.302 Status: dzVents: Debug: getDomoticzErrorLog: No (new) occurrences of string www.TEST in the domoticz log
2021-04-20 13:32:36.302 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: url = http://www.TESTERROR
2021-04-20 13:32:36.302 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: method = GET
2021-04-20 13:32:36.302 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: post data = nil
2021-04-20 13:32:36.302 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: headers = nil
2021-04-20 13:32:36.302 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: callback = nil
2021-04-20 13:32:36.303 Status: dzVents: Info: getDomoticzErrorLog: ------ Finished Script #5
2021-04-20 13:32:36.303 Status: EventSystem: Script event triggered: /root/dev-domoticz/dzVents/runtime/dzVents.lua
2021-04-20 13:32:36.302 Error: dzVents: Debug: getDomoticzErrorLog: Show ALL:
2021-04-20 13:32:36.302 {
2021-04-20 13:32:36.302 "LastLogTime" : "1618918318",
2021-04-20 13:32:36.302 "result" :
2021-04-20 13:32:36.302 [
2021-04-20 13:32:36.302 {
2021-04-20 13:32:36.302 "level" : 4,
2021-04-20 13:32:36.302 "message" : "2021-04-20 13:31:58.727 Error: dzVents: Debug: getDomoticzErrorLog: Show ALL: \n{\n\t\"LastLogTime\" : \"1618918261\",\n\t\"result\" : \n\t[\n\t\t{\n\t\t\t\"level\" : 4,\n\t\t\t\"message\" : \"2021-04-20 13:31:01.347 Error: dzVents: Debug: getDomoticzErrorLog: Show ALL: \\n{\\n\\t\\\"LastLogTime\\\" : \\\"1618918168\\\",\\n\\t\\\"result\\\" : \\n\\t[\\n\\t\\t{\\n\\t\\t\\t\\\"level\\\" : 4,\\n\\t\\t\\t\\\"message\\\" : \\\"2021-04-20 13:29:28.565 Error: dzVents: Debug: getDomoticzErrorLog: Show ALL: \\\\n{\\\\n\\\\t\\\\\\\"LastLogTime\\\\\\\" : \\\\\\\"1618918157\\\\\\\",\\\\n\\\\t\\\\\\\"result\\\\\\\" : \\\\n\\\\t[\\\\n\\\\t\\\\t{\\\\n\\\\t\\\\t\\\\t\\\\\\\"level\\\\\\\" : 4,\\\\n\\\\t\\\\t\\\\t\\\\\\\"message\\\\\\\" : \\\\\\\"2021-04-20 13:29:17.334 Error: dzVents: Debug: getDomoticzErrorLog: Show ALL: \\\\\\\\n{\\\\\\\\n\\\\\\\\t\\\\\\\\\\\\\\\"LastLogTime\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"1618917940\\\\\\\\\\\\\\\",\\\\\\\\n\\\\\\\\t\\\\\\\\\\\\\\\"result\\\\\\\\\\\\\\\" : \\\\\\\\n\\\\\\\\t[\\\\\\\\n\\\\\\\\t\\\\\\\\t{\\\\\\\\n\\\\\\\\t\\\\\\\\t\\\\\\\\t\\\\\\\\\\\\\\\"level\\\\\\\\\\\\\\\" : 4,\\\\\\\\n\\\\\\\\t\\\\\\\\t\\\\\\\\t\\\\\\\\\\\\\\\"message\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"2021-04-20 13:25:13.881 Error: dzVents: Debug: getDomoticzErrorLog: Log Error: Error opening url: http://www.TESTERROR found! \\\\\\\\\\\\\\\"\\\\\\\\n\\\\\\\\t\\\\\\\\t},\\\\\\\\n\\\\\\\\t\\\\\\\\t{\\\\\\\\n\\\\\\\\t\\\\\\\\t\\\\\\\\t\\\\\\\\\\\\\\\"level\\\\\\\\\\\\\\\" : 4,\\\\\\\\n\\\\\\\\t\\\\\\\\t\\\\\\\\t\\\\\\\\\\\\\\\"message\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"2021-04-20 13:25:14.063 Error: Error opening url: http://test_off_error\\\\\\\\\\\\\\\"\\\\\\\\n\\\\\\\\t\\\\\\\\t},\\\\\\\\n\\\\\\\\t\\\\\\\\t{\\\\\\\\n\\\\\\\\t\\\\\\\\t\\\\\\\\t\\\\\\\\\\\\\\\"level\\\\\\\\\\\\\\\" : 4,\\\\\\\\n\\\\\\\\t\\\\\\\\t\\\\\\\\t\\\\\\\\\\\\\\\"message\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"2021-04-20 13:25:35.675 Error: Error opening url: http://www.TESTERROR\\\\\\\\\\\\\\\"\\\\\\\\n\\\\\\\\t\\\\\\\\t},\\\\\\\\n\\\\\\\\t\\\\\\\\t{\\\\\\\\n\\\\\\\\t\\\\\\\\t\\\\\\\\t\\\\\\\\\\\\\\\"level\\\\\\\\\\\\\\\" : 4,\\\\\\\\n\\\\\\\\t\\\\\\\\t\\\\\\\\t\\\\\\\\\\\\\\\"message\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"2021-04-20 13:25:40.648 Error: Error opening url: http://test_off_error\\\\\\\\\\\\\\\"\\\\\\\\n\\\\\\\\t\\\\\\\\t}\\\\\\\\n\\\\\\\\t],\\\\\\\\n\\\\\\\\t\\\\\\\\\\\\\\\"status\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"OK\\\\\\\\\\\\\\\",\\\\\\\\n\\\\\\\\t\\\\\\\\\\\\\\\"title\\\\\\\\\\\\\\\" : \\\\\\\\\\\\\\\"GetLog\\\\\\\\\\\\\\\"\\\\\\\\n}\\\\\\\\n\\\\\\\"\\\\n\\\\t\\\\t},\\\\n\\\\t\\\\t{\\\\n\\\\t\\\\t\\\\t\\\\\\\"level\\\\\\\" : 4,\\\\n\\\\t\\\\t\\\\t\\\\\\\"message\\\\\\\" : \\\\\\\"2021-04-20 13:29:17.356 Error: Error opening url: http://www.TESTERROR\\\\\\\"\\\\n\\\\t\\\\t},\\\\n\\\\t\\\\t{\\\\n\\\\t\\\\t\\\\t\\\\\\\"level\\\\\\\" : 4,\\\\n\\\\t\\\\t\\\\t\\\\\\\"message\\\\\\\" : \\\\\\\"2021-04-20 13:29:17.477 Error: Error opening url: http://www.TESTERROR\\\\\\\"\\\\n\\\\t\\\\t}\\\\n\\\\t],\\\\n\\\\t\\\\\\\"status\\\\\\\" : \\\\\\\"OK\\\\\\\",\\\\n\\\\t\\\\\\\"title\\\\\\\" : \\\\\\\"GetLog\\\\\\\"\\\\n}\\\\n\\\"\\n\\t\\t},\\n\\t\\t{\\n\\t\\t\\t\\\"level\\\" : 4,\\n\\t\\t\\t\\\"message\\\" : \\\"2021-04-20 13:29:28.586 Error: Error opening url: http://www.TESTERROR\\\"\\n\\t\\t},\\n\\t\\t{\\n\\t\\t\\t\\\"level\\\" : 4,\\n\\t\\t\\t\\\"message\\\" : \\\"2021-04-20 13:29:28.707 Error: Error opening url: http://test_off_error\\\"\\n\\t\\t}\\n\\t],\\n\\t\\\"status\\\" : \\\"OK\\\",\\n\\t\\\"title\\\" : \\\"GetLog\\\"\\n}\\n\"\n\t\t},\n\t\t{\n\t\t\t\"level\" : 4,\n\t\t\t\"message\" : \"2021-04-20 13:31:01.368 Error: Error opening url: http://www.TESTERROR\"\n\t\t},\n\t\t{\n\t\t\t\"level\" : 4,\n\t\t\t\"message\" : \"2021-04-20 13:31:01.489 Error: Error opening url: http://www.TESTERROR\"\n\t\t}\n\t],\n\t\"status\" : \"OK\",\n\t\"title\" : \"GetLog\"\n}\n"
2021-04-20 13:32:36.302 },
2021-04-20 13:32:36.302 {
2021-04-20 13:32:36.302 "level" : 4,
2021-04-20 13:32:36.302 "message" : "2021-04-20 13:31:58.747 Error: Error opening url: http://www.TESTERROR"
2021-04-20 13:32:36.302 },
2021-04-20 13:32:36.302 {
2021-04-20 13:32:36.302 "level" : 4,
2021-04-20 13:32:36.302 "message" : "2021-04-20 13:31:58.868 Error: Error opening url: http://test_off_error"
2021-04-20 13:32:36.302 }
2021-04-20 13:32:36.302 ],
2021-04-20 13:32:36.302 "status" : "OK",
2021-04-20 13:32:36.302 "title" : "GetLog"
2021-04-20 13:32:36.302 }
2021-04-20 13:32:36.302
2021-04-20 13:32:36.317 Error: Error opening url: http://www.TESTERROR
Code: Select all
2021-04-20 14:07:54.697 (Virtual devices) Light/Switch (test_switch)
2021-04-20 14:07:54.696 Status: User: Admin initiated a switch command (2/test_switch/On)
2021-04-20 14:07:54.719 Status: dzVents: Info: Handling events for: "test_switch", value: "On"
2021-04-20 14:07:54.719 Status: dzVents: Info: getDomoticzErrorLog: ------ Start internal script: Script #5: Device: "test_switch (Virtual devices)", Index: 2
2021-04-20 14:07:54.719 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: url = http://127.0.0.1:8080/json.htm?type=command¶m=getlog&lastlogtime=1618919908&loglevel=4
2021-04-20 14:07:54.719 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: method = GET
2021-04-20 14:07:54.719 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: post data = nil
2021-04-20 14:07:54.719 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: headers = nil
2021-04-20 14:07:54.719 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: callback = getDomoticzErrorLog
2021-04-20 14:07:54.720 Status: dzVents: Info: getDomoticzErrorLog: ------ Finished Script #5
2021-04-20 14:07:54.720 Status: EventSystem: Script event triggered: /root/dev-domoticz/dzVents/runtime/dzVents.lua
2021-04-20 14:07:54.752 Status: Incoming connection from: 127.0.0.1
2021-04-20 14:07:54.770 Status: dzVents: Info: Handling httpResponse-events for: "getDomoticzErrorLog"
2021-04-20 14:07:54.770 Status: dzVents: Info: getDomoticzErrorLog: ------ Start internal script: Script #5: HTTPResponse: "getDomoticzErrorLog"
2021-04-20 14:07:54.770 Status: dzVents: Debug: getDomoticzErrorLog: No resulting loglines found for the set logLevel in the last 566 seconds.
2021-04-20 14:07:54.770 Status: dzVents: Debug: getDomoticzErrorLog: Show ALL:
2021-04-20 14:07:54.770 {
2021-04-20 14:07:54.770 "status" : "OK",
2021-04-20 14:07:54.770 "title" : "GetLog"
2021-04-20 14:07:54.770 }
2021-04-20 14:07:54.770
2021-04-20 14:07:54.770 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: url = http://www.TESTERROR
2021-04-20 14:07:54.770 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: method = GET
2021-04-20 14:07:54.770 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: post data = nil
2021-04-20 14:07:54.770 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: headers = nil
2021-04-20 14:07:54.770 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: callback = nil
2021-04-20 14:07:54.771 Status: dzVents: Info: getDomoticzErrorLog: ------ Finished Script #5
2021-04-20 14:07:54.771 Status: EventSystem: Script event triggered: /root/dev-domoticz/dzVents/runtime/dzVents.lua
2021-04-20 14:07:54.770 Error: dzVents: Debug: getDomoticzErrorLog: No (new) occurrences of string Error: Error opening url: http://www.TESTERROR in the domoticz log
2021-04-20 14:07:54.794 Error: Error opening url: http://www.TESTERROR
2021-04-20 14:07:54.915 Error: Error opening url: http://www.TESTERROR
2021-04-20 14:08:15.825 (Virtual devices) Light/Switch (test_switch)
2021-04-20 14:08:15.924 Notification sent (browser) => Success
2021-04-20 14:08:15.824 Status: User: Admin initiated a switch command (2/test_switch/Off)
2021-04-20 14:08:15.846 Status: dzVents: Info: Handling events for: "test_switch", value: "Off"
2021-04-20 14:08:15.847 Status: dzVents: Info: getDomoticzErrorLog: ------ Start internal script: Script #5: Device: "test_switch (Virtual devices)", Index: 2
2021-04-20 14:08:15.847 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: url = http://127.0.0.1:8080/json.htm?type=command¶m=getlog&lastlogtime=1618920473&loglevel=4
2021-04-20 14:08:15.847 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: method = GET
2021-04-20 14:08:15.847 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: post data = nil
2021-04-20 14:08:15.847 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: headers = nil
2021-04-20 14:08:15.847 Status: dzVents: Debug: getDomoticzErrorLog: OpenURL: callback = getDomoticzErrorLog
2021-04-20 14:08:15.847 Status: dzVents: Info: getDomoticzErrorLog: ------ Finished Script #5
2021-04-20 14:08:15.847 Status: EventSystem: Script event triggered: /root/dev-domoticz/dzVents/runtime/dzVents.lua
2021-04-20 14:08:15.904 Status: dzVents: Info: Handling httpResponse-events for: "getDomoticzErrorLog"
2021-04-20 14:08:15.904 Status: dzVents: Info: getDomoticzErrorLog: ------ Start internal script: Script #5: HTTPResponse: "getDomoticzErrorLog"
2021-04-20 14:08:15.905 Status: dzVents: Info: getDomoticzErrorLog: ------ Finished Script #5
2021-04-20 14:08:15.905 Status: EventSystem: Script event triggered: /root/dev-domoticz/dzVents/runtime/dzVents.lua
2021-04-20 14:08:15.924 Status: Notification: Log 2021-04-20 14:07:54.915 Error: Error opening url: http://www.TESTERROR found!
2021-04-20 14:08:15.905 Error: dzVents: Debug: getDomoticzErrorLog: Log Error: Error opening url: http://www.TESTERROR found!
2021-04-20 14:08:16.505 Notification sent (fcm) => Success
2021-04-20 14:08:16.049 Error: Error opening url: http://test_off_error
Users browsing this forum: No registered users and 1 guest