-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nrg / Json Ouput does not work! #6
Comments
What did you to to figure out that the output json is truncated? |
Hi, I'm feeding the json data directly into JSON-Parser(11087). I assumed that it was due to the truncated output, so split the data into 3 separate fields. But the JSON-Parser still wasn't working. I noticed that instead of double quotes (") single quotes (') where put out which is not according to JSON specification. (e.g. {'V L1': 230.0}) Only after replacing the string with the json.dumps function in the output it started to work. What i did not test anymore is if the truncated output would be processed correctly internally using the json.dumps() function instead of the str() function. regards |
Hi @En3rGy,
I imported release 0.5 but that seemingly did not have JSON output for the "nrg" field enabled yet as mentioned here:
#4
So i downloaded and built the latest source version from github.
The JSON field was available in the Logic Module but was not populated with any data.
When looking at the code I found that the function to set the output field was not there:
14105_go-eCharger/src/14105_go-eCharger (14105).py
Lines 247 to 254 in fc0a768
after line 253 one would need
self._set_output_value(self.PIN_O_NRG_JSON, json.dumps(nrg_json))
Unfortunately it looks like the string fields are limited in length in the Module so the data gets cut short. To overcome this issue I split the field into 3 individual Fields:
https://github.com/En3rGy/14105_go-eCharger/compare/main...Lightning1984:patch-1?expand=1
Now the data is correctly exported in JSON format and can be further evaluated with e.g. the JSON Parser.
regards
The text was updated successfully, but these errors were encountered: