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

Multiple Sensor Updates at Same Timestamp #296

Open
git4-me opened this issue Jan 1, 2025 · 4 comments
Open

Multiple Sensor Updates at Same Timestamp #296

git4-me opened this issue Jan 1, 2025 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@git4-me
Copy link

git4-me commented Jan 1, 2025

Is your feature request related to a problem? Please describe.
I need to update about a dozen sensor values which I'm gathering and push them to HA on a regular time interval. I call .set_state(value) on each one. As a result the recorded timestamp is a little off.

Describe the solution you'd like
.set_state(...) should take an optional argument where you can give the timestamp of the recorded data. This would also allow to make the recording at the exact minute/second instead of being a few milliseconds off due to the time it takes to pull values and then call .set_state(...) on each.

Describe alternatives you've considered
A way to make at least all sensor updates to a device an atomic action. Like: 1. start update call (new API), 2. call set_state() on each, then 3. call push update (new API).

Thanks for considering this request.

@unixorn unixorn added enhancement New feature or request help wanted Extra attention is needed labels Jan 8, 2025
@unixorn
Copy link
Owner

unixorn commented Jan 8, 2025

I don't have much time to do more than maintenance on the project right now, but it does seem like a good idea.

@unixorn
Copy link
Owner

unixorn commented Jan 8, 2025

Maybe make the timestamp for a metric an optional argument that defaults to the current behavior if timestamp is unspecified.

@git4-me
Copy link
Author

git4-me commented Jan 8, 2025

Yes, the optional timestamp would be the best way. Is this something you could add? Thanks, Philipp

@unixorn
Copy link
Owner

unixorn commented Jan 9, 2025

Eventually. I don't have much time for doing anything other than maintenance right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants