I am stuck on the basics of DZvents.
I can manually switch 'tasmota_switch_kelder' On and Off
Ground_temperature is taken from the Buienradar value which comes as a single value on its own.
2021-06-21 07:46:17.536 buienradar: Temp (ground_temperature)
However the below code gives this error in the log.
Where line 9 error = if (device.name == 'ground_temperature' and device.temperature <17) then
2021-06-21 07:43:00.631 Error: dzVents: Error: (3.1.7) An error occurred when calling event handler Kelder
2021-06-21 07:43:00.631 Error: dzVents: Error: (3.1.7) ...pi/domoticz/scripts/dzVents/generated_scripts/Kelder.lua:9: attempt to index a nil value (global 'device')
Code: Select all
return
{
on =
{
timer = {'every minute'}
},
execute = function(dz, item)
if (device.name == 'ground_temperature' and device.temperature <17) then
dz.devices('tasmota_switch_kelder').switchOn()
else
dz.devices('tasmota_switch_kelder').switchOff()
end
end
}
Paco