Closed reini-1 closed 7 months ago
I think the Nous A1 did not have this poti functionality and default tasmota did not have this compiled in as I found in the documentation/posting, so I think it is not a problem to change the value to something in the limits:
$ decode-config --source nousa1t01 --json-show-pw | jq '.ds3502_state = [127,0,0,0]' | jq '.hostname = "foo"'
> new_config.json
but than the next value error pops up:
$ decode-config --source nousa1t01 --restore-file new_config.json --dry-run
INFO: Load data by http from device 'nousa1t01'
WARNING 9: file './new_config.json' - {'energy_kWhexport_ph': -17034004} (valid range exceeding)
Premature exit - #9 Restore data error
WARNING 9 (@5444): file './new_config.json' array 'energy_kWhexport_ph' couldn't restore, format has changed! Restore value contains <class 'list'> but an array of size [3] is expected
Premature exit - #9 Restore data error
jq .energy_kWhexport_ph new_config.json
[
8895872,
-17034004,
-1107109
]
This is also no feature of default image: https://tasmota.github.io/docs/Smart-Meter-Interface/
Is there something to ignore errors on values the firmware did not support?
After fixing this value also to something accepted, restore worked:
$ decode-config --source nousa1t01 --json-show-pw | jq '.ds3502_state = [127,0,0,0]' | jq '.energy_kWhexport_ph = [0,0,0]' | jq '.hostname = "foo"' > new_config.json
$ jq .energy_kWhexport_ph new_config.json
[
0,
0,
0
]
$ decode-config --source nousa1t01 --restore-file new_config.json --dry-run
INFO: Load data by http from device 'nousa1t01'
INFO: * Simulating Restore successful to device 'nousa1t01' from './new_config.json'
$ decode-config --source nousa1t01 --restore-file new_config.json
INFO: Load data by http from device 'nousa1t01'
INFO: Restore successful to device 'nousa1t01' from './new_config.json'
$ decode-config --source nousa1t01 --json-show-pw | jq '.hostname, .ds3502_state, .energy_kWhexport_ph'
"foo"
[
127,
0,
0,
0
]
[
8895872,
-17034004,
-1107109
]
The value of energy_kWhexport_ph is restored on the device to the original values again.
These kinds of errors (values are outside valid ranges) originally come from junk within Tasmota setting (due to updates or other previous issues). Such device configurations should be reset once (e.g. Reset 2
) to get an clean valid Tasmota config.
Alternatively use decode-config parameter -w
to suppress exit for warnings.
Describe the bug
I cannot restore downloaded json of a Nous A1 Plug. I would like to download the json, change something with e.g. jq or ansible and upload the modified config but I already get an error when I try to upload the downloaded configuration without changes.
So ideally I would do something like this:
But there are two problems:
The second can be workaround with a temporary file but for the first I have no idea to fix this. It would be nice if decode-config would also accept the restore file from stdin.
To Reproduce
Expected behavior
Config would be uploaded and updated.
Version Information
System' information of your Tasmota data
Additional context
In the end I would create an Ansible playbook, that first downloads the configuration decode-config, changes/updates something according to the Ansible inventory and than uploads the new configuration with decode-config if something has changed.