This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Scene on Mosaic
#2
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
Reply


Messages In This Thread
Scene on Mosaic - by CristianAgata - 29.03.2023, 17:07
RE: Scene on Mosaic - by admin - 30.03.2023, 05:55
RE: Scene on Mosaic - by CristianAgata - 30.03.2023, 15:45
RE: Scene on Mosaic - by CristianAgata - 01.04.2023, 12:06

Forum Jump: