Dzvents
Posted: Tuesday 28 June 2022 15:32
Hi All,
I am quiet a new bee and I am struggling with some Dzvents code.
problem is a have device
I have the following code:
I hoped to see the oldvalue in the logfile but i just got an error
2022-06-28 15:15:00.500 Error: dzVents: Error: (3.1.8) ...86)\Domoticz\scripts\dzVents\scripts/VirtualSwitches.lua:12: attempt to concatenate a table value (local 'oldvalue'
What I am doing wrong?
I am quiet a new bee and I am struggling with some Dzvents code.
problem is a have device
I have the following code:
Code: Select all
return {
on = {
timer = { 'every 1 minutes at daytime' },
},
execute = function(domoticz, device)
local CurPower = domoticz.devices('ScreenBijkeuken')
local oldvalue = domoticz.devices('SMACurPower')
domoticz.log('Sensor value: ' .. oldvalue, domoticz.LOG_DEBUG)
-- CurPower.updateCustomSensor(oldvalue) -- this is step 2 update an virtual device
domoticz.log('Device ' .. oldvalue.value .. ' was changed', domoticz.LOG_INFO)
end
}
2022-06-28 15:15:00.500 Error: dzVents: Error: (3.1.8) ...86)\Domoticz\scripts\dzVents\scripts/VirtualSwitches.lua:12: attempt to concatenate a table value (local 'oldvalue'
What I am doing wrong?