return {
on = {
timer = {
'between 13:00 and 60 minutes before sunset every 05 minutes',
},
},
logging = {
level = domoticz.LOG_FORCE, -- Select one of LOG_DEBUG, LOG_INFO, LOG_ERROR, LOG_FORCE to override system log level
marker = "Blinder"
},
execute = function(dz, device)
local function logWrite(str,level)
dz.log(tostring(str),level or dz.LOG_MODULE_EXEC_INFO)
end
local lux = dz.devices(249)
local blinder = dz.devices(83)
logWrite('10............... LUX ' .. lux )
if lux <= "1600" then
logWrite('20................It is cloudy outside')
blinder.open()
else
logWrite('30................It is sunny outside')
blinder.close()
end
end
}
Raspberry PI 2 with RaZberry Controller 2016 ZWave+ and CC2531(zigbee)
Several IKEA devices/z-wave devices
waltervl wrote: ↑Wednesday 16 April 2025 20:46
Remove the logwrite function. No need for that.
Use the build in domoticz.log() function as everybody else is using.
There is a logging example template (when you create a new dzvents script) to show the way of working.
Did some AI "help" you creating this script?
This is an old script I found here I think
Raspberry PI 2 with RaZberry Controller 2016 ZWave+ and CC2531(zigbee)
Several IKEA devices/z-wave devices
I have a blinder in my living room and a Philips light sensor on the balcony attached to the living room.
The room is facing west so I get a lot of sun in the summer.
Have a bloky that works ish, the blinder keeps going up and down when the lux flux close to the trigger value.
I like the script to wait 15 min( x minutes) after it closed the blinder to prevent it go up and down every minute.
It need to be over 20 C as well
Raspberry PI 2 with RaZberry Controller 2016 ZWave+ and CC2531(zigbee)
Several IKEA devices/z-wave devices