ioBroker / ioBroker.zwave

Legacy Z-Wave integration using OpenZWave
Other
24 stars 7 forks source link

Objects get lost after restart of adapter #75

Closed LaplaceII closed 4 years ago

LaplaceII commented 4 years ago

Hello,

I made a fresh install of the 1.6 iobroker.zwave adapter (before deletion of 1.5.1 iobroker.zwave adapter). After all devices were recognized and included I renamed needed objects within iobroker objects page (column name) to have clear arragements wihin Blockly. Just for validation reasons I restarted the adpater. All zwave objects which were renamed before were deleted after adapter restart. It would be good to hold the renamed objects after a restart.

Thanks for support Michael

Apollon77 commented 4 years ago

What exactly was changed? Only the names?

LaplaceII commented 4 years ago

Yes, I did changes in the column Name only (right beside column ID). Afterwards a instance restart followed by the loss of renamed objects. e.g. I changed the name of the node11 and the sub object switch_1 (see also attached picture). After a restart of the instance the name of the node11 remains (good). But the object switch_1 disappeared (not good) completely. After a second restart of the instance the object switch_1 appeared again. However, I lost the individual name of the relevant object which is used in Blockly. Combined with more than 50 devices it is quite important to have these names to maintain the overview in Blockly. A new naming of the relevant objects after a instance/adapter restart is quite a hazzel.

Anmerkung 2019-09-07 165912

AlCalzone commented 4 years ago

@cburghardt that looks like your recent objects cleanup changes

cburghardt commented 4 years ago

The names/labels are defined by the underlying library. So if you change them I am not even sure if the functionality still works. For example if you have a multi switch this could already break. But @AlCalzone you are correct that the cleanup causes those deletions. I don't see any way to distinguish between a name change defined by ozwave and by the user.

LaplaceII commented 4 years ago

Up to now I had no functionality issues after editing the Name column. One possibility to bypass the issue is to export the zwave objects, do the restart/reinstall and import the objects. But I did not test it up to know.

Apollon77 commented 4 years ago

@cburghardt why names are used here? Ideally IDs should be the identification stuff because are unique and unchangeable

cburghardt commented 4 years ago

@Apollon77 that's the point, when the library introduces naming changes then come in as duplicates. I thought about it but can't figure out a way to differentiate between those changes and the ones from the user. I guess I have to revert that function and leave the cleanup to the user.

cburghardt commented 4 years ago

@AlCalzone can you please remove the call to cleanupValueId in line 1325? I did not find any reliable way to safely cleanup the duplicates as I don't know who renamed them in the first place. So the user has to delete the old states himself.

AlCalzone commented 4 years ago

I'm currently on vacation. Ingo can merge and release changes if you provide a PR.