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

Powermeter energy values float precision #50

Closed
cwihne opened this issue Feb 17, 2024 · 3 comments
Closed

Powermeter energy values float precision #50

cwihne opened this issue Feb 17, 2024 · 3 comments

Comments

@cwihne
Copy link

cwihne commented Feb 17, 2024

Reading and interpreting powermeter values, I came across the wish to have kWh with float precision like 7.54 kWh. So far, TAG_PM_ENERGY_Lx deliver int kWh. I found my experience isn't good enough to change them to float, so I changed in RscpMqttMapping.h:
from { TAG_PM_DATA, TAG_PM_ENERGY_L1, 0, "%s/energy/L1", "", F_FLOAT_D, UNIT_WH, 1000, 0, false, false, false },
to { TAG_PM_DATA, TAG_PM_ENERGY_L1, 0, "%s/energy/L1", "", F_FLOAT_2, UNIT_WH, 1, 0, false, false, false },
...
(changing F_FLOAT_D to F_FLOAT_2 didn't help, it's still integer + the original is UNIT_KWH, but change also didn't help)
Depending on your preference, is there a chance to change this to float from your end, or help by pointing to the correct changes for me to apply?

@cwihne cwihne changed the title Powermeter values float precision Powermeter energy values float precision Feb 17, 2024
@pvtom
Copy link
Owner

pvtom commented Feb 18, 2024

Hello,
I have changed the code.
If you like you can check out the branch "dev" (not "main" as usual) with the changed files RscpMqttMain.cpp and RscpMqttMapping.h
Best regards
Thomas

@pvtom
Copy link
Owner

pvtom commented Feb 18, 2024

will be fixed with release v3.16

@cwihne
Copy link
Author

cwihne commented Feb 18, 2024

Checked the dev branch. The change works just great. Thank you.

@cwihne cwihne closed this as completed Feb 18, 2024
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

2 participants