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

Fetch the previous minute to ensure completeness #152

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amscanne
Copy link

Since there is no reset that occurs for the MINUTE scale, ensure that we have a complete data point by using the previous minute. Initial results suggests that this eliminates noise I see using Emporia Vue Connect (but I can let it bake longer, and figured I'd send the PR in case there's some fundamental fact that I'm missing).

@magico13
Copy link
Owner

I believe the API will return the last full minute data, not the current partial one, which is why there's currently an up to two minute delay between turning something on and the usage showing up in Home Assistant. The API also sometimes just returns 0 or None so this might be a way to prevent those results. I think I might provide this as an option, since I've got one set of people who want the delay to be smaller so they can automate on devices turning on/off and another set who want more reliable data for historical purposes.

What were you seeing before this change? Empty/0 values or partial values?

@DabblerIOT
Copy link
Collaborator

I like your idea. I think you would need to do a request for every channel? (will look at repo)

I forked pyemvue and have it running without missing data for about half a day now adding sanity checking and retries for the valid / empty response (just nulls on first meter) bug on api.emporia-energy.com and retries for the server returning 500 server unavailable. Data is clean about 11 hours now. (test still running). I will put a pull request in pyemvue next week if it's still good. Issue 39 on pyemvue.

@DabblerIOT
Copy link
Collaborator

Looked at your fix. Is this intended to fix values logged as 0, none, or unknown? If so I don't think the problem is with the time or incorrect, but it is with emporia server returning a bogus message or a 500 error. I coded in retries on issue 39 on pyemvue.

If you really have verified this is an issue (not sure how you could have) my question would be is one second enough.. I doubt the time on all of our systems is accurate to the second.

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

Successfully merging this pull request may close these issues.

3 participants