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

Current is NOT displayed as negative value #99

Open
pstrand1959 opened this issue Nov 6, 2024 · 1 comment
Open

Current is NOT displayed as negative value #99

pstrand1959 opened this issue Nov 6, 2024 · 1 comment

Comments

@pstrand1959
Copy link

Negative current values are not correct.

-1.0A is showed as -2999,000 A

Current Phase 1 2,600 A 2,6A
Current Phase 2 −2 998,800 A -1,2A
Current Phase 3 −2 999,100 A -0,9A

@pstrand1959
Copy link
Author

pstrand1959 commented Nov 7, 2024

Made a small fix for this because simpleatof() doesn't handle negative values.

void parseRow(const char* obisCode, const char* value) {
    double obisValue;
    char tmp[16];
    strcpy(tmp, value);
    if (tmp[0] == '-')
    {
      tmp[0] = '0';
      obisValue = -simpleatof(tmp);
    }
    else
    {
      obisValue = simpleatof(tmp);
    }

    parseRow(obisCode, obisValue);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant