Example of how to extract say the 'Template' from the dump file? #77
-
Example of how to extract say the 'Template' from the dump file? For example one may have a dump file, but just need the device template, not the entire dump file. If one restores the entire dump file back to the device, that would be overkill when only the template is needed. This would be a typical use case for a typical user, one would think. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Use JSON output format for backup instead of dmp files, this allows editing of your backup data and restoring subset of data. Example for 'Template' related config data: Step 1: Extract dmp data into human readable format (JSON)decode-config.py -s config.dmp -o config.json to reduce the JSON file before editing, the output can be limited to a command group (template is part of the Management command group): decode-config.py -s config.dmp -o config.json -g Management This creates an editable JSON file config.json. Both examples work, but the second only contains the configuration data of Management cmnd and is easier to work with. Step 2: Edit the generated JSON file to limit it to the desired dataWe need the main JSON keys containing "template", all others can be deleted (delete also the complete main key "header", it contains a template subkey which is not needed). After editing, it should look like this: {
"templatename": "Generic",
"user_template": {
"base": 18,
"flag": 0,
"gpio": [
65504,
65504,
65504,
65504,
65504,
65504,
65504,
65504,
65504,
65504,
65504,
65504,
65504,
4704
],
"name": "Generic"
}
} Note: Be aware to delete the last comma after the last key as described (see Hint under Restore subset of data). Step 3: Write back data to dmp file or to a device directlyOverwrite your original dmp file 'config.dmp' decode-config.py -s config.dmp -i config.json Write template to device direclty decode-config.py -s 192.168.15.9 -i config.json Note for ESP32:For ESP32 based device, always keep the key "config_version" within your JSON. {
"config_version": 1,
"templatename": "NeoPool",
"user_template_esp32": {
"base": 1,
"flag": 0,
"gpio": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
1,
1,
1,
0,
0,
6976,
0,
0,
0,
0,
0,
7008,
1,
0,
0,
0,
0,
0,
0
],
"name": "Atom Lite Sugar Valley"
}
} If your are using group limit -g, append group 'Internal' to get this key within your JSON: decode-config.py -s config.dmp -o config.json -g Management Internal |
Beta Was this translation helpful? Give feedback.
-
For what reason I cannot create a new dmp file from modified JSON file? With above description I only can update existing dump file but I need to remove options from dump file. That is required if you remove rules and add scripts to firmware. |
Beta Was this translation helpful? Give feedback.
-
I like to switch between firmware compiled with Now I can confirm test 2 & test 3 on decode-config works without any error. However, I cannot finally test the behavior because of Tasmota issue 20702. What looks still unusual to me, after running test 2 and 3 even with new content in rules or scripts parameter I get this output: Also a
My I would not expect the element name to be changed, however the content should have changed from -i json file. |
Beta Was this translation helpful? Give feedback.
Use JSON output format for backup instead of dmp files, this allows editing of your backup data and restoring subset of data.
Example for 'Template' related config data:
Step 1: Extract dmp data into human readable format (JSON)
to reduce the JSON file before editing, the output can be limited to a command group (template is part of the Management command group):
This creates an editable JSON file config.json.
Both examples work, but the second only contains the configuration data of Management cmnd and is easier to work with.
Step 2: Edit the generated JSON file to limit it to the de…