Skip to content

Daily energy intermittently incorrect #2

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

Open
bubonicbob opened this issue Feb 15, 2024 · 1 comment
Open

Daily energy intermittently incorrect #2

bubonicbob opened this issue Feb 15, 2024 · 1 comment

Comments

@bubonicbob
Copy link
Contributor

As the day rolls over, the daily energy can be incorrect for the previous day. See discussion here.

I can show that it is intermittent based on the data here. This should mean that it is either an issue with the sampling rate of this library or when the Daikin unit internally samples the data.

The fix could be similar to how _compute_diff_energy takes into account the previous time slice (day) to see if there is fractional energy that would be otherwise missing.

@bubonicbob
Copy link
Contributor Author

For discussion, I thought it may be interesting to log the unit's time when a data sample was returned. That is, add a list alongside _last_update_by_resource called _last_unittime_by_resource that would be set to the value of cur from the common/get_datetime query.

This is for cases where the unit is set to a different time zone as the client and therefore you could not use the local time to see when a time boundary had been crossed (e.g. when one day switches to the next). Without this extra context, as _compute_diff_energy shows, there is ambiguity for when the extra energy should be added. For example, you could accidentally add the extra energy multiple times in the case where the energy is equal and has not increased across several queries for the data. The code does not seem to know if it had already added yesterday's discrepancy.

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