Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

LUA Templates


Question

Posted

Hi everyone, I'm in the need of creating a virtual device to change the parameters of an existing scene. Unfortunately, I'm brand new to LUA code, but I understand the philosophy though.

I searched the forum, but I don't see any template or explanation of the basic LUA commands ?

Could someone lead me to the basic commands of LUA for the HC2 ?

May be we can add in a specific thread for people to find some explanation of the basic commands, and why not some templates also ?

If people can help me, I'm ready to create this thread, I think that would be of big help for lots of us ?

Looking forward to reading you guys !

Regards

Recommended Posts

  • 0
Posted (edited)

@Sankotronic Sir, with all due respect... Fibaro can create a new directive in the header.

Which is smart, no law against it.

 

for example.

 

Please login or register to see this code.

Fibaro for user invisibly for us do magic like a

local mytools = require("mytools")

 

where  mytools.lua (for example) is

 

Please login or register to see this code.

 

and we can use in the scene shared functions.

 

yes, one notice here. names. in my example, I have provided "mytools". yes, Fibaro save all our script with numeric lua files (as far I remember for example /opt/fibaro/scenes/146.lua)

ok. I agree with numeric names,,,, it also ok from me.

 

Please login or register to see this code.

where 777 and 123 id's of shared scenes.

 It's simple, baby doll, minor hurdle, I'd be down.

 

:(

 

 

 

 

Edited by 10der

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...