I am facing the following problem.
I had a RPI3+ en bought a new RPI 4. Did a fresh install, install of the latest Domoticz version beta. Next I copied my RPI3+ dzVents scripts to the new RPI 4. Then added my Zwave and Zigbee devices and tested them.
The problem is that some scripts are working and some don't. I give you a example:
Code: Select all
return {
on = {
timer = {'every minute'},
devices = {'Gang- lamp gang',
131, -- Sensor gang
'Overloop dimmer'}
},
logging = {
level = domoticz.LOG_ERROR,
marker = 'Verlichting gang',
},
execute = function(dz)
local sensor = dz.devices(131)
local lamp = dz.devices('Gang- lamp gang')
local lamp2 = dz.devices('Overloop dimmer')
--local currentLux = dz.devices('Lux gang').lux
--local lux = 35
if dz.time.matchesRule("between 02:00 and 15 minutes before sunset") then
if sensor.active then --and currentLux <= lux--
lamp.dimTo(40)
lamp2.switchOn()
lamp.dimTo(10).afterMin(1)
lamp2.switchOff().afterMin(3)
else lamp.switchOff().checkFirst()
end
elseif dz.time.matchesRule("between 15 minutes before sunset and 23:30") then
if sensor.active then --and currentLux <= lux--
lamp.dimTo(50)
lamp.dimTo(10).afterMin(1)
lamp2.switchOn()
lamp2.switchOff().afterMin(3)
end
elseif dz.time.matchesRule("between 23:30 and 02:00") then
if sensor.active then
lamp.dimTo(30)
lamp2.switchOn()
lamp.dimTo(5).afterMin(1)
lamp2.switchOff().afterMin(3)
end
end
end
}
Next the error I'am getting. Note that I am using both devicename and idx, it makes no difference for the error
Code: Select all
2022-04-01 22:14:00.238 Error: dzVents: Error: (3.1.8) Verlichting gang: There is no device with that name or id: 131
2022-04-01 22:14:00.239 Error: dzVents: Error: (3.1.8) Verlichting gang: An error occurred when calling event handler Lamp gang
2022-04-01 22:14:00.239 Error: dzVents: Error: (3.1.8) Verlichting gang: ...domoticz/scripts/dzVents/generated_scripts/Lamp gang.lua:30: attempt to index a nil value (local 'sensor')I am using both Zwave and Zigbee devices in the scripts, no difference when there are only Zwave devices or Zwave/Zigbee devices or only Zigbee devices in the script.131 Aeotec Zwave Gen.5 00011635 1 Sensor gang Light/Switch Switch On
Hope someone can point me in the right direction to solve this problem.
Grz. Piet