Comments (5)
This is one of the rare examples where the data structure has changed so structurally that you have to choose one of two options:
- convert the data manually within your JSON backup
- ignore the warning using -w. This will restore all except the changed structure
There is currently no functional conversion from old to new data in decode-config. Since data is simply read in on the basis of JSON identifiers, the data structures of old systems must basically be the same. A field can become larger and smaller, a variable can take on a different size, all that's handled.
This system weakens when there are structural changes. In the past, I used new JSON identifiers for the few changes of this kind (there were maybe 2 or 3), with the result that this procedure simply did not convert these fields because the new identifier did not exist in the old JSON.
I never wanted to have too much functional data dependency in decode-config, because for this I would not only have to keep track of the data structure changes in the past, but also functional dependencies. That means a lot of work when maintaining the Tasmota cmnds (-T cmnds), because I do not only track the file changes in setting.h, setting.ino and tasmota.h, but also have to pay attention to command implementations in the history. I didn't really want to add more.
from decode-config.
Thanks for the details.
Unless I missed it, this is not detailed in the manual. Worth a word and a link to this issue ?
So far the workaround I found is probably the only good one:
- Install the firmware matching the JSON backup (could be on a nodemcu if not possible on the device itself)
- Restore the backup
- Upgrade the device with the target version
- Backup JSON
from decode-config.
Install the firmware matching the JSON backup (could be on a nodemcu if not possible on the device itself)
Unnecessary, take it easy:
use your old backups and restore it on new device. Use parameter -w if warning occurs. This does what intuitively you would expect except what it can't - here it restores all from your backup from the previous release config data except sensors
. This will be output during restore:
./decode-config.py -s v9_5_0_8_device -i 9_5_0.json -w
Load data from device 'v9_5_0_8_device'
WARNING 9 (@4247): file './ 9_5_0.json' array 'sensors[3]' exceeds max number of elements [2]
WARNING 9 (@4247): file './ 9_5_0.json' array 'sensors[10]' exceeds max number of elements [4]
WARNING 9 (@4261): file './ 9_5_0.json' array 'sensors' couldn't restore, format has changed! Restore value contains <class 'str'> but an array of size [4] is expected
WARNING 9 (@4247): file './ 9_5_0.json' array 'sensors[10]' exceeds max number of elements [4]
WARNING 9 (@4261): file './ 9_5_0.json' array 'sensors' couldn't restore, format has changed! Restore value contains <class 'str'> but an array of size [4] is expected
Restore successful to device 'v9_5_0_8_device' from './ 9_5_0.json'
these are just warnings, not errors
from decode-config.
As I said, there have been two or three objects during the entire Tasmota life since v5.10 that have had such a structural change, sensors
is now the fourth.
I think we can live with either adapting this single object manually in JSON or skipping it with the -w
parameter.
from decode-config.
Thanks
from decode-config.
Related Issues (20)
- Allow to source non-dmp files for format conversions in one fell swoop HOT 2
- decode-config behind a proxy ERROR 10 (@3892): Device did not respond properly HOT 3
- Managing multiple devices
- Release action for packaging and publishing reference outdated version on release update HOT 1
- Github Release Action for adding binary executables to Release Assets HOT 13
- Syntax Error for use of 'nonlocal' HOT 5
- Command option - TimeZone command is not proper
- intermittent struct.error HOT 3
- convert json to dmp doesn't find json file HOT 3
- dmp-file size tasmota13.1.0 seems to mismatch decode-config file size requirement
- Invalid continuation character with UTF-8 encoding HOT 4
- Ignore minor version changes automatically HOT 4
- returncode to bash is always 0
- Example of how to extract say the 'Template' from the dump file?
- utcfromtimestamp() deprecated HOT 1
- "--output-format cmnd" outputs DzIdx1 wrongly as DomoticzIdx1 etc... for all Domoticz related commands
- Missing module setting in the JSON file for ESP32-C3 ("config_version": 4) HOT 6
- array 'ds3502_state' couldn't restore, format has changed HOT 3
- Error restore script json into rules based config
- fallback_module bug HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from decode-config.