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

Deleting child devices


xAPPO

Question

I have created a QA that discovers all the devices on my home C-Bus network , mainly lighting.  After a few false starts it's correctly added about 200 child devices and it's working well.   However I have about 50 mistakenly created devices I would now like to remove.   If I click the delete (wastebin) icon on any of those children it warns me accompanied by a list of all the children, that it's going to have to delete every child device which was a surprise. 

 

So I haven't done that and instead was considering using the api to delete a child. But I'm worried it might delete them all as well.  Why is this happening from the web UI and will delete via the api just delete the one specific device ?

 

I realise I can hide or disable the unwanted devices but I would prefer them gone totally.

 

I created a backup as a fallback but was a bit alarmed to see this....

 

Please login or register to see this image.

/monthly_2020_08/image.png.522af6e603ae06ed3d6186129b6c3ba7.png" />

 

 

I have way more than 2 devices on my system not counting child devices. The scenes and rooms are correct

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

if you delete the main device if should be remove 100500 child devices

Link to comment
Share on other sites

  • 0
  • Inquirer
  • .. sorry ? I miss the point of this reply.   I want to delete one child devices and it says it will delete them all within that parent. I am not deleting a parent device.

    Link to comment
    Share on other sites

    • 0

    If you delete the parent, all the childs, also the 50 mistakenly are deleted. 
     

    Then let the parent create the childs again.

     

    Don’t forget to download the quickapp. 
     

     

     

    Edited by SmartHomeEddy
    • Thanks 1
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Ahh yes - I considered that but it took quite a bit to create them - lots of manual name edits for example - and I really didn't want to create a big deviceID gap either - so I guess the question is can I delete a single child device via the api ? 

     

    Easiest way I suppose is to create another parent with just a few children and try it...

     

    Kevin

    Edited by xAPPO
    Link to comment
    Share on other sites

    • 0

    After this.

    self:initChildDevices({--[[something]]})

     

    try

    self:removeChildDevice(id)

    or

    api.delete("/plugins/removeChildDevice/" .. id)

    Edited by rangee
    Link to comment
    Share on other sites

    • 0

    Will it work with the API?

     

    Please login or register to see this code.



     

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0
    26 minutes ago, rangee said:

    After this.

    self:initChildDevices({--[[something]]})

     

    try

    self:removeChildDevice(id)

    or

    api.delete("/plugins/removeChildDevice/" .. id)

    The api.delete doesn’t update the self.childDevices list. That’s the role of self:re moveChildDevice. The only trick is if you have some mapping variable that you need to keep in sync. I assume that some of the plugins could be confused if their children were deleted without their knowledge....

    Edited by jgab
    Link to comment
    Share on other sites

    • 0
    3 minutes ago, jgab said:

    The api.delete doesn’t update the self.childDevices list. That’s the role of self:re moveChildDevice. The only trick is if you have some mapping variable that you need to keep in sync. I assume that some of the plugins could be confused if their children were deleted without their knowledge....

    That doesnt matter

    just restart parent QA :)

    Link to comment
    Share on other sites

    • 0
    5 minutes ago, rangee said:

    That doesnt matter

    just restart parent QA :)

    Well, I wouldn’t bet that it’s true for all QAs. In Fibaro’s example for childDevices they store the map in a quickAppVariable, and They read it back at restarts... If one forget to resync that to reality....

    Much better then to only rely on the childDevices list and store mapping data in the child devices themselves.

    Link to comment
    Share on other sites

    • 0
    1 minute ago, jgab said:

    Well, I wouldn’t bet that it’s true for all QAs. In Fibaro’s example for childDevices they store the map in a quickAppVariable, and They read it back at restarts... If one forget to resync that to reality....

    Much better then to only rely on the childDevices list and store mapping data in the child devices themselves.

     yes. case by case.

    But  key point is that.

    self:removeChildDevice

     

     

    ps. I store data in child device's information. So in my case, just do self:removeChildDevice  make sense.

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 2 hours ago, jgab said:

    Well, I wouldn’t bet that it’s true for all QAs.

      .. and indeed it isn't true of mine !   But I can of course remove the mapping as well.  I was just establishing it worked for a single child device.

     

    Why does the web UI 'delete' on a child device delete them all ? Is that a bug ?  It seems they've considered the result because they warn you and give you a list of the child devices so they intend, or know it will remove all

    Link to comment
    Share on other sites

    • 0

    I had the same Problem, a lot of virtual junk child devices added to a quick app device erroneously generated by a constructor code. Then I renamed that Child Devices "toDelete" in the device list manually, filtered them by name, and after rename I was able to delete them manually with the waste bin symbol, they were also removed from the device tree in the master device ....

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