@chris Before I invest too much time digging into this, I thought it best to get your thoughts first.
I have 2 Schlage/Allegion BE469ZP door locks. The configuration for these locks support up to 30 user codes. And, there’s a user label associated with each user code.
When adding a user code and label, both the code and the label are stored in the thing config. However, it appears that the label is getting lost at some point after this. By lost I mean that the usercode_label_NN config parameter is no longer in the thing configuration. I don’t know if it’s getting lost at binding restart, or if /when the node is reinitialized, or at some other point. I haven’t investigated far enough to figure that out.
What I guess is unusual about the label config parameter is that, unlike the user code, it’s not a config parameter that’s stored in the device. It exists only in the binding. Perhaps that’s a clue what might be going on?
Both the label and the code config parameters are added at the same time, so if one is added, then they both should be. I don’t see anything wrong with the config definition, so the core/ui should be able to display this ok.
The binding doesn’t do anything with the label if I remember correctly - it’s just config parameter that is stored in the json database (the same as all config parameters). The fact that it doesn’t get sent to the device shouldn’t matter - it’s “just” stored by the core, and presented in the UI.
I searched the binding code, and it seems that this label is never stored by the binding - ever - so it shouldn’t be removing this.
I don’t think any of this code has changed for a long time so if this worked before (and I believe it did) then I’m not sure where it changed.
Thanks for the insights. That should help me narrow down where to look.
Ugh! Another one of these issues.
I recently added 2 new user codes and labels. Those 2 labels are still in the jsondb. All the other labels (about a half dozen or so) are gone from the jsondb.
I did a reinit of one of the lock nodes, and the labels remained intact. I also did a binding restart, and the labels also remained intact. So, what you say here about the binding not doing anything with the labels would seem to make sense. But something is causing them to be removed from the jsondb. I just can’t figure out the condition(s) under which it’s happening.
As far as I can see, the binding doesn’t touch these config parameters, so they should remain until the thing is removed as far as I know. I just had a quick look at the code and can’t see any way it can be removed. From what I can see in the code for the configuration class, it’s only possible to remove the config value by explicitly calling the remove method, which isn’t done in the binding as far as I can see.