[Deprecated] Hampton Bay Zigbee Fan Controller Driver (with Component Devices)

Removing and re-adding doesn't do the trick either. How did you guys swap out stephack's driver for the new built in driver? Completely remove stephack's driver code first?

Going to test a couple of things now and get back to you shortly.

So the first time I did this, I removed all my child components first and it worked fine.

I just did my Bedroom fan and it seemed to work as well..however it only created the fan component. I had to turn the component feature Off and then On again and then both component devices appeared.

What steps did you take initially before choosing the new driver? Did you remove the component devices first..are the component devices from my driver still listed?

Interesting, I can't remove the children. The "Remove" button is pink (greyed out red if you will) and I get the "ghostbusters" sign when I hover over it.

I've tried changing the driver on the parent, it keeps the old children. I've tried deleting the parent completely and that deletes the children. However when I try to add device it defaults to your driver to add it back and when added the children are already there.

I had to change one bit of code to allow manual deletion of the components first. It doesn't seem to matter anyway because I tried it again with another fan without removing the components and it worked.

This probably works like ST and defaults to a User driver over the built in driver if both are present for a device.

  1. Delete the fan completely again.
  2. Then delete my driver.
  3. Re-pair the device.

There is probably a simpler way, but I'm pretty sure this would works. I personally hate completely removing these controllers because they can be so difficult to re-pair

The problem I have deleting your driver first is that I have 4 fans using it. What happens to the other 3 while I remove and re-add this one?

I can't delete your driver with removing all 4 fan controllers first it seems:

"Referential integrity constraint violation: "FK_HS4W547FIMWHJI3BGM33PM9PX: PUBLIC.DEVICE FOREIGN KEY(DEVICE_TYPE_ID) REFERENCES PUBLIC.DEVICE_TYPE(ID) (419)"; SQL statement: DELETE FROM DEVICE_TYPE WHERE ID = ? [23503-197]"

Well, I guess "if it ain't broke, don't fix it" is going to apply here. What a pain...

If you want to try to delete the component devices first. Change the following on lines 129 and 141 of the fan controller parent driver:
Change isComponent: true to false.

You should now be able to delete the component devices.

Ok, here's what I did:

  1. Modified the code
  2. Had to recreate the children
  3. individually removed the children
  4. went back to the parent and changed to default driver.
  5. Clicked "save".
  6. Turned on the switch that "will create two additional devices".
  7. Clicked "save".

Switch from step 6 went to "off" again and no child devices were created.

Then...

  1. Removed parent device
  2. Re-added parent device

It defaulted to your driver again and I'm back to where I was before. Complete with child devices using your drivers.... UGH!

I really don't want to delete all 4 parent devices just to delete your drivers and hopefully re-add the fans without other problems.

Yes, I forgot that step.
Sorry you are having this issue, but that's all I can think of right now. If something else puts in my head I'll shoot you a message. Good luck.

Took the plunge... Whacked all 4 fans... Removed stephack drivers... Added all 4 fans back. STILL can't turn on the "will create two additional devices" switch.

Sounds like you might need the Mighty @mike.maxwell. Also turn on debugging and post any errors generated while flipping the component switch.

Does the switch stay in the "on" position for anyone?

Do the children, if created, show up under the parent like when using the stephack driver?

I have "Enable debug logging" on for the parent device. Nothing at all shows up in logs when I save the parent with the "create two additional devices" switch "on".

Have you tried rebooting the hub? Worth a shot.

Just did one of my 3 fans...

  • All I did was change the driver and hit save.
  • Then hit the configure button, hit it again for good measure
  • Turned on the 'create two devices' switch and hit Save
  • Noticed an error in the log
  • Turned off the 'create two devices' switch and hit Save
  • Turned on the 'create two devices' switch and hit Save

Looks like I'm all setup now.

Ok, got it working. Not 100% sure how or why this fixed it but....

  1. Turn off debugging
  2. Save
  3. Turn on debugging
  4. Save
  5. Turn on "create two additional devices"

what a pain...

Sometimes I feel like nothing with this controller comes easy....but it's the only one like it out there..so its pain I am willing to bare.

Glad you got it working though.

Yeah, this controller is a bit of a pain. Just not sure what turning debug off and on has to do with creating children though. A bug?

Thanks for your help and thanks for writing your driver that got us this driver!

1 Like

If a child device is set "component=true" you can only delete if via the parent device.

As for the built in driver, like all drivers there are two "Save" buttons. If you turn on the "create additional devices" toggle you need to click the first save button in the that preferences section. Not the save in the section name section below.

This should create two devices with the same DNI name as the parent device but with a "-Light" and a "-Fan" and a display name of the parent device name with a " Fan" and " Light" added.