Timer switch error 32256  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
User avatar
Dutchsea
Posts: 120
Joined: Tuesday 08 December 2015 13:22
Target OS: Raspberry Pi / ODroid
Domoticz version: v2023.2
Location: The Netherlands
Contact:

Timer switch error 32256

Post by Dutchsea »

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:

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
}
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

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
Thanks
Raspberry PI 3B on USB drive, Debian version: 12 (bookworm), Domoticz 2024.7
Aeon Z-Wave G5 stick, RFXCOM, Sonof Zigbee 3.0 Dongle plus E, Nefit Easy, Fritzbox, Buienradar, Sonos
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Timer switch error 32256  [Solved]

Post by waaren »

Dutchsea wrote: Saturday 31 October 2020 20:49 I created a simple script to deactivate a device after x amount of time after it has been triggered in the domoticz dashboard.
(script is called via the "On action:" in the "Edit" page of the device).
Lua / dzVents scripts should not be called via the action fields of a device. This is to be used for external (OS type of) scripts.

The action you are looking for can be done without any script. Just set the off delay in the edit screen of the device. (from the switches tab)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
Dutchsea
Posts: 120
Joined: Tuesday 08 December 2015 13:22
Target OS: Raspberry Pi / ODroid
Domoticz version: v2023.2
Location: The Netherlands
Contact:

Re: Timer switch error 32256

Post by Dutchsea »

Lua / dzVents scripts should not be called via the action fields of a device. This is to be used for external (OS type of) scripts.
=> clear
The action you are looking for can be done without any script. Just set the off delay in the edit screen of the device. (from the switches tab)
OK, i will do that. (I understood these parameters to control the amount of delay in seconds before turning on the device after it has been triggered to go on - and same delay when device is triggered to go off.)
Raspberry PI 3B on USB drive, Debian version: 12 (bookworm), Domoticz 2024.7
Aeon Z-Wave G5 stick, RFXCOM, Sonof Zigbee 3.0 Dongle plus E, Nefit Easy, Fritzbox, Buienradar, Sonos
User avatar
Dutchsea
Posts: 120
Joined: Tuesday 08 December 2015 13:22
Target OS: Raspberry Pi / ODroid
Domoticz version: v2023.2
Location: The Netherlands
Contact:

SOLVED Timer switch error 32256

Post by Dutchsea »

And works. Thank you
Raspberry PI 3B on USB drive, Debian version: 12 (bookworm), Domoticz 2024.7
Aeon Z-Wave G5 stick, RFXCOM, Sonof Zigbee 3.0 Dongle plus E, Nefit Easy, Fritzbox, Buienradar, Sonos
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest