Closed Skeletorjus closed 4 years ago
Hey there @filcole, mind taking a look at this issue as its been labeled with a integration (nissan_leaf
) you are listed as a codeowner for? Thanks!
I am experiencing the same issue, with the same error outputs. I use the default config for the timers with no manual update.
Same here. I've reported this a while back, but its not fixed. The Nissan component is useless if you don't rely on restarting Home Assistant all the time.
Thanks for all the hard work @filcole, but I really hope you are able to fix this soon, thanks.
next update
-
last attempt
2020-01-15T04:06:46.002401
updated on
2020-01-15T02:51:42.111655+00:00
update in progress
true
I think that I have a fix for the issue. Basically in line 385 of init.py there should be except for KeyError. So the code will look like:
except CarwingsError:
_LOGGER.error("An error occurred getting battery status.")
return None
except KeyError:
_LOGGER.error("An error occurred parsing response from server.")
return None
async def async_get_climate(self):
I'm testing the code with such change and so far so good. It didn't get stuck even once.
@vwir Could you submit a pull request with the above fix if it's working for you. I'm encountering the update in progress getting stuck quite frequently, at least once a week recently.
I added extra logging on my setup to make sure that it works. When it turns out that it's ok then I'll push the change.
Strange, I still have the same error, even with fixed posted here: 2020-09-21 00:16:34 ERROR (SyncWorker_1) [pycarwings2.pycarwings2] carwings error; logging in and trying request again: {'status': 408} 2020-09-21 00:32:18 ERROR (SyncWorker_6) [pycarwings2.pycarwings2] carwings error; logging in and trying request again: {'status': 408} 2020-09-21 00:48:03 ERROR (SyncWorker_23) [pycarwings2.pycarwings2] carwings error; logging in and trying request again: {'status': 408}
Strange, I still have the same error, even with fixed posted here: 2020-09-21 00:16:34 ERROR (SyncWorker_1) [pycarwings2.pycarwings2] carwings error; logging in and trying request again: {'status': 408} 2020-09-21 00:32:18 ERROR (SyncWorker_6) [pycarwings2.pycarwings2] carwings error; logging in and trying request again: {'status': 408} 2020-09-21 00:48:03 ERROR (SyncWorker_23) [pycarwings2.pycarwings2] carwings error; logging in and trying request again: {'status': 408}
@pf4eva please do not comment on close issues. Please open a new one for your problem, since it does not look like the original issue. Thanks for understanding :)
Strange, I still have the same error, even with fixed posted here: 2020-09-21 00:16:34 ERROR (SyncWorker_1) [pycarwings2.pycarwings2] carwings error; logging in and trying request again: {'status': 408} 2020-09-21 00:32:18 ERROR (SyncWorker_6) [pycarwings2.pycarwings2] carwings error; logging in and trying request again: {'status': 408} 2020-09-21 00:48:03 ERROR (SyncWorker_23) [pycarwings2.pycarwings2] carwings error; logging in and trying request again: {'status': 408}
@pf4eva please do not comment on close issues. Please open a new one for your problem, since it does not look like the original issue. Thanks for understanding :)
This is the same issue reported by topic starter... Resolves only by restarting HA. What makes you think it is different?
You are correct that your error appears once in the original issue, however a long stack trace of the main error follows which you don't seem to have:
2019-12-02 07:51:42 ERROR (SyncWorker_6) [pycarwings2.pycarwings2] carwings error; logging in and trying request again: {'status': 503}
2019-12-02 07:52:55 ERROR (SyncWorker_6) [pycarwings2.pycarwings2] Invalid JSON returned
2019-12-02 07:52:55 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pycarwings2/pycarwings2.py", line 153, in _request
j = json.loads(response.text)
File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/core.py", line 1261, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
self._platforms.values(), func, call, service_name, required_features
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 348, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 370, in _handle_service_platform_call
await getattr(entity, func)(**data)
File "/usr/src/homeassistant/homeassistant/components/nissan_leaf/switch.py", line 58, in async_turn_off
if await self.car.async_set_climate(False):
File "/usr/src/homeassistant/homeassistant/components/nissan_leaf/__init__.py", line 424, in async_set_climate
result_function, request
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.7/site-packages/pycarwings2/pycarwings2.py", line 290, in get_stop_climate_control_result
"resultKey": result_key,
File "/usr/local/lib/python3.7/site-packages/pycarwings2/pycarwings2.py", line 109, in _request_with_retry
self.connect()
File "/usr/local/lib/python3.7/site-packages/pycarwings2/pycarwings2.py", line 174, in connect
"lg": "en-US",
File "/usr/local/lib/python3.7/site-packages/pycarwings2/pycarwings2.py", line 156, in _request
raise CarwingsError
pycarwings2.pycarwings2.CarwingsError
Home Assistant release with the issue:
0.102.2
Last working Home Assistant release (if known):
Operating environment (Hass.io/Docker/Windows/etc.):
Hass.io on Debian
Integration:
https://www.home-assistant.io/integrations/nissan_leaf/
Description of problem: The sensors stops updating after a while with the attribute
update_in_progress
stuck ontrue
. No new updates will happen after that until a restart of Home Assistant. ha.nissan.logProblem-relevant
configuration.yaml
entries and (fill out even if it seems unimportant):Traceback (if applicable):
Additional information: I do updates with automations via the
nissan_leaf.update
service (1hr normal, 15min while plugged), but I've also observed this through regular updates.Log: