Parent/Child Drivers - refreshing

I've written Parent and Child drivers that function well - and am looking to make a few things cleaner. Any thoughts/suggestions would be greatly appreciated.

Possible to Refresh Parent's Component Devices after creating child? I have a Create Device command with a label - and everything functions correctly, the child device is created. However the child device does not show up on the Parent's Component Devices until you refresh the page or leave and come back. Is it possible to refresh that through code?

Possible to navigate back to Parent Device using code? On the child device I added a Remove Device command that calls a method on the parent that deletes the child device. Is it possible to return to the Parent device through code after that action? Right now the user must do it manually.




But neither of these should be very common occurrences, correct? Once the Parent is installed, it will create the children. And from then on, these devices will be used in automations or dashboards. Users should rarely need to delete a child least in my experience. They can also simply click the "Remove Device" button on a child device, instead of needing to ask the parent device to do so. Make sure your parent can handle that scenario, as that is what most users will do from habit.

P.S. Welcome to Hubitat!

1 Like

Thanks for the feedback! You are correct - this was just an attempt to tweak user experience.

The "Remove Device" button on my child devices are always greyed out - that is why I added the Remove Device command. Sounds like I'm missing something in the Parent in order for that to be enabled..

Thanks for the welcome! I was a Smartthings and Hubitat early adopter - but even though my day job is development I'm just getting into developing on this.

1 Like

Add this when you create the child:

isComponent: false

Thanks that is perfect!

1 Like

Download the Hubitat app