Code: Select all
2021-09-13 12:56:31.895 Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: ...oticz/dzVents/runtime/device-adapters/generic_device.lua:67: attempt to index a nil value (field '_')
Moderator: leecollings
Code: Select all
2021-09-13 12:56:31.895 Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: ...oticz/dzVents/runtime/device-adapters/generic_device.lua:67: attempt to index a nil value (field '_')
Code: Select all
if (data.lastUpdate == '' or data.lastUpdate == nil) then
if data.baseType ~= 'camera' and data.baseType ~= 'hardware' then
utils.log('Discarding device. No last update info found: ' .. utils._.str(data), utils.LOG_DEBUG)
end
return nil
end
Code: Select all
return {
on = {
timer = {
'every minute'
}
},
logging = {
level = domoticz.LOG_INFO,
marker = 'test',
},
execute = function(domoticz, device)
domoticz.devices().forEach(
function(device)
if device.lastUpdate == '' or device.lastUpdate == nil then
if device.baseType ~= 'camera' and device.baseType ~= 'hardware' then
domoticz.log('"' .. device.name .. '", deviceType = ' .. device.deviceType .. ', baseType = ' .. device.baseType .. ' has no valid lastUpdate.', domoticz.LOG_ERROR)
end
end
end
)
end
}
I got the same error in my log, I have a space in a camera name no special characters but also spaces in hardware names.waltervl wrote: ↑Monday 13 September 2021 15:30 Looks to be linked to this piece of code (line 67 is the utils.log line). My Lua knowledge is too low yo see what is going on here that could trigger your error.
Do you have a camera or hardware (menu setup - hardware) with special characters in its name?
Code: Select all
2021-09-13 20:38:50.992 Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: ...oticz/dzVents/runtime/device-adapters/generic_device.lua:67: attempt to index a nil value (field '_')
2021-09-13 20:39:04.600 Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: ...oticz/dzVents/runtime/device-adapters/generic_device.lua:67: attempt to index a nil value (field '_')
2021-09-13 20:39:09.925 Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: ...oticz/dzVents/runtime/device-adapters/generic_device.lua:67: attempt to index a nil value (field '_')
2021-09-13 22:07:26.655 Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: ...oticz/dzVents/runtime/device-adapters/generic_device.lua:67: attempt to index a nil value (field '_')
Code: Select all
2021-09-15 20:23:33.804 Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: ...oticz/dzVents/runtime/device-adapters/generic_device.lua:67: attempt to index a nil value (field '_')
2021-09-15 20:23:39.102 (Evohome) fetch data from server
2021-09-15 20:24:00.232 Status: dzVents: Info: test: ------ Start internal script: Script #1:, trigger: "every minute"
2021-09-15 20:24:00.327 Status: dzVents: Info: test: ------ Finished Script #1
Code: Select all
if data.baseType ~= 'camera' and data.baseType ~= 'hardware' then
utils.log('Discarding device. No last update info found: ' .. domoticz.utils._.str(data), level)
end
Code: Select all
if data.baseType ~= 'camera' and data.baseType ~= 'hardware' then
local name
if nil == device then
name = '<unknown>'
else
name = device.name
end
utils.log('Discarding device ' .. tostring(name) ..'. No last update info found: ' .. domoticz.utils._.toStr(data), level) -- 1st alternative
-- utils.log('Discarding device ' .. tostring(name) ..'. No last update info found: ' .. tostring(data), level) -- 2nd alternative
-- utils.log('Discarding device. No last update info found: ' .. domoticz.utils._.str(data), level)
end
Code: Select all
2021-09-16 14:12:51.868 Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: ...oticz/dzVents/runtime/device-adapters/generic_device.lua:73: attempt to call a table value (global 'string')
Code: Select all
2021-09-16 14:06:52.319 Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: ...oticz/dzVents/runtime/device-adapters/generic_device.lua:74: attempt to call a table value (global 'string')
Code: Select all
.. string(name) ..
Code: Select all
.. tostring(name) ..
That's disappointing....fvdp80 wrote: ↑Wednesday 15 September 2021 20:27 Ran the code and, fter a while, it got me this in domoticz log:
No output.Code: Select all
2021-09-15 20:23:33.804 Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: ...oticz/dzVents/runtime/device-adapters/generic_device.lua:67: attempt to index a nil value (field '_') 2021-09-15 20:23:39.102 (Evohome) fetch data from server 2021-09-15 20:24:00.232 Status: dzVents: Info: test: ------ Start internal script: Script #1:, trigger: "every minute" 2021-09-15 20:24:00.327 Status: dzVents: Info: test: ------ Finished Script #1
Code: Select all
2021-09-16 14:32:52.047 Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: ...oticz/dzVents/runtime/device-adapters/generic_device.lua:73: attempt to call a nil value (field 'toStr')
Code: Select all
2021-09-16 14:38:27.765 Status: dzVents: Info: Discarding device Blitzwolf 1 (Power). No last update info found: table: 0x72267b80
2021-09-16 14:38:27.875 Status: dzVents: Info: Discarding device Blitzwolf 1 (Voltage). No last update info found: table: 0x7221e1d0
2021-09-16 14:38:27.890 Status: dzVents: Info: Discarding device Blitzwolf 1 (Current). No last update info found: table: 0x7221e8d8
2021-09-16 14:38:52.089 Status: dzVents: Info: Discarding device Blitzwolf 2 (Voltage). No last update info found: table: 0x7225c4a0
2021-09-16 14:39:52.118 Status: dzVents: Info: Discarding device Blitzwolf 2 (Current). No last update info found: table: 0x7225c8a8
Yeah, that one was a bit 'experimental'. (read: Me trying to guess the actual workings of the ._. construction) And it apparantly doesn't work the way I guessed it did.fvdp80 wrote: ↑Thursday 16 September 2021 14:34 I hate to say it, but still got errors:
Code: Select all
2021-09-16 14:32:52.047 Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: ...oticz/dzVents/runtime/device-adapters/generic_device.lua:73: attempt to call a nil value (field 'toStr')
That's what the toStr() function in Utils.lua does: it prints the table and it's contents in a tree-like way. I was hoping to fix the call into that function by the 1st alternative, but apparantly it wasn't just a simple rename of that function from str() into toStr() that broke this call. Hopefully @dannybloe or @waaren are reading here still, as they for sure know how to really fix this small bug.
Code: Select all
2021-09-17 07:47:31.381 Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: ...oticz/dzVents/runtime/device-adapters/generic_device.lua:67: attempt to index a nil value (field '_')
2021-09-17 07:47:33.957 Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: ...oticz/dzVents/runtime/device-adapters/generic_device.lua:67: attempt to index a nil value (field '_')
2021-09-17 07:47:34.096 Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: ...oticz/dzVents/runtime/device-adapters/generic_device.lua:67: attempt to index a nil value (field '_')
2021-09-17 07:47:35.222 Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: ...oticz/dzVents/runtime/device-adapters/generic_device.lua:67: attempt to index a nil value (field '_')
2021-09-17 07:47:59.700 Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: ...oticz/dzVents/runtime/device-adapters/generic_device.lua:67: attempt to index a nil value (field '_')
2021-09-17 07:47:59.830 Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: ...oticz/dzVents/runtime/device-adapters/generic_device.lua:67: attempt to index a nil value (field '_')
2021-09-17 07:47:59.951 Error: EventSystem: in /home/pi/domoticz/dzVents/runtime/dzVents.lua: ...oticz/dzVents/runtime/device-adapters/generic_device.lua:67: attempt to index a nil value (field '_')
Users browsing this forum: No registered users and 1 guest