Logic Machine Forum
novice, Help me please - 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: novice, Help me please (/showthread.php?tid=978)



novice, Help me please - Carlos Padilla - 06.09.2017

how can I write lua code and show me that it worked correctly?
for example if I write
print ("Hello word")
where I can see that this instruction was written
I can program program over a group address that physically does not exist a device? that executes that lua statement?



RE: novice, Help me please - Erwin van der Zwart - 06.09.2017

Hi,

Use log("hello world") instead of print and check the log tab.

You cannot read/write to objects that do not exist in the object list as the object type is otherwise not known.

You can use event based scripts to execute the script by group address or tags (by multiple objects with same tag)

BR,

Erwin


RE: novice, Help me please - Carlos Padilla - 06.09.2017

(06.09.2017, 15:32)Erwin van der Zwart Wrote: Hi,

Use log("hello world") instead of print and check the log tab.

You cannot read/write to objects that do not exist in the object list as the object type is otherwise not known.

You can use event based scripts to execute the script by group address or tags (by multiple objects with same tag)

BR,

Erwin

Thank you Mr. Erwin if I worked on the log Smile
when in the object tab says to create virtual object even doing that will not work the script?



RE: novice, Help me please - admin - 06.09.2017

You can execute script on any object, you should use virtual objects if value is not needed on the KNX bus.


RE: novice, Help me please - Carlos Padilla - 06.09.2017

(06.09.2017, 16:31)admin Wrote: You can execute script on any object, you should use virtual objects if value is not needed on the KNX bus.

ok thanks a lot, now if i run a mysql query
Does it have to be about a specific object as well?



RE: novice, Help me please - Erwin van der Zwart - 06.09.2017

Hi,

Scripts can be triggered by change in a object value, by interval or as planned moment, so there is no need to always use the object value.

Depending on what you want to achieve you select a methode to activate a script or keep it running on a timed interval.

So if you want to execute a mysql command, what do you need? Must it be triggered on a specific action or do you want to check values every x period?

BR,

Erwin


RE: novice, Help me please - Carlos Padilla - 08.09.2017

(06.09.2017, 17:49)Erwin van der Zwart Wrote: Hi,

Scripts can be triggered by change in a object value, by interval or as planned moment, so there is no need to always use the object value.

Depending on what you want to achieve you select a methode to activate a script or keep it running on a timed interval.

So if you want to execute a mysql command, what do you need? Must it be triggered on a specific action or do you want to check values every x period?

BR,

Erwin


I want to take the data of the database of the group addresses, value, tags, type of value among others and send it to my web page to make some reports with that data to execute that daily code


RE: novice, Help me please - Erwin van der Zwart - 08.09.2017

Hi,

When you use only daily data then you can use a scheduled script and run it every day at 00:00 hour.

BR,

Erwin


RE: novice, Help me please - admin - 09.09.2017

You can also use remote services to request object list from LM instead of sending it. You have to enable it in system config and set export flag for objects you want to be visible for remote requests.
http://openrb.com/docs/remote-new.htm