Timer switch error 32256
Posted: Saturday 31 October 2020 20:49
I created a simple script to deactivate a device after x amount of time after it has beentriggered in the domoticz dashboard.
(script is called via the "On action:" in the "Edit" page of the device).
Its purpose is to deactivate a heater in my bathroom after it has been activated via the Domoticz dashboard. Not sure if the script is a good method to deactivate the device. Maybe there is a better way but this is what I could think of.......
The script works but when it is activated it generates an error 32256. This seems to be an ownership issue but this script has the same ownerships as my other dzVents scripts and those do not generate this error.
Script:
What can cause this error?
Next question; even when the device 'Kachel badkamer' is not activated, every minute there are entries in the log. So for some reason each minute this scripts is activated. Is this expected behaviour?
Log
Thanks
(script is called via the "On action:" in the "Edit" page of the device).
Its purpose is to deactivate a heater in my bathroom after it has been activated via the Domoticz dashboard. Not sure if the script is a good method to deactivate the device. Maybe there is a better way but this is what I could think of.......
The script works but when it is activated it generates an error 32256. This seems to be an ownership issue but this script has the same ownerships as my other dzVents scripts and those do not generate this error.
Script:
Code: Select all
-- [ dzVents >= 2.4 ]
-- dzVents Timer: set device to off after x minutes after on
-- script://dzVents/scripts/timer01-on.lua
return {
--- Script active yes/no
active = {
true,
},
--- Trigger device
on = {
devices = {
'Kachel badkamer' -- Device to be turned off after x minutes
},
},
--- Custom logging for script
logging = {
level = domoticz.LOG_DEBUG,
marker = "Timer01-on"
},
--- Execute functions
execute = function(domoticz, item)
domoticz.devices('Kachel badkamer').switchOff().afterMin(2) -- change x in .afterMin(x) to number of minutes required
end
}
Next question; even when the device 'Kachel badkamer' is not activated, every minute there are entries in the log. So for some reason each minute this scripts is activated. Is this expected behaviour?
Log
Code: Select all
2020-10-31 20:42:16.616 Status: dzVents: Info: Handling events for: "Kachel badkamer", value: "Off"
2020-10-31 20:42:16.616 Status: dzVents: Info: Timer01-on: ------ Start external script: timer01-on.lua: Device: "Kachel badkamer (Aeon Z-stick 5Gen)", Index: 3
2020-10-31 20:42:16.616 Status: dzVents: Debug: Timer01-on: Constructed timed-command: Off
2020-10-31 20:42:16.616 Status: dzVents: Debug: Timer01-on: Constructed timed-command: Off AFTER 120 SECONDS
2020-10-31 20:42:16.616 Status: dzVents: Info: Timer01-on: ------ Finished timer01-on.lua
2020-10-31 20:42:16.617 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua