I am working on a custom DTH that aggregates the open/close status for a group of contact sensors managed through webcore.
I have the parent and child DTH working now to create the child devices, update the child open/close status, and update the parent status based on “all closed” or “1 or more contacts are open”. this also shows all of the child device tiles in the main parent device.
ok cool so far, but what if i change/remove some contact sensors in the group. well any child device that got removed from the group, is still ‘active’ in the parent device. but it no longer gets updated, obviously as there is no physical contact sensor in the group that is referenced for this child device.
Is there a way to programmatically remove child devices by name? or a way to remove all of the child devices for a parent device? i have not been able to find anything about removing child devices from this forum or the smartthings developer documentation.
I am planning on posting a topic with code when i have it working more consistently.
any help is much appreciated.