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


(Dale C) #1

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?


(Jason "The Enabler" as deemed so by @Smart) #2

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.


(Dale C) #3

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


(Jason "The Enabler" as deemed so by @Smart) #4

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.