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

Undocumented (?) LUA functions


knuth

Question

I have come across several Fibaro LUA functions that do not seem to be documented in the available

Please login or register to see this link.

. Here are a few examples:

Please login or register to see this code.

The use of formatting codes in

Please login or register to see this code.

And

Please login or register to see this code.

and similar commands for e-mail etc.

 

I have successfully used all of these and probably more. I am sure there are still more functions/calls out there which are only known from scenes published on the forum. Is there a more complete documentation available? Has anyone collected these semi-secret functions into a private document that may be shared? 

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • If this is your idea of documentation, we are not really on the same boat.? As a guide to new Fibaro LUA script programmers, it is less than helpful to provide them with streams of obscure LUA code.

    I am able to decipher most of what you define in this script, but my question remains: Why isn't all of this included in an update of the "Fibaro System Lua API Developer Documentation"?  And please note, I am not blaming you! You have been helpful by providing what you have, but the Fibar Group should keep their system documented. 

     

    To you  personally, @10der , two responses: Firstly - a thank you!  You are an important contributor to this forum. Secondly - please consider including some verbal comments every once in a while (in both your posts and in your scripts). It would make your knowledge sharing even more valuable. 

     

     

    Link to comment
    Share on other sites

    • 0

    @knuth it’s original LUA file what working on your HC2 right now ;) this file handle 99% commands what you put in LUA (VD has another env and working together with luabind library) 

    so, in this file you can find all functions what you can use. About dos, AFAIR Fibaro has site with docs but AFAIR again this site now gone 

    Fibar... it’s Fibar 

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Very helpful, that is what I thought this LUA file was about. The list of functions in the file should be comprehensive, then. I have now looked through the file and compared it to the the Fibaro LUA documentation. Here are the functions which I did not find described in the document:

     

    fibaro:args()

    fibaro:getName(deviceID)

    fibaro:getRoomName(roomID)

    fibaro:getRoomNameByDeviceID(deviceID)

    fibaro:wakeUpDeadDevice(deviceID)

    fibaro:getAllDeviceIds()

    fibaro:getIds(devices)

    fibaro:getLedBrightness()

    fibaro:setLedBrightness(level)

     

    Most of these are fairly self-explanatory, but I am not sure what fibaro:args() does. It returns arguments, but which ones? The syntax and use of fibaro:getAllDeviceIds() and fibaro:getIds(devices) are also a little elusive. I assume the first one returns a complete list of all device ID numbers, while the second one returns a selected list of such IDs. What goes into the parameter "devices" then? 

     

    The publish functions are included in the documentation, in the form HomeCenter.PopupService.publish({title, subtitle, contentTitle, contentBody, img, type, buttons}) and similar functions. The syntax fibaro:call(iosDeviceID, "sendPush", message) for push messages is not explicitly described, as the number of "actionName" examples in the fibaro:call(..) funciton is very limited. There are also some specialized functions in the LUA file, like split(text, delimeter) and urlencode(string), which are not mentioned in the documentation.

     

    And what about setTimeout(function, timeInterval) ? Is that a standard LUA function or a Fibaro invention? I have not seen it in my LUA references, nor in the Fibaro file or documentation.

     

    Anyway, I now have a complete function list and my mission is mostly accomplished. What remains is for our friends at Fibaro to update the documentation, with the functions listed above included. Thanks, @10der .

    Link to comment
    Share on other sites

    • 0
    16 minutes ago, knuth said:

    fibaro:args()

    Please login or register to see this attachment.

    19 minutes ago, knuth said:

    fibaro:getLedBrightness()

    fibaro:setLedBrightness(level)

    works via anus. HC2 doesn't save state after changes.

     

    Please login or register to see this image.

    /monthly_2019_12/image.png.477523452e341712da5254274d082b5a.png" />

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