How to convert driver to parent and child

Good point!

I'll think a bit more about that.

New at this--but, I just recalled that commands on the device prefs menu can have parameters. So, a "createChildDevice" command with string parameter is all I'd need.

Sorry for being slow...

Create one child device that handles the socket communication and then multiple children thar are just devices and these ask, via the parent for a command to be sent on to the X10 socket driver

I like it! Thanks for the tips

Create one child device that handles the socket communication

I was going to do the socket communication in the parent's on/off methods. Then each child is identical, except for name and id.

Maybe just a typo?

Pretty much there.

I saw some threads that highly recommend child devices be one of the GenericComponent types with their associated built-in drivers.

But, if I want the child devices on and off methods to call methods in the parent, I need a custom driver for the child devices, right?

I see now--use componentOn and componentOff in the parent.

2 Likes

Download the Hubitat app