Logic Machine Forum
Read device id - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Read device id (/showthread.php?tid=3811)



Read device id - MarcusH - 14.01.2022

Hi

Im wondering if its possible with an event script which is actived by an tag to be able to read the device id which updated the group address.

i've seen that in objectlog there is a column for source adress which is the data i need.

The reason for this is that I want to create a script which checks who is sending data and if its the wrong sender overwrite the last command.


RE: Read device id - admin - 14.01.2022

Check event.src variable


RE: Read device id - MarcusH - 17.01.2022

Thanks!
Thats excatly what i was looking for Smile

Just a off topic question, but how can i find documentation for these types of variables?

I use this a lot (https://openrb.com/docs/lua.htm), but this documentation is missing a lot of the more advanced functions in LM.


RE: Read device id - admin - 17.01.2022

This is a part of built-in help in the editor. Click "Scripting basics" in the right sidebar in the editor.


RE: Read device id - MarcusH - 17.01.2022

Thanks as always, now i know that as well Smile Got all the values i needed now.


RE: Read device id - MarcusH - 19.01.2022

Hi again,

got a new question, almost the same as topic so didn't want to start a new thread only for this question.

i've now been able to identify the device which sends a write command and save it to storage for later use, but when i send a read command from eiter ETS or a topssytem the tag doesn't get "updated". So my script dosn't get triggered and the cant do the logic i want. 

What i want to do is that when topsystem doesn't have a value and sends a read request for the value the script will be triggeredt and get this from the storage and update the value. 

Is there a way for the tag to be triggered by a read request?


RE: Read device id - admin - 19.01.2022

Enable "Execute on group read" in event script settings.


RE: Read device id - MarcusH - 19.01.2022

Fantastic! Thank you!

LM got all the features ready to go <3