Closed vladurash closed 8 months ago
Have you tried restarting Home Assisting or reloading the integration? It is a known issue that this error can happen, but it should fix it self it integration have been setup, though i am trying to fix it
Just got the same error after a restart. I then restart Home Assistant again and it fixed it. Hope this helps :smile:
Yes, HA was reloaded,restarted. Also restarted RPI, same error.
Can you add this to configuration.yaml
, this will enable better logging and give me some more information about this problem? Remember to restart HA after. After this please post you logs, private information should be censored, but please doublecheck :smiley:
logger:
default: critical
logs:
# log level for HA core
custom_components.toyota: debug
mytoyota: debug
I found following errors during today:
`2021-12-05 09:46:55 DEBUG (MainThread) [httpx._client] HTTP Request: POST https://ssoms.toyota-europe.com/isTokenValid "HTTP/1.1 502 Bad Gateway" 2021-12-05 09:46:55 ERROR (MainThread) [custom_components.toyota] Error when trying to check token:
`
and
2021-12-05 09:47:57 ERROR (Recorder) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 134, in _handle_refresh_interval await self._async_refresh(log_failures=True, scheduled=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 265, in _async_refresh update_callback() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 325, in _handle_coordinator_update self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 486, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 519, in _async_write_ha_state state = self._stringify_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 492, in _stringify_state if (state := self.state) is None: File "/usr/src/homeassistant/homeassistant/components/binary_sensor/__init__.py", line 186, in state return STATE_ON if self.is_on else STATE_OFF File "/config/custom_components/toyota/binary_sensor.py", line 315, in is_on self.coordinator.data[self.index].sensors.windows, TypeError: 'NoneType' object is not subscriptable
But it seems that now this integration is working again. I suppose that here was an error on Toyota platform.
Thanks! this will help in fixing the problem :smiley:
Toyota integration isn't working for me and I enabled logging and I saw there a HTTP 400 error. I made several restarts but still the same. Here is the log output, maybe it help :
2022-03-23 19:49:09 DEBUG (MainThread) [mytoyota] Performing first login 2022-03-23 19:49:09 DEBUG (MainThread) [mytoyota] Getting new token... 2022-03-23 19:49:18 DEBUG (MainThread) [mytoyota] Extracting token from result 2022-03-23 19:49:18 DEBUG (MainThread) [mytoyota] Token is the correct format 2022-03-23 19:49:18 DEBUG (MainThread) [mytoyota] Saving token and uuid 2022-03-23 19:49:18 DEBUG (MainThread) [mytoyota] Getting list of vehicles associated with the account 2022-03-23 19:49:18 DEBUG (MainThread) [mytoyota] Checking if token has expired... 2022-03-23 19:49:18 DEBUG (MainThread) [mytoyota] Constructing additional headers... 2022-03-23 19:49:18 DEBUG (MainThread) [mytoyota] Additional headers: {'X-TME-LC': 'en-gb', 'X-TME-LOCALE': 'en-gb', 'X-TME-TOKEN': 'L', 'Cookie': 'iPlanetDirectoryPro=L', 'uuid': '2'} 2022-03-23 19:49:18 DEBUG (MainThread) [mytoyota] Creating client... 2022-03-23 19:49:18 DEBUG (MainThread) [mytoyota] Base headers: {'Content-Type': 'application/json;charset=UTF-8', 'Accept': 'application/json, text/plain, /*', 'Sec-Fetch-Dest': 'empty', 'X-TME-BRAND': 'TOYOTA'} - Timeout: 15 2022-03-23 19:49:18 DEBUG (MainThread) [mytoyota] Body: None - Parameters: None 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Getting status for vehicle - JTMR63FV7****... 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Checking if token has expired... 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Constructing additional headers... 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Additional headers: {'X-TME-LC': 'en-gb', 'X-TME-LOCALE': 'en-gb', 'X-TME-TOKEN': 'L***', 'Cookie': 'iPlanetDirectoryPro=L***', 'uuid': '2*'} 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Creating client... 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Base headers: {'Content-Type': 'application/json;charset=UTF-8', 'Accept': 'application/json, text/plain, /', 'Sec-Fetch-Dest': 'empty', 'X-TME-BRAND': 'TOYOTA'} - Timeout: 15 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Body: None - Parameters: None 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Checking if token has expired... 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Constructing additional headers... 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Additional headers: {'X-TME-LC': 'en-gb', 'X-TME-LOCALE': 'en-gb', 'X-TME-TOKEN': 'L', 'Cookie': 'iPlanetDirectoryPro=L', 'uuid': '2'} 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Creating client... 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Base headers: {'Content-Type': 'application/json;charset=UTF-8', 'Accept': 'application/json, text/plain, /*', 'Sec-Fetch-Dest': 'empty', 'X-TME-BRAND': 'TOYOTA'} - Timeout: 15 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Body: None - Parameters: None 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Checking if token has expired... 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Constructing additional headers... 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Additional headers: {'X-TME-LC': 'en-gb', 'X-TME-LOCALE': 'en-gb', 'X-TME-TOKEN': 'L***', 'Cookie': 'iPlanetDirectoryPro=L***', 'uuid': '2*'} 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Creating client... 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Base headers: {'Content-Type': 'application/json;charset=UTF-8', 'Accept': 'application/json, text/plain, /', 'Sec-Fetch-Dest': 'empty', 'X-TME-BRAND': 'TOYOTA'} - Timeout: 15 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Body: None - Parameters: None 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Checking if token has expired... 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Constructing additional headers... 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Additional headers: {'X-TME-LC': 'en-gb', 'X-TME-LOCALE': 'en-gb', 'X-TME-TOKEN': 'L', 'Cookie': 'iPlanetDirectoryPro=L', 'uuid': '2***'} 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Creating client... 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Base headers: {'Content-Type': 'application/json;charset=UTF-8', 'Accept': 'application/json, text/plain, /', 'Sec-Fetch-Dest': 'empty', 'X-TME-BRAND': 'TOYOTA'} - Timeout: 15 2022-03-23 19:49:20 DEBUG (MainThread) [mytoyota] Body: None - Parameters: None 2022-03-23 19:49:21 DEBUG (MainThread) [custom_components.toyota] HTTP: 400 - {"timestamp":1648061361581,"status":400,"error":"Bad Request","message":"X-TME-APP-VERSION not provided","errorCode":"CMA400"} 2022-03-23 19:49:21 DEBUG (MainThread) [custom_components.toyota] Finished fetching toyota data in 3.414 seconds (success: True)`
@daha76 Please follow your bug over at #101
Hi, i just re-installed the integration, but still get the python error:
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/toyota/sensor.py", line 41, in async_setup_entry
for index, _ in enumerate(coordinator.data):
TypeError: 'NoneType' object is not iterable
I though it is fixed.. no?
Different things are causing it, the latest one should be fixed, but it can still happen. The Toyota API is unstable sometime without any apparent reason. Usually it will fix it self or you can add it again. Also please make sure you running the latest version.
I am in the middel of rewriting some things in the this integration, but this have been put on hold as i don't have much time right now.
We recently released version 2.0.0 of the Custom Component with major changes and support for the new Mytoyota API. As we unfortunately cannot provide support for Custom Component versions < v2.0.0, I hereby close your issue. If the issue still applies to the current version, you are of course free to open a new issue. 😊
Describe the bug
HA installed on RPI4 8GB over docker, having buster version of Debian SO. Suddenly stopped to work a week ago.