Common Composite (Child) Device Handlers

Since you’re trying to use a Fibaro device, neither my code nor @erocm1231’s is going to work without some changes.

Personally, I would recommend you start with the example code highlighted in the following post. This appears to be very similar to what you’re trying to accomplish.