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.

Polling status
#1
I´m scratching my head a bit concerning what to do if there is a fire alarm. Obviously, it´s fairly easy to turn off things that need to be turned off.

My concern regards lights. Is there a way, in a script, to poll every lights current status and save that state if the group address for the firearm goes true? 

The scenario would be this:

Fire alarm goes off. Every appliance turns off and all lights go to 100%. 3 minutes after the fire alarm has been reset, the lights go back to the state they were in before the fire alarm went off.

I´m not even sure if this is what people do when it comes to KNX and fire alarms...
Reply
#2
(02.12.2015, 22:45)FatMax Wrote: I´m scratching my head a bit concerning what to do if there is a fire alarm. Obviously, it´s fairly easy to turn off things that need to be turned off.

My concern regards lights. Is there a way, in a script, to poll every lights current status and save that state if the group address for the firearm goes true? 

The scenario would be this:

Fire alarm goes off. Every appliance turns off and all lights go to 100%. 3 minutes after the fire alarm has been reset, the lights go back to the state they were in before the fire alarm went off.

I´m not even sure if this is what people do when it comes to KNX and fire alarms...

what we do:
- connect all devices to a scene
- when firealarm on: save scene - turn lights on / blinds up
- when firealarm off: call scene
Reply
#3
(03.12.2015, 09:03)gjniewenhuijse Wrote:
(02.12.2015, 22:45)FatMax Wrote: I´m scratching my head a bit concerning what to do if there is a fire alarm. Obviously, it´s fairly easy to turn off things that need to be turned off.

My concern regards lights. Is there a way, in a script, to poll every lights current status and save that state if the group address for the firearm goes true? 

The scenario would be this:

Fire alarm goes off. Every appliance turns off and all lights go to 100%. 3 minutes after the fire alarm has been reset, the lights go back to the state they were in before the fire alarm went off.

I´m not even sure if this is what people do when it comes to KNX and fire alarms...

what we do:
- connect all devices to a scene
- when firealarm on: save scene - turn lights on / blinds up
- when firealarm off: call scene

Thanks for the tip! Haven't worked too much with scenes yet. What you are saying is that you can save scenes on the fly with KNX, and not have to pre-program these in ETS?
Reply
#4
(04.12.2015, 05:55)FatMax Wrote:
(03.12.2015, 09:03)gjniewenhuijse Wrote:
(02.12.2015, 22:45)FatMax Wrote: I´m scratching my head a bit concerning what to do if there is a fire alarm. Obviously, it´s fairly easy to turn off things that need to be turned off.

My concern regards lights. Is there a way, in a script, to poll every lights current status and save that state if the group address for the firearm goes true? 

The scenario would be this:

Fire alarm goes off. Every appliance turns off and all lights go to 100%. 3 minutes after the fire alarm has been reset, the lights go back to the state they were in before the fire alarm went off.

I´m not even sure if this is what people do when it comes to KNX and fire alarms...

what we do:
- connect all devices to a scene
- when firealarm on: save scene - turn lights on / blinds up
- when firealarm off: call scene

Thanks for the tip! Haven't worked too much with scenes yet. What you are saying is that you can save scenes on the fly with KNX, and not have to pre-program these in ETS?

Yes thats possible, send 0..127 for calling scene 1..128 and send 128..255 to save scene 1..128. If you use scene 1 you can use to send 0 and 128.
Reply
#5
Or you can make a script to save/recall values of all objects mapped to a certain tag. Map this script to a binary object, where ON saves tagged object values and OFF recalls saved values.
Code:
value = event.getvalue()

-- save states
if value then
  objects = grp.tag('my_object_tag')
  store = {}

  for _, object in ipairs(objects) do
    store[ object.address ] = object.data
  end

  storage.set('my_objects', store)
-- restore states
else
  store = storage.get('my_objects', {})

  for addr, value in pairs(store) do
    grp.write(addr, value)
  end
end
Reply
#6
Excellent inputs! Thank you so much guys :-)
Reply
#7
(04.12.2015, 07:26)admin Wrote: Or you can make a script to save/recall values of all objects mapped to a certain tag. Map this script to a binary object, where ON saves tagged object values and OFF recalls saved values.
Code:
value = event.getvalue()

-- save states
if value then
  objects = grp.tag('my_object_tag')
  store = {}

  for _, object in ipairs(objects) do
    store[ object.address ] = object.data
  end

  storage.set('my_objects', store)
-- restore states
else
  store = storage.get('my_objects', {})

  for addr, value in pairs(store) do
    grp.write(addr, value)
  end
end
Sorry, Can you tell me more about the above code? I don't understand how to apply it yet.

Thanks!
Reply
#8
This script is obsolete. Scenes should be used instead. Current values for a given scene can be saved from a script: https://openrb.com/docs/lua.htm#scene.savelive
Reply
#9
(30.08.2023, 07:58)admin Wrote: This script is obsolete. Scenes should be used instead. Current values for a given scene can be saved from a script: https://openrb.com/docs/lua.htm#scene.savelive

Sorry, I don't know much about Lua. Can you give me an example?
Thank!
Reply
#10
Create a scene named Test scene and add objects that you want to control with it.
Then create a 1-bit object an map event script to it. When writing ON (true) it will save current object values that are assigned to this scene. When writing OFF (false) it will run the scene.

Code:
value = event.getvalue()
name = 'Test scene'

if value then
  scene.savelive(name)
else
  scene.run(name)
end
Reply
#11
(30.08.2023, 09:22)admin Wrote: Create a scene named Test scene and add objects that you want to control with it.
Then create a 1-bit object an map event script to it. When writing ON (true) it will save current object values that are assigned to this scene. When writing OFF (false) it will run the scene.

Code:
value = event.getvalue()
name = 'Test scene'

if value then
  scene.savelive(name)
else
  scene.run(name)
end

Yes, I will try following your instructions!

Thank!
Reply


Forum Jump: