openLuup and device_json

If “device_json” is changed with “luup.attr_set”, the file “user_data.json” is changed too.

But when openLuup restart, it takes the value in the tag “staticJson” in the XML definition file, not the new value in “user_data.json” (as the Vera does).

Yes, this is the case at the moment. It makes initialization of any plugin which rewrites its own JSON file difficult, as you have no doubt found. It can be fixed.

I should explain the reason. The standard luup API was what was implemented in the first instance. Whilst the luup.create_device() call allows specification of the implementation file, overriding that defined in the device file, there is no such parameter to override the json file.

That call is used to rebuild all the device structures from the user_data file at system startup. It’s actually not a trivial matter to save and restore an entire system state.

Howver, it’s a simple enough change, but it was not a random oversight.

[quote=“vosmont, post:1, topic:189502”]If “device_json” is changed with “luup.attr_set”, the file “user_data.json” is changed too.

But when openLuup restart, it takes the value in the tag “staticJson” in the XML definition file, not the new value in “user_data.json” (as the Vera does).[/quote]

This is fixed in Release 6.

Thanks !
It’s ok now