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

TZ issue with get_history() ? #2168

Open
bbrendon opened this issue Nov 29, 2024 · 1 comment
Open

TZ issue with get_history() ? #2168

bbrendon opened this issue Nov 29, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@bbrendon
Copy link
Contributor

What happened?

1]bbrendon: anyone use get_history() ? its not working for me anymore. not sure when it stopped.
[09:41]bbrendon: for me it always returns []
[09:45]bbrendon: hmm ...changing it to days=1 returned something. weird.
[09:46]Andrew Cockburn: Are you using a dev build?
[09:49]bbrendon: yea.
[09:49]bbrendon: changing it to hours=12 vs hours=5 returns data. i'm tihnking its a TZ issue now.
[09:49]Andrew Cockburn: Ok - there were some minor changes in there recently
[09:50]Andrew Cockburn: Appreciate any testing you can do to narrow it down
[09:50]bbrendon: my code worked once upon a time. seems something changed in AD. either a bug was added or a bug was fixed that broke my code . heh
[09:55]bbrendon:
start_time = dt.datetime.now() - dt.timedelta(hours=10)
data = self.get_history(entity_id="sensor.rs_temp_masterbedroom_temp", start_time=start_time)

Returns data starting at 7:53 AM which is only 2 hours ago
[09:56]bbrendon: but I asked for 10 hours.
[09:56]bbrendon: and pacific time is 8 hours ...
[10:26]bbrendon: using dt.datetime.now(dt.timezone.utc) didn't help.

Version

dev

Installation type

Home Assistant add-on

Relevant log output

No response

Relevant code in the app or config file that caused the issue

No response

Anything else?

No response

@bbrendon bbrendon added the bug Something isn't working label Nov 29, 2024
@bbrendon
Copy link
Contributor Author

I think run_every() is also broken. It seems as long as you specify start time object, you're going to have TZ issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant