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


Child with id: XX not found


Sagittarius
 Share

Recommended Posts

Hi…

 

Just made a new Quick App with my own lua script (copy from a working quick app) 

 

now when i call it i get this error: Child with id: 601 not found

 

I don’t have any child’s 

 

Can any one help?

 

Br Sagi

Link to comment
Share on other sites

Did you copy the code from another quickapp (or installed a fqa file) with child devices and later deleted the childs?

Link to comment
Share on other sites

  • Topic Author
  • I tryed both, and get same error…

     

    With no childs, never used it

    Link to comment
    Share on other sites

    If there were childs in the original quickapp, that could be an issue. Have you already tried to add a new blanc quickapp and paste this code?

    Link to comment
    Share on other sites

  • Topic Author
  • Posted (edited)

    Yes, its the one i just copy from… i tryed a -binary switch- and -Generic device- not sure what is best

     

    The fist time I call the Quick App, its working, next call give me the error…. Even when i try to click on/off

     

    can something in my code make a child?

    Edited by Sagittarius
    Link to comment
    Share on other sites

    3 hours ago, Sagittarius said:

    Hi…

     

    Just made a new Quick App with my own lua script (copy from a working quick app) 

     

    now when i call it i get this error: Child with id: 601 not found

     

    I don’t have any child’s 

     

    Can any one help?

     

    Br Sagi

     

    Your problem is this line

    Please login or register to see this code.

     

    self.id is the QuickApp id of your QA and is vital for a lot of functions to work. 

    Every fibaro.call to the QA will show an error because it looks at the deviceId in the fibaro.call(deviceId,...) and if it's the same as the QA's self.id it will call the lua function, otherwise it assumes that the call is for a child of the QA, but in your case it won't find any child with that id and complain that it couldn't find the child.

     

    In general you need to be careful when storing values in self.* as it may overwrite sensitive variables used by the QA...

    Link to comment
    Share on other sites

  • Topic Author
  • Posted (edited)

    Thank you so much

     

    So its best not to use self. at all? 

     

     

    Edited by Sagittarius
    Link to comment
    Share on other sites

    11 minutes ago, Sagittarius said:

    Thank you so much

     

    So its best not to use self. at all? 

     

     

    Well, be careful. Because Fibaro has not documented all keys they have assigned to the QuickApp class, it's a potential minefield to assign your own keys to self. (We know from documentation some of them like self.id, self.name...)

    For a QuickApp without children I prefer to have local variables in the head of the file.

    If you have QuickAppChild objects it's nice to store child specific values in the Child class object for scoping purpose, so choose some non obvious names....

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

     Share

    ×
    ×
    • Create New...