Programmatically change driver capabilities

I'm developing custom sensors and matching driver(s) for my new home.
Basically I'll have 25 XBee devices, where each one might be connected to one or more sensors: presence/mmwave, temperature+humidity, illuminance, door/reed switch, proximity and etc.

On the XBee side I've already developed a single codebase that supports any combination of sensors. Meaning, I don't need to maintain different codes for each combination. I just load the same code on every XBee and a text file defining the enabled sensors.

On the Hubitat side my intention is to also have a single codebase/driver for all devices, otherwise it will be very complex and error prone to maintain all possible combinations of sensors with a different driver for each.

Is it possible to programmatically change driver capabilities?

That way, each XBee would report to Hubitat the capabilities it has and the driver would dynamically adjust itself to be compatible.

No, sadly. :cry:

You could however do a library with all the core code and have drivers with different capabilities that just load the library.

Asked for many times over many years and always with a polite, but firm, "no thanks". :smiley:

You could implement your drivers using the Parent/Child model. Thus, each device would have a Parent Device, which could create a child device for each of the active Capabilities for that particular Xbee device.

My HubDuino drivers are designed in the manner, as it also allows 2 or more of the same Capability for a single device.

5 Likes