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.

Documentation
#1
Information 
Documentation and examples: https://kb.logicmachine.net/
Reply
#2
Hi, just a note:

Initially I downloaded the PDF version of the LUA Reference manual. It seems to be out of date, eg. the grp.all() function is not mentioned.

It also mentions a subset api, object.xxx() functions, which seems to be removed in the updated online version of the doc (that API is probably replaced by grp.xxx() functions ?)


- Oyvind
Reply
#3
Online HTML reference is the latest one. You should use that.
Reply
#4
I've stumbled across the db:getall() and db:update() functions in a few threads here, yet cant find any documentation about them. Are they supported or documented features?
Reply
#5
In most cases you should not access the internal database directly. Are you missing some specific functionality?
Reply
#6
Here is another nice documentation for different programming languages (localized for different countries): https://learnxinyminutes.com
Reply
#7
Could we make a script repository if there isnt one already?
Reply
#8
I am new to LM and LUA,
There are many good things to learn from reading this forum. For instance, I learned about the reserved name _SCRIPTNAME to obtain the name of the current running script. In other threads, I learned about event.getvalue() and event.dst to read what triggered the current script.
I would like to learn more: Where do I find more holistic documentation on specifically:
- All reserved (and useful) variables (such as _SCRIPTNAME)
- The full specification for the "event" class (all its methods and variables)
Thx
Reply
#9
(15.10.2018, 09:38)mjaanes Wrote: I am new to LM and LUA,
There are many good things to learn from reading this forum. For instance, I learned about the reserved name _SCRIPTNAME to obtain the name of the current running script. In other threads, I learned about event.getvalue() and event.dst to read what triggered the current script.
I would like to learn more: Where do I find more holistic documentation on specifically:
- All reserved (and useful) variables (such as _SCRIPTNAME)
- The full specification for the "event" class (all its methods and variables)
Thx

event is a table
just execute following script

log (event)

and you will see what it consist of
Reply
#10
Hi,

In the documentation the description of the object fields is:
 address - object group address
 updatetime - latest update time in UNIX timestamp format. Use os.date() to convert to readable date formats
 name - unique object name
 datatype - object data type
 decoded - set to true when decoded value is available
 value - decoded object value

But in samples I found additional fields like: id, data.
Where I can find the full actual documentation?
Reply
#11
Hi,

Make a backup and browse current.db with sqlite browser (:

BR,

Erwin
Reply
#12
Hi,

I can't find anything on https://kb.logicmachine.net in the lua reference manual about event.dst or event.getvalue()
It does show up in some examples but as it seems is nowhere described specifically.
So if I'm correct, maybe a suggestion to add this to the manual as this is really helpful.

Thanks in advance!
Tigi
Reply
#13
(30.11.2025, 10:05)tigi Wrote: Hi,

I can't find anything on https://kb.logicmachine.net in the lua reference manual about event.dst or event.getvalue()
It does show up in some examples but as it seems is nowhere described specifically.
So if I'm correct, maybe a suggestion to add this to the manual as this is really helpful.

Thanks in advance!
Tigi

Event-based scripting can be used to implement custom logic for group address or tag events. User-defi ned function is executed when a “group write/response” or “group read” (if enabled) event occurs for a given group address. Event information is stored in the global event variable. Variable contents:
● dstraw (integer) - raw destination group address
● srcraw (integer) - raw source individual address
● dst (string) - decoded destination group address (for example: 1/1/4)
● src (string) - decoded source individual address (for example: 1.1.2)
● type (string) - type of the event, either 'groupwrite', 'groupread', 'groupresponse'
● dataraw (string) - event data as a binary string
● datahex (string) - event data as a hex-encoded string

it's from LM manual

https://logicmachine.net/manuals/lm_20240923.pdf

page 34
Reply
#14
(Yesterday, 10:17)AEK Wrote:
(30.11.2025, 10:05)tigi Wrote: Hi,

I can't find anything on https://kb.logicmachine.net in the lua reference manual about event.dst or event.getvalue()
It does show up in some examples but as it seems is nowhere described specifically.
So if I'm correct, maybe a suggestion to add this to the manual as this is really helpful.

Thanks in advance!
Tigi

Event-based scripting can be used to implement custom logic for group address or tag events. User-defi ned function is executed when a “group write/response” or “group read” (if enabled) event occurs for a given group address. Event information is stored in the global event variable. Variable contents:
● dstraw (integer) - raw destination group address
● srcraw (integer) - raw source individual address
● dst (string) - decoded destination group address (for example: 1/1/4)
● src (string) - decoded source individual address (for example: 1.1.2)
● type (string) - type of the event, either 'groupwrite', 'groupread', 'groupresponse'
● dataraw (string) - event data as a binary string
● datahex (string) - event data as a hex-encoded string

it's from LM manual

https://logicmachine.net/manuals/lm_20240923.pdf

page 34

Hi AEK,

Thanks for the information and location where to find!  Smile
My fault I didn't also check the pdf manual, I only searched in online kb and forum.

Greetings,
Tigi
Reply


Forum Jump: