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

Energy value stops incrementing #9

Closed
jonathanhofman81 opened this issue Sep 6, 2022 · 6 comments
Closed

Energy value stops incrementing #9

jonathanhofman81 opened this issue Sep 6, 2022 · 6 comments

Comments

@jonathanhofman81
Copy link

I experience problems with energy monitoring for some months now. It has worked correctly in the beginning. The problem started with one Crownstone that still reports power usage as expected, but does not increment the energy count. Recently more devices don't seem to update correctly anymore. It started with a high power user (the heat pump). It first worked correctly (or at least it seemed logical values), then it didn't increment the energy value on 'low' energy usage (+/- below 100W), now it does not increment any more. Also at the heat cycle for warm water (which typically uses between 800W and 1,2kW for 2 hours) doesn't show any energy increment.

image
Power usage heat pump

image
Energy usage heat pump

Now also the freezer and refrigerator seem of. For example, the freezer did use today (according to the crownstone) only 0.13kWh, while its power usage is +/- 34W. I would have expected an energy value larger 0.4kWh.

image
Power usage freezer

image
Energy usage freezer

The freezer crownstone only seems to report the larger energy spikes and not the background spikes anymore.

I don't know if this is related to #8. I expect it is different. Initially I expected it to be a problem with the crownstone firmware (counters that are to small or so), but now more devices have the same issue it might be something different. Are the energy counters switching to a lower resolution if it obtains larger values? I'm running the crownstones for a while so it could be that I reached some limit?

@jonathanhofman81 jonathanhofman81 changed the title Energy value stop incrementing Energy value stops incrementing Sep 6, 2022
@RicArch97
Copy link
Collaborator

RicArch97 commented Sep 6, 2022

When energy usage was just implemented, the incrementing logic was done by the integration, and the state of each energy usage entity was the total amount. However, when Home Assistant released their own energy management, this wasn't required anymore, as it now takes care of the delta's, resets etc to track a total value.

The implementation was simplified (since 2.0.0) to where the entity states are just the values directly reported by the Crownstones over USB updates, and rounded to 2 decimals as it's a floating point number with many digits. It is unlikely you will ever reach the maximum value on this, and even then it shouldn't stop counting, but rollover and become negative. This means there's basically no integration logic behind the value.

The integration was never endurance tested, and since HA basically runs 24/7 for most people it would be nice to see if something indeed did go wrong.

You could check the USB values for your specific Crownstones by adding this to your configuration.yaml file:

logger:
    default: info
    logs:
        crownstone_uart: debug

And then, track the logs live, as described in here https://www.home-assistant.io/integrations/logger/#viewing-logs

You should be able to see the updates from the Crownstones (1 minute interval). You'd want to check if:

  • If you have let's say 4 Crownstones, you get updates for all 4 of them. Watch crownstoneId and see if you receive updates for 4 different id's.
  • Watch the accumulatedEnergy value, and see if it changes. Best done for a device that has high power usage so you could actually see the value change.

If neither of the above statements are true, then it's likely not an issue with the integration, but UART / firmware related.

@AlexDM0
Copy link

AlexDM0 commented Sep 7, 2022 via email

@vliedel
Copy link

vliedel commented Sep 7, 2022

Hi, accidentally we have encountered a similar situation similar to yours a week ago. See this issue. We will have this fixed in firmware 5.7.

In the meanwhile, if possible, you can simply reboot the crownstone, and the accumulated energy reported by the crownstone should start at 0 again. The integration should recognize that (@RicArch97 should know if it actually does) and continue to increase the accumulated energy.

Regarding using the power to calculate energy on the HA side: that would also fix this, but is less accurate (as the power can change much quicker than what HA receives).

@RicArch97
Copy link
Collaborator

The integration should recognize that (@RicArch97 should know if it actually does) and continue to increase the accumulated energy.

The energy dashboard will indeed detect it as a reset and handle this. The actual sensor value on the entity is the Crownstone value so that will go back to 0

@RicArch97
Copy link
Collaborator

Hi, this issue should be fixed in the firmware 5.7 update as mentioned above. Can we close this issue now?

@jonathanhofman81
Copy link
Author

I can confirm that the issue indeed behaves as described by @vliedel. Interrupting the power indeed made that the crownstone starts the energy measurement. I assume we can close this issue as it is not caused by the home assistant plugin.

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

4 participants