Child device not being created

this is the error from the events on the dimmer driver

Child device creation failed. Make sure the device handler for "Switch Level Child Device" is installed

Anyone with code experience want to have a look and see why the dimmer driver is not creating the child device?

Inovelli child device driver

Inovelli dimmer driver

Where did you get the driver? From official Innovelli github repo for Hubitat?
You don't have the Switch Level Child device driver installed yet. You have to install the correct driver.

1 Like

It appears to me that @ericm may not have fully tested this code on Hubitat? It appears to me, from a very quick glance at the Parent Driver code, that it is still using the SmartThings version of the addChildDevice() call, not the simpler Hubitat version. This is probably why you are receiving the

Child device creation failed. Make sure the device handler for "Switch Level Child Device" is installed

log messages.

I would recommend you reach out directly to @ericm to see if he can test this Parent/Child pair of drivers on Hubitat to make sure all of the necessary changes have been made.

1 Like

I do have the child level device driver installed.

The drivers linked above are what I am using, yes they are supposed to be for hubitat even tho there is some residual smartthings language in them.

I have reached out to @ericm, I noticed the device handler laguage too but just chalked it up to wording in the error message comring from the driver

One thing I have noticed is that your link to the Child Driver might not be the one you want. The official Inovelli GitHub repo has a version as well, which is the same repo you're getting getting your Parent Driver from...

https://raw.githubusercontent.com/InovelliUSA/Hubitat/master/Drivers/switch-child-device.src/switch-child-device.groovy

Whoops! That's not right either! You need the Switch Level version... Definitely @ericm needs to update the Inovelli Hubitat Github repo with the correct code, so it is all in one place and fully tested together as a matched set. Hopefully he'll be along shortly to help get this sorted out! :slight_smile:

1 Like

Yes I noticed that too, however I need the dimmer version which has "level" in the name. It seems to be missing.

But I did open that official one up and it seems identical other than adding a device to change level

1 Like

I vaguely remember he had portions in his personal repo and portions in the Inovelli repo. My recall is that he fixed that but it's certainly worth a look in his.

1 Like

yes the only place i could find the switch level child device driver was in his repo under hubitat drivers and thats what i have installed.

it must be down to wording in the code that is calling the child driver to start

Just noticed this in the inovelli dimmer driver, it references the child device driver in Eric's repo which is what i have installed. I tried deleting the child driver and re-installing and rebooting but still no go

2018-03-08: Added support for local protection to disable local control. Requires firmware 1.03+.

  •          Also merging handler from NZW31T as they are identical other than the LED indicator.
    
  •          Child device creation option added for local control setting. Child device must be installed:
    
  •          https://github.com/erocm123/SmartThingsPublic/blob/master/devicetypes/erocm123/switch-level-child-device.src

If you want to try to fix this yourself, you're going to probably need to change the following section of code in every place you find it in the Parent Driver code.

    try {
        addChildDevice("Switch Level Child Device", "${device.deviceNetworkId}-ep9",
                [completedSetup: true, label: "${device.displayName} (Default Z-Wave Level)",
                isComponent: true, componentName: "ep9", componentLabel: "Default Z-Wave Level"])
    } catch (e) {
        runIn(3, "sendAlert", [data: [message: "Child device creation failed. Make sure the device handler for \"Switch Level Child Device\" is installed"]])
    }

and

    try {
        addChildDevice("Switch Level Child Device", "${device.deviceNetworkId}-ep9",
                [completedSetup: true, label: "${device.displayName} (Default Z-Wave Level)",
                isComponent: true, componentName: "ep9", componentLabel: "Default Z-Wave Level"])
    } catch (e) {
        runIn(3, "sendAlert", [data: [message: "Child device creation failed. Make sure the device handler for \"Switch Level Child Device\" is installed"]])
    }

and

    try {
        addChildDevice("Switch Level Child Device", "${device.deviceNetworkId}-ep101",
                [completedSetup: true, label: "${device.displayName} (Disable Local Control)",
                isComponent: true, componentName: "ep101", componentLabel: "Disable Local Control"])
    } catch (e) {
        runIn(3, "sendAlert", [data: [message: "Child device creation failed. Make sure the device handler for \"Switch Level Child Device\" is installed"]])
    }

These will all need to be changed to match Hubitat's Composite Device Driver add ChildDevice() command which is documented here:

As you can see, Hubitat requires FEWER arguments to be passed in the parameters section.

1 Like

I was looking at that thread to compare, ill have another look thanks.

I probably should wait for @ericm , LOL

Just playing around, would this work?

addChildDevice("Switch Level Child Device", "${device.deviceNetworkId}-ep9", [ Name: "$(ep9)",label: "${device.displayName} (Default Z-Wave Level)", isComponent: true])

For one of them, I realize i'd have to change all 3

Minor edit... I believe things are case sensitive, so this might work better:

addChildDevice("Switch Level Child Device", "${device.deviceNetworkId}-ep9", [name: "$(ep9)", label: "${device.displayName} (Default Z-Wave Level)", isComponent: true])
1 Like

Another edit i dont think i need the $ in front of (ep9) in the map properties

addChildDevice("Switch Level Child Device", "${device.deviceNetworkId}-ep9", [name: "(ep9)", label: "${device.displayName} (Default Z-Wave Level)", isComponent: true])

1 Like

i'm a bit too nervouse to modify the driver but its fun to learn and hopefully @ericm chimes in :slight_smile:

Just go for it. You’re not going to break anything with these minor tweaks.

1 Like

I believe the problem is just the namespace in the child driver. The namespace of the child needs to match the parent unless you specify it when creating the child device. Try the handler that I just uploaded:

2 Likes

Thanks @ericm ! that worked , im glad it was a simple fix, cheers.

These child devices will be very useful

2 Likes

Great, glad you got it working! :slight_smile:

1 Like