Looking for help on modifying smartapp to work with two different DH

I wrote my first smartapp for doing 3-speed ceiling fan control from temperature. It was done for a custom device handler for the GE Fan Speed controller which is Z-wave.

There is a new zigbee device handler being developed by @ranga for a new Hampton Bay controller and it uses a different technique for changing speeds of Speed1, Speed2, Speed3, Speed4 compared to the GE Z-wave device handler was something more in line to a dimmer with 3 set points for speed control; Hi, Med, Low.

Anybody with ideas on how I might change the code so that regardless of which DHT I picked it would work?

Or maybe it makes more sense for me to modify the DHT of zigbee to make it more compatible with the existing zwave?

I am trying to avoid having two separate smartapps if possible because to me seems more likely to cause confusion, right?

You could create a parent child scenario in which the user would create a child for each fan. The child would give the user the ability to choose which dth capabilities they need.

Something like a toggle…

Enable this toggle for a three speed fan, disable for six speeds. And based on the toggle position only certain capabilities are available.

You can also make it so that the toggle, once selected, can’t be changed without having to rebuild the child.

2 Likes

I like it. Have you got a good resource example that I can learn about making a parent-child app?

You do it one of two ways…

All in one app… Which is really not the preferred method, or as two apps, a parent and child.

CoRE and ask Alexa are both in a single app.
EchoSistant is in two apps.

Also look at the ST documentation on child parent apps.

1 Like