Skip to content
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

wrong decimal handling for certain numbers #397

Closed
MMM-Tech-Support opened this issue Jul 8, 2024 · 8 comments
Closed

wrong decimal handling for certain numbers #397

MMM-Tech-Support opened this issue Jul 8, 2024 · 8 comments
Assignees
Labels
bug Something isn't working datasource pending release part of the next release version
Milestone

Comments

@MMM-Tech-Support
Copy link

Hey,

I use the JSON Datasource to get the atmospheric pressure via a HTTP GET command.
Screenshot 2024-07-08 at 14-00-43 Analytics - Nextcloud
It work's quite well.

When I analysed the data I recognized, that everytime the pressure has more than 2 decimal places the value is 1000 times to high.

So the value 1014.375 becomes 1014375
Please see the 3. column.

Screenshot 2024-07-08 at 14-03-11 Barometrischer Luftdruck in hPa - Analytics - Nextcloud

Here is the Graph and the the jumps between 1000 and 1000000 are clearly visible.

Screenshot 2024-07-08 at 14-03-35 Barometrischer Luftdruck in hPa - Analytics - Nextcloud

I checked the JSON file and the values are all correct.
So I think there is a bug in the JSON Parser.

Best regards and thanks for your work!
Heinrich

@MMM-Tech-Support
Copy link
Author

Hey again!

Here are some more informations to isolate the bug.
When I run the JSON Datasource in Test Run Mode, i get a correct reading and the value is correct parsed with 3 decimal places.

Screenshot 2024-07-22 at 22-53-33 Analytics - Nextcloud

When I load the same data in non test mode the bug happens and 1014.375 becomes 1014375.

Screenshot 2024-07-22 at 23-07-43 Luftdruck aktuell - Analytics - Nextcloud

Best regards!

@Rello
Copy link
Owner

Rello commented Jul 28, 2024

Hi,
for simpler debugging, can you attach the json example here?

@Rello Rello self-assigned this Jul 28, 2024
@Rello Rello added bug Something isn't working needs info feedback from requester required labels Jul 28, 2024
@MMM-Tech-Support
Copy link
Author

Hey,

Sure, it's attached. The JSON path to atmospheric pressure is data/values/0 to 720/110_133_828

The first datapoint with more than 2 decimal places is at data/values/1/110_133_828

atmos.json

Please let me know if you need more information and again thanks for your great work!!!
Best regards

@Rello
Copy link
Owner

Rello commented Jul 29, 2024

working for me. I will do some more testing.
is the error coming up when loading via the "load now" or during scheduled loads?

Bildschirmfoto 2024-07-29 um 20 48 23

Bildschirmfoto 2024-07-29 um 20 48 42

@Rello
Copy link
Owner

Rello commented Jul 29, 2024

I found it. single value update is ok. batch update is causing an issue on some values.

by the way: I do not know how you loaded the numbers above. but with the array-type loading, you can get the timestamp also from the json file

data/values{110_133_828 ,read_at_group,110_133_828}

then you have all values from the file. not the perfect format. this can be adjusted later, but I think this might be more what you need?

@Rello
Copy link
Owner

Rello commented Jul 30, 2024

fyi
Bildschirmfoto 2024-07-30 um 10 46 08

path string:

data/values{Luftdruck,read_at_group,110_133_828}

I can see that you are reporting on your environmental sensors. If you want to discuss a better integration, feel free to get in direct contact with me analytics(at)scherello.de

@Rello Rello changed the title JSON Parser as datasource handles floats with more than 2 decimal places wrong wrong decimal handling for certain numbers Jul 30, 2024
@Rello Rello added testing development finished; in testing datasource and removed needs info feedback from requester required labels Jul 30, 2024
@Rello Rello added this to the 4.15 milestone Jul 30, 2024
@tatrapikao
Copy link

same when using data from tables app. Value with 3 decimal values is parsed like: 9,600 -> 9,6 but 9,612 -> 9.612

@Rello Rello modified the milestones: 4.15, 5.1.0 Nov 5, 2024
@Rello
Copy link
Owner

Rello commented Nov 18, 2024

Hi,
just to confirm that the fix is working or me - next version coming shortly

Bildschirmfoto 2024-11-18 um 21 33 27

@Rello Rello added pending release part of the next release version and removed testing development finished; in testing labels Nov 18, 2024
@Rello Rello closed this as completed Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working datasource pending release part of the next release version
Projects
None yet
Development

No branches or pull requests

3 participants