Possible Bug found on driver switching

Some will argue but I'll probably stand my ground.

I've a device that has problems with the 'Generic' driver. So I implemented a community driver. When I did that the community driver had a capability my device did not have.
I modified the community driver to remove this capability, and updated the device.
The dashboard would not stop showing my removed capability - even tho the new driver no longer had this capability.
I realized that updating the driver didn't clean up the related records in the DB about my device.

It is my humble opinion that the logic behind changing a driver should also clear the device records related. By removing and reinstalling the device I was able to clear the problem - but that shouldn't be necessary - again. IMHO.
Another option - during the driver change a 'Do you wish to remove all related Event/Log/Stored values' option for the driver so as to clear the history and begin anew. This must surely affect other basic changes in the heart of someones environment!

You can work with your Community Driver developer to add the feature. Added to v2.2.8 was a Method to remove attributes and that Method did Not exist before.

One developer that has released code to make use of this is:

In other words, it's a pretty new feature and hasn't been well deployed yet.

2 Likes

BLESS YOU. It worked T.I.T.S. - (Thoroughly Improved The Situation). Saved me from rebuilding 11 devices!

To be clear, do you mean actual capabilities, or just events that may have been generated from attributes that were part of a no-longer-implemented capability? For the latter, the suggestion above is what you want (and I could see arguments for going either way there, but this at least gives you some flexibility).

If you mean that apps like Dashboard still "see" the device as implementing (or declaring as such) the capability, like they show up under "capability.switch" inputs after you remove capability "Switch" from the driver, then that seems like a definite problem to me--but would be a different issue.

EDIT: Annnnnd, nevermind, it's the first issue. Suppose I'll leave this here in case anyone else is wondering. :slight_smile:

1 Like

@bertabcd1234 ty. your initial suggestion - which I followed - to remove the capability resolved my first problem. But left behind was assumedly a state of a capability. I knew something was wrong because the first device I tested on my driver mod (a fresh install) didn't have the problem, but simply changing the driver on all the other identical devices still did.
That 'clear' made it go away and I didn't have to rebuild each device individually. thank the gods. and just as an aside @bert... just removing the capabilities but still using the rest of the ohlalabs driver has stopped my device from showing in the watchdog ... the original problem! So the refresh features of the Ohlalabs driver work vs the generic zigbee outlet driver which doesn't.