01.04.2023, 12:06
(This post was last modified: 01.04.2023, 12:16 by CristianAgata.)
(30.03.2023, 05:55)admin Wrote: Try this. Change title variable to the title of your scene widget (case sensitive). If you have multiple scenes with the same title then this script will run all such scenes.
Code:title = 'my scene'
config = storage.exec('get', 'mosaic30:config:0')
config = require('json').decode(config)
function checkwidget(widget)
if widget.type ~= 'user_scene' then
return
elseif widget.title ~= title then
return
end
for addr, value in pairs(widget.settings.objects) do
grp.write(addr, value)
end
end
for _, floor in ipairs(config.floors or {}) do
for _, room in ipairs(floor.rooms or {}) do
for _, widget in ipairs(room.widgets or {}) do
checkwidget(widget)
end
end
end
Hi admin,
tested and it works, thank you so much.
Could I suggest an improve?
It could be interesting add some delay between a command and other. It could be useful for scene that interest TV command for example.
BR Cristian