Hi!
Can anyone explain how to use lua scripting?
I'm just starting to use Domoticz. I do have some experience with lua (I use an Fibaro HC2 Z-wave controller at this time with self made lua scripts).
Because I'm really fed up with Fibaro lack of transparency and closed source approach, I investigated several options to switch to another gateway. I really like Domoticz for it's open source approach, and decided to gradually switch to Domoticz.
I have installed Domoticz on a Raspberry Pi 3 (Raspian) with RealVNC support.
So, excuse for this really noob question, but can anyone help me started?
How should I use lua in Domoticz and what is the best approach?
Which tools do I need and what do I have to install?
Thanks in advance!
[Noob Question] How to start with lua scripting?
Moderator: leecollings
- Zweef
- Posts: 17
- Joined: Sunday 02 November 2014 16:10
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: The Netherlands
- Contact:
[Noob Question] How to start with lua scripting?
Domoticz on Raspberry Pi 3 using mainly Z-Wave
Other gateways:
Fibaro HC2
Athom Homey
Other gateways:
Fibaro HC2
Athom Homey
- HansieNL
- Posts: 964
- Joined: Monday 28 September 2015 15:13
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [Noob Question] How to start with lua scripting?
Hello,
I would advice to check the wiki. There are sample scripts.
You don't have to install additional software to use lua scripting.
I would advice to check the wiki. There are sample scripts.
You don't have to install additional software to use lua scripting.
Blah blah blah
- Zweef
- Posts: 17
- Joined: Sunday 02 November 2014 16:10
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: The Netherlands
- Contact:
Re: [Noob Question] How to start with lua scripting?
Thank you Hans for replying.HansieNL wrote:Hello,
I would advice to check the wiki. There are sample scripts.
You don't have to install additional software to use lua scripting.
I just noticed that scripts can be inserted in 'Events'. Can you tell me how I can debug new lua scripts? If a print-function is used, where is the content printed?
Domoticz on Raspberry Pi 3 using mainly Z-Wave
Other gateways:
Fibaro HC2
Athom Homey
Other gateways:
Fibaro HC2
Athom Homey
-
- Posts: 79
- Joined: Thursday 23 October 2014 22:41
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [Noob Question] How to start with lua scripting?
Print sends info to the domoitz log page.
- Zweef
- Posts: 17
- Joined: Sunday 02 November 2014 16:10
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: The Netherlands
- Contact:
Re: [Noob Question] How to start with lua scripting?
Allright, clear! thanks.DanM wrote:Print sends info to the domoitz log page.
Domoticz on Raspberry Pi 3 using mainly Z-Wave
Other gateways:
Fibaro HC2
Athom Homey
Other gateways:
Fibaro HC2
Athom Homey
- Zweef
- Posts: 17
- Joined: Sunday 02 November 2014 16:10
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: The Netherlands
- Contact:
Re: [Noob Question] How to start with lua scripting?
Just another noob question though:
Whats the difference between lua scripts and lua code in events --> lua?
Whats the difference between lua scripts and lua code in events --> lua?
Domoticz on Raspberry Pi 3 using mainly Z-Wave
Other gateways:
Fibaro HC2
Athom Homey
Other gateways:
Fibaro HC2
Athom Homey
- jvdz
- Posts: 2328
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: [Noob Question] How to start with lua scripting?
Not much. The first one is done through file(s) in the LUA subdirectory and are shelled by the event handler based on their name.
The second option is created recently and stores the LUA scripts in the domoticz database and will shell them based on the Event type selected.
Jos
The second option is created recently and stores the LUA scripts in the domoticz database and will shell them based on the Event type selected.
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- Zweef
- Posts: 17
- Joined: Sunday 02 November 2014 16:10
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: The Netherlands
- Contact:
Re: [Noob Question] How to start with lua scripting?
Thank you, Jos!
I saw some scripts published, but when to insert them in lua-events, I have error warnings.
Looks like variables like $test is not accepted. It should be without the $-sign. Does this mean this is one of the difference between lua-events and lua-scripts?
I saw some scripts published, but when to insert them in lua-events, I have error warnings.
Looks like variables like $test is not accepted. It should be without the $-sign. Does this mean this is one of the difference between lua-events and lua-scripts?
Domoticz on Raspberry Pi 3 using mainly Z-Wave
Other gateways:
Fibaro HC2
Athom Homey
Other gateways:
Fibaro HC2
Athom Homey
- jvdz
- Posts: 2328
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: [Noob Question] How to start with lua scripting?
Are you sure that was a LUA script that contains the $test and not a perl, php or bash script?
LUA is LUA so the syntax for both options is the same.
Jos
LUA is LUA so the syntax for both options is the same.
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- Zweef
- Posts: 17
- Joined: Sunday 02 November 2014 16:10
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: The Netherlands
- Contact:
Re: [Noob Question] How to start with lua scripting?
Okay, clear enough, Jos.
I will start with my first lua coding. I will make a new topic for that. Thanks.
I will start with my first lua coding. I will make a new topic for that. Thanks.
Domoticz on Raspberry Pi 3 using mainly Z-Wave
Other gateways:
Fibaro HC2
Athom Homey
Other gateways:
Fibaro HC2
Athom Homey
Who is online
Users browsing this forum: No registered users and 1 guest