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

what is this mean ?


thuan89

Question

Hi every one!

I am research Lua language in fibaro.But i met a problem i don't understand.I often see --[ [%% property --]]. (%%) what is this mean ?

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

Hi every one!

I am research Lua language in fibaro.But i met a problem i don't understand.I often see --[ [%% property --]]. (%%) what is this mean ?

I am also new to LUA, but found that 

% % property  defines the trigger(s)

 

1 -- [ [

2 %% properties

3 50 value

4 %% globals

5 -- ] ]

Every time the value for trigger with DeviceID 50 changes, the script will run.

 

Update

Please login or register to see this link.

Link to comment
Share on other sites

  • 0

It's called a header and it is not part of the lua language.

Actually to be more precise, the --[[ starts a multiline comment and --]] ends it. Comments are ignored by a "normal" (meaning non-Fibaro) lua interpreter. But for the HomeCenter, this information at the top of the scene between those two comment delimiters is quite important.

The %%properties and other stuff define the triggers of the lua scene. If you put "50 value" under %%properties, the scene will start when "value" of device with ID = 50 changes. If 50 is your "motion sensor", the scene will start when the sensor reports motion, but also when it reports "no motion for the last X seconds".

Does this help? If you say: "I am research Lua language in fibaro" is that out of academic interest, or are you trying to program your own scenes?

Link to comment
Share on other sites

  • 0
  • Inquirer
  • thank you very much!I has understand.But i don't know how many type PropertyName of device.I only knows such as:value,timestamp,i search at 'brightness' but i don't known whose device? and how to do to have information about propertyName of devices? i hope i will receive feedback from everyone.
    Thanks for regards!

    Link to comment
    Share on other sites

    • 0

    As far as I know you go to a scene, edit it and then on the left you get a list of all your devices. If you expand the rooms, then the device list, and lastly the device itself... the browser then opens a list of all available properties. I think it is safe to say that the most used are "value", "power" and "sceneActivation". Since 4.080 the "Fibaro Swipe" is supported through the new CentralSceneEvent.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Thanks Power  User ! but i don't see avaliable properties.I has do as you say but i don;t see avaliable Properties.Can  you send me a picture shown  about that please! I am needing iformation that.Thanks you very much! Or you send via Facebook  for me.Your facebook :[email protected]

    Link to comment
    Share on other sites

    • 0

    I doubt that will make it clear, that screenshot looks like a mess... Let my try to describe how to get there.

    Log into your HC2.

    At the top: click "Scenes".

    Find a lua scene. Any lua scene will do! Click on the small wrench icon, to edit the scene.

    The scene opens with two tabs at the top: "General" and "Advanced". Click on "Advanced".

    The left side of the screen changes. You now have "Variables List" and "Devices List".

    Under "Devices List", you'll see a list of all the rooms you have defined.

    Move the mouse pointer to the room that contains the device that you are looking for. Don't click.

    A new list appears, to the right, with all the devices in that room. Move the mouse pointer to the device. Don't click.

    Yet another list appears, this time with "properties" and actions.

    For example, one of my devices:

    Typ: com.fibaro.binarySwitch

    Properties:

    - zwaveCompany

    - zwaveInfo

    - zwaveVersion

    (...) and so on.

    Link to comment
    Share on other sites

    • 0

    Nice! Happy Hacking!

    Please login or register to see this image.

    /emoticons/default_icon_smile.gif" alt=":-)" />

    Link to comment
    Share on other sites

    • 0
    Guest FredrikKarlsson

    Hi,

    I.e. as referred to this thread.

    Ok, so what is

    %%events

    ?

    Link to comment
    Share on other sites

    • 0

    %%events exists for devices that support the "Central Scene" command class. It's rather new and can be compared to "Scene Activation". The new Fibaro Swipe supports it. And Nodon Octan Remote (but I don't have one to confirm it's supported). The user manual will state this. If the device is supported by your HC, the method in post #8 will show possible values. For instance, "swipe left" for me translates to "325 CentralSceneEvent 3". I'm not 100% sure but I think it only exists on Z-Wave plus devices.

    Link to comment
    Share on other sites

    • 0

    Does it exist any tutorial for the %%-parameters and the block scene options? 

    Link to comment
    Share on other sites

    • 0

    Not that I know of, but if you're new you might find these interesting:

    API summary with descriptions and short examples:

    Please login or register to see this link.

    Download the "Advanced User's Guide" from:

    Please login or register to see this link.

    And make block scenes and convert them to lua...

    Modules' leaflets:

    Please login or register to see this link.

    Link to comment
    Share on other sites

    • 0

    Hi

    Thanks for your quick reply! I´m somewhat semi-experienced, and I have been into these sites looking for information. The development site is a good reference guide LUA-commands.

     

    I have (at least two problems): 

    I have identified that time triggered block scenes need the "Start scene when the HC2 starts" option checked. Most documentation/exampes just tell that it´s required but not why. I want to know why to apply the knowledge to solve similar other problems.

     

    Block scenes triggered by scene activation behave unpredicable. Sometimes they work, sometimes not, and the best way is often to delete the current block scens and rebuild. I do not know if this is caused by lack of knowledge and parameters not correctly set, or inherent problems with the block scene engine.

     

    The forum has a lot of information, but ofte the "good pieces" are hidden in the wast amount of search returns. Hopefully Fibaro at some point in time will come up with some more documentation.

    Link to comment
    Share on other sites

    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...