Logic Machine Forum
Making scenes in mosaic - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9)
+--- Thread: Making scenes in mosaic (/showthread.php?tid=1615)



Making scenes in mosaic - 02dag - 24.09.2018

I have not been able to find any widgets that can turn off multiple objects at the same time. I would like to turn on scenes like night and away with Mosaic.

I am wondering if it is possible to maybe, make a virtual object, control this with a widget, and write an eventbased script that turns off multiple objects. Maybe I can use tags for this?

Are there anyone that know an easier way of doing this?


RE: Making scenes in mosaic - FatMax - 25.09.2018

On W4KNX and SpaceLYnk the Touch visu have a widget called scenes. This is a widget for a 1-Byte object, with optional values. I'm sure LM and Mosaic have it too? This is what it looks like:

   

Make a 1-Byte unsigned object either as a virtual or real object in the configurator. If the object is real KNX, then the object can be manipulated on the bus by light switches, for instance. Set up the widget:

   

It will look like this:

   

Next, create a event based script in your shiny new 1-Byte object. Paste this code in:


Code:
local state = event.getvalue()

local tag = grp.tag('modes')

local awayVal = 0 -- away value
local homeVal = 50 -- home value
local nightVal = 10 -- night value

for _, object in ipairs(tag) do
 address = object.address
 if state == 0 then
     grp.write(address, awayVal)
    elseif state == 1 then
     grp.write(address, homeVal)
    elseif state == 2 then
     grp.write(address, nightVal)
    else
        -- Do nothing
    end
end

Tag your desired objects with modes. Those objects can be 1-bit or 1-byte objects. Just remember that for a 1-bit object any value you send to it over 1 will be on, and 0 will be off.

Hope this helps and gets your imagination for what's possible Smile


RE: Making scenes in mosaic - Daniel - 25.09.2018

Hi
Alternatively the scene can be done via build in scene tab.
The scene widget will also send save telegram on long press of the button. If I remember well it was scene value + 127
BR


RE: Making scenes in mosaic - FatMax - 25.09.2018

(25.09.2018, 07:19)Daniel. Wrote: Hi
Alternatively the scene can be done via build in scene tab.
The scene widget will also send save telegram on long press of the button.  If I remember well it was scene value + 127
BR

That’s a even better idea as you can have different values for different objects. Haven’t tried the scene module myself yet..