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

Error Setting up platform - time zone offset not present #13

Closed
zachsteffens opened this issue Jun 2, 2019 · 6 comments
Closed

Error Setting up platform - time zone offset not present #13

zachsteffens opened this issue Jun 2, 2019 · 6 comments

Comments

@zachsteffens
Copy link

zachsteffens commented Jun 2, 2019

I'm having a problem with the climate.py script.
It doesnt seem to be pulling the localTime correctly, here is the error message
File "/config/custom_components/infinitude/climate.py", line 193, in update "%Y-%m-%dT%H:%M:%S") # Strip the TZ offset, since this is already in local time File "/usr/local/lib/python3.7/_strptime.py", line 577, in _strptime_datetime tt, fraction, gmtoff_fraction = _strptime(data_string, format) File "/usr/local/lib/python3.7/_strptime.py", line 359, in _strptime (data_string, format)) ValueError: time data '2019-06-02T14' does not match format '%Y-%m-%dT%H:%M:%S'

When I go to the infinitude page i can see localTime does not have a timezone offset.

localTime | 2019-06-02T15:19:08

So I removed the string slice on line 193 and updated to this and it seemed to do the trick.
original
dt = datetime.datetime.strptime(getSafe(self._systemStatus, "localTime")[:-6], "%Y-%m-%dT%H:%M:%S") # Strip the TZ offset, since this is already in local time
updated
dt = datetime.datetime.strptime(getSafe(self._systemStatus, "localTime"), "%Y-%m-%dT%H:%M:%S") # Strip the TZ offset, since this is already in local time

@zachsteffens zachsteffens changed the title Error Setting up platform Error Setting up platform - time zone offset not present Jun 4, 2019
@Bchap9
Copy link

Bchap9 commented Jun 5, 2019

I had this same issue and after tons of code changes and other troubleshooting the time was off on the thermostat.

@aicarmic
Copy link

+2. This fixed my issue.

@MizterB
Copy link
Owner

MizterB commented Jul 28, 2019

If anyone is willing to share their localTime strings here, that would be helpful in debugging. I obviously don't have this problem.

It can be found at http://<infinitude_server>:3000/api/status. Right now, mine is "2019-07-28T12:44:39-05:01" (US EDT)

@aicarmic
Copy link

@MizterB here is what the API returns, along with the actual time. It looks like no offset is needed if the unit is configured to the local timezone and the adjust for daylight savings is enabled.

"localTime": [ "2019-07-28T11:45:30"

Actual time (returned from my mac):
"2019-07-28T11:47:15"

@sytchi
Copy link
Contributor

sytchi commented Mar 18, 2020

Same for me:
"localTime":["2020-03-18T02:31:40"]

@MizterB
Copy link
Owner

MizterB commented Mar 29, 2020

Fixed in release 0.7

@MizterB MizterB closed this as completed Mar 29, 2020
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

5 participants