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.

event get value based on the physical address
#1
Hi, 

I have a 1byte Value group address (10/0/23 ) and there are two KNX devices that are sending  values in that group address  ( their physical address is 8.0.10 and 8.3.3 )

How can I write the same value on another grp address only when 8.0.10 is the one that sends it?
Reply
#2
Code:
if event.src == '8.0.10' then
  value = event.getvalue()
  grp.write('10/1/23', value)
end
Reply
#3
(23.02.2023, 07:19)admin Wrote:
Code:
if event.src == '8.0.10' then
  value = event.getvalue()
  grp.write('10/1/23', value)
end

event.src, I couldn't find it in the Lua manual.

Thanks a lot.
Reply
#4
It's in the built-in help in the scripting editor under "Scripting basics".
Reply
#5
Try log(event), this way you can see what's available (:

Code:
Event for Event Logging Test (7/7/7) 23.02.2023 08:45:07
* table:
["datalen"]
  * number: 0
["script"]
  * table:
   ["execmode"]
    * string:
   ["tag"]
    * string:
   ["execonread"]
    * bool: false
   ["name"]
    * string: Event for Event Logging Test (7/7/7)
   ["id"]
    * number: 91
["srcraw"]
  * number: 0
["src"]
  * string: local
["type"]
  * string: groupwrite
["meta"]
  * string: admin:192.168.10.197
["sender"]
  * string: us
["datahex"]
  * string: 00
["nobuswrite"]
  * bool: false
["dstraw"]
  * number: 16135
["getvalue"]
  * function: 0xb6d508c0
["dst"]
  * string: 7/7/7
Reply
#6
Hi Erwin, thanks for your post here! Most helpful.

There's so many times I've wanted to update a visualisation object from a script but not have it trigger the event script associated with that object. I only want the script executed if the user changes the object value via the visualisation. Many examples for this that I've written - set point for air conditioners, or a master slider for multiple lights, Hue scenes that change the individual light globe brightnesses, etc. I have been using flags that would be set and reset by interdependent scipts but it quickly becomes very unwieldy.

I see I can now check event["sender"] in my script and quit, for example, if the event was called by another script, and not by the user via the Visualisation.

I've been using the Schneider CBus Automation Controllers, and have tentatively found that sender seems to take these values:

us - if script is triggered by the user updating an object via the visualisation.
cl - if script is triggered by updating the object in another script.
cb - if script is triggered by the object being updated by a wall switch button (and maybe other hardware input devices?).

Do you have any listing and description of what values event["sender"] may return?
Also, this appears to be a somewhat undocumented feature, so is it likely to remain unchanged in future firmware updates?

Thanks for any help you can give.

Phil
Reply
#7
List of senders: https://forum.logicmachine.net/showthrea...74#pid9574
Reply


Forum Jump: