Platform: raspberry pi
Description:
Hello,
I just updated to the latest Beta (V2025.2 build 16997).
Since the update, I’ve noticed that some LUA actions triggered by devicechanged on Selector Switches are no longer working.
To investigate, I created 3 new virtual selectors: TEST, TEST2 and TEST3.
I then wrote a minimalist script_device_test.lua to monitor them:
Code: Select all
-- Initialize the command array for Domoticz
commandArray = {}
-- Define the device name exactly as it appears in Domoticz
local target_device = 'TEST'
local target_device2 = 'TEST2'
local target_device3 = 'TEST3'
-- Check if the device that changed is our target device
if (devicechanged[target_device]) then
-- Retrieve the status value (svalue) of the selector
-- For selector switches, svalues usually return the level (0, 10, 20...)
local sValue = otherdevices_svalues[target_device]
-- Convert string value to a number for logic operations
local level = tonumber(sValue)
-- Log the results to the Domoticz log console for debugging
print("------------------------------------------------------------")
print("EVENT TRIGGERED: Device TEST has changed.")
print("Detected Level (Number): " .. tostring(level))
print("Raw Value (String): " .. tostring(sValue))
print("------------------------------------------------------------")
end
if (devicechanged[target_device2]) then
-- Retrieve the status value (svalue) of the selector
-- For selector switches, svalues usually return the level (0, 10, 20...)
local sValue = otherdevices_svalues[target_device2]
-- Convert string value to a number for logic operations
local level = tonumber(sValue)
-- Log the results to the Domoticz log console for debugging
print("------------------------------------------------------------")
print("EVENT TRIGGERED: Device TEST2 has changed.")
print("Detected Level (Number): " .. tostring(level))
print("Raw Value (String): " .. tostring(sValue))
print("------------------------------------------------------------")
end
if (devicechanged[target_device3]) then
-- Retrieve the status value (svalue) of the selector
-- For selector switches, svalues usually return the level (0, 10, 20...)
local sValue = otherdevices_svalues[target_device3]
-- Convert string value to a number for logic operations
local level = tonumber(sValue)
-- Log the results to the Domoticz log console for debugging
print("------------------------------------------------------------")
print("EVENT TRIGGERED: Device TEST3 has changed.")
print("Detected Level (Number): " .. tostring(level))
print("Raw Value (String): " .. tostring(sValue))
print("------------------------------------------------------------")
end
-- Return the command array to Domoticz engine
return commandArrayif I click LEVEL1 on the 3 selectors, only one generates an action and domoticz ignores the 2 others
2026-01-01 19:55:41.944 VIRTUAL: Light/Switch (TEST)
2026-01-01 19:55:42.095 Status: LUA: ------------------------------------------------------------
2026-01-01 19:55:42.095 Status: LUA: EVENT TRIGGERED: Device TEST has changed.
2026-01-01 19:55:42.095 Status: LUA: Detected Level (Number): 10
2026-01-01 19:55:42.095 Status: LUA: Raw Value (String): 10
2026-01-01 19:55:42.095 Status: LUA: ------------------------------------------------------------
2026-01-01 19:55:43.013 Status: User: sebastien (IP: 192.168.0.100) initiated a switch command (1710/TEST2/Set Level)
2026-01-01 19:55:43.021 VIRTUAL: Light/Switch (TEST2)
2026-01-01 19:55:43.844 Status: User: sebastien (IP: 192.168.0.100) initiated a switch command (1711/TEST3/Set Level)
2026-01-01 19:55:43.849 VIRTUAL: Light/Switch (TEST3)
2026-01-01 19:55:47.712 Motherboard: General/Percentage (Memory Usage)
TEST works perfectly: the log displays the --- DEBUG and MATCH FOUND lines.
TEST2 and TEST3 are ignored: While the Domoticz general log shows the command being received (Status: User: sebastien initiated a switch command...), the LUA script does not trigger at all for these devices.
I have already tried restarting the service and recreating the devices on a new Dummy hardware, but the problem remains.
I have the same behavior on some other selectors that no longer react (while showing trigger in log)
maybe there were changes in events management in this beta?
open to test anything that could help resolving this bug
thanks for your help !
Kind regards
sebastien