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


QuickApp crash, failure msg: attempt to index a nil value


Recommended Posts

Posted

Hi,

I have developed a QA controlling my roof top roller shutters based on an calculated rolling average value of my PV power plant production. The QA worked for nearly 1 day and crashes since then.

 

Here is the trace I get:

Please login or register to see this code.

 

The last trace before crash is when I try to update the QA value.

 

Here is the code for QuickApp:onInit():

Please login or register to see this code.

 

I would highly appreciate any hint where to search.

 

Thanks

Posted (edited)

Unfortunately, it crashes inside Fibaro's own code for Device...

However, what most likely cause it is that you call some of your QuickApp functions the wrong way

 

Please login or register to see this code.

Please login or register to see this code.

It should be

Please login or register to see this code.

Please login or register to see this code.

 

You define functions with function QuickApp:name(...) ... end

but you call them with self:name(...) ... end

Edited by jgab
  • Topic Author
  • Posted (edited)

    Thanks a lot for your help. Implementing the change as suggested I found also a bug in my control function.

    Unfortunately I wasn't yet able to resolve the QuickApp crash when I try to update the value using

    Quote

    Please login or register to see this code.

     

    As intermediate workaround I have currently disabled the update, but I still want to resolve it. As attached the QA works besides the missing value update.

     

     

    Attached is the current version of my device file (as json) as well as the lua code file.

     

    I would highly appreciate any further hints from the community.

     

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    Edited by bgs
    bug in lua file
  • Topic Author
  • Posted

    Found the bug. I used in QuickApp:onInit following:

    Quote

    self.updateProperty("value",rolavg)

     

    but it should be

    Quote

    self:updateProperty("value",rolavg)

     

    Furthermore I removed "uiview" component from fqa file and uploaded it as new device.

     

    Seems now to work.

    Please login or register to see this attachment.

    Join the conversation

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

    Guest
    Reply to this topic...

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