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 Setting and Storing
#1
Hi I have a project with 70 plus lighting circuits. So going to split the Visualization into 3zones.
So in each zone we will have 6 scenes that can be independently set. And 6 global scenes that will trigger the same scene in each zone. So if Global scene “cleaning” is pressed then “cleaning” in the zones will be selected / recalled.

I also want to be able to modify scenes, only in the zone pages. I would will to recall a scene with a normal button press but be able to store the current levels by holding the same button for more than a second. (Long Press). 

Any advise on the best approach / or an example would be greatly appreciated.
Need to get the project moving. But been thinking of how to achieve the above effectively.
 
Thanks for any comments
Reply
#2
Hi
Long press functionality you can find here https://forum.logicmachine.net/showthrea...38#pid1238

To save scene live values just use this command scene.savelive(name) where name is your scene name.

BR
------------------------------
Ctrl+F5
Reply
#3
Hi,

I would need to display the value of a certain sequence of a given scene on an object.

Is it possible?

Tnx


Peppe
Reply
#4
Do you want just to display it or to have an option to modify it as well?
Reply
#5
by now just to display could be enough, but to have an option to modify it as well would be the best!
Reply
#6
Use this code to get a scene object value. Create a scheduled script that runs every minute. Replace myscene with your scene name, 32/1/9 is scene object address, 32/1/11 is value status output object.

Code:
require('json')

function getsceneobjvalue(sname, addr)
  local sceneid = db:getone('SELECT id FROM scenes WHERE name=?', sname)

  if sceneid then
    local objid = buslib.encodega(addr)
    local query = 'SELECT value FROM scene_sequence WHERE scene=? AND object=?'
    local value = db:getone(query, sceneid, objid)

    if value then
      return json.pdecode(value)
    end
  end
end

value = getsceneobjvalue('myscene', '32/1/9')
grp.checkwrite('32/1/11', value)
Reply


Forum Jump: