DurgNomis-drol / ha_toyota

Toyota Connected Services integration for Home Assistant.
MIT License
143 stars 27 forks source link

After upgrade to 2.0.4, there are no devices not entities loaded #290

Closed Petucky closed 1 week ago

Petucky commented 4 weeks ago

After upgrade to 2.0.4, there are no devices not entities loaded. I've seen a vehicle with 2.0.3 before it stopped working (as documented in https://github.com/DurgNomis-drol/ha_toyota/issues/286).

ArnstadFredrik commented 4 weeks ago

Similar but not the same issue. I updated and the vehicle appears, odometer, location and lock status. But the EV battery percentage dissapeared.

hoffeck commented 4 weeks ago

After the update, the fuel content of my corolla no longer shows up

hugosanchezmartinez commented 4 weeks ago

after update, working as expected. No issues so far

nisu66 commented 4 weeks ago

Good morning First of all, thanks for the update. Finally the car is back :-) I noticed however that some sensors are missing including fuel level and battery level (I have a hybrid plug-in chr)

TheNickFury commented 4 weeks ago

Hi guys, I installed the version of this issue but the problem persists (same issue https://github.com/DurgNomis-drol/ha_toyota/issues/248). Logs: 2024-08-14 16:32:43.316 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up toyota platform for sensor Traceback (most recent call last): File "/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/toyota/sensor.py", line 209, in async_setupentry for index, in enumerate(coordinator.data): ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'NoneType' object is not iterable

But another log: 2024-08-14 16:26:18.907 ERROR (MainThread) [homeassistant.components.device_tracker] Error while setting up tractive platform for device_tracker Traceback (most recent call last): File "/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform await asyncio.shield(awaitable) File "/homeassistant/components/tractive/device_tracker.py", line 30, in async_setup_entry entities = [TractiveDeviceTracker(client, item) for item in trackables] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/homeassistant/components/tractive/device_tracker.py", line 49, in init self._battery_level: int | None = item.hw_info.get("battery_level") ^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'get'

CM000n commented 4 weeks ago

Sorry to disappoint you all again 😞

We should probably throw out all model assumptions for the Toyota API responses in the mytoyota lib and assume that no more values will be supplied at any time for a parameter.

The Toyota API is simply bullshit in its structure and is changed with such frequency that our model assumptions are constantly breaking (as there is no official documentation of the API either). In addition, the owner of the mytoyota and ha_toyota projects is unfortunately only sporadically available (I really hope he's okay ❤️) and this further delays adjustments and fixes.

As a result, I, for example, have put very little energy into the mytoyota lib and ha_toyota Home Assistant integration in the last time.

Zegafur commented 4 weeks ago

This workaround still works to get the fuel level showing again: https://github.com/DurgNomis-drol/ha_toyota/issues/273#issuecomment-2208407726

Line 242 in /homeassistant/custom_components/toyota/sensor.py can also be changed from 'PERCENTAGE' to 'None' to get the "battery level" to work.

You however have to add the percentage (%) symbol in the editor for the card to display that after the value. Perhaps there is a easy way to fix this if you know python.

elmaswebon commented 3 weeks ago

This workaround still works to get the fuel level showing again: #273 (comment)

Line 242 in /homeassistant/custom_components/toyota/sensor.py can also be changed from 'PERCENTAGE' to 'None' to get the "battery level" to work.

You however have to add the percentage (%) symbol in the editor for the card to display that after the value. Perhaps there is a easy way to fix this if you know python.

After doing this, there´s an easy way to add the "%" only editing the configuration.yaml file and restarting HA: https://github.com/DurgNomis-drol/ha_toyota/issues/273#issuecomment-2290811788

ajain-93 commented 2 weeks ago

@Petucky Can you check if this works in 2.0.5?

Petucky commented 2 weeks ago

No,

even in 2.0.5, I receive following errors in log:

2 validation errors for NotificationResponseModel payload -> 0 -> notifications -> 15 -> vin none is not an allowed value (type=type_error.none.not_allowed) payload -> 0 -> notifications -> 16 -> vin none is not an allowed value (type=type_error.none.not_allowed)

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 364, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/toyota/binary_sensor.py", line 232, in async_setupentry for index, in enumerate(coordinator.data): ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'NoneType' object is not iterable

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 364, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/toyota/device_tracker.py", line 39, in async_setup_entry for index, vehicle in enumerate(coordinator.data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'NoneType' object is not iterable

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 364, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/toyota/sensor.py", line 209, in async_setupentry for index, in enumerate(coordinator.data): ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'NoneType' object is not iterable


From: Arnav Jain @.> Sent: 27 August 2024 21:58 To: DurgNomis-drol/ha_toyota @.> Cc: Petucky @.>; Mention @.> Subject: Re: [DurgNomis-drol/ha_toyota] After upgrade to 2.0.4, there are no devices not entities loaded (Issue #290)

@Petuckyhttps://github.com/Petucky Can you check if this works in 2.0.5?

— Reply to this email directly, view it on GitHubhttps://github.com/DurgNomis-drol/ha_toyota/issues/290#issuecomment-2313396220, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AVUGGYKBLPN5G2HFNROM6N3ZTTK4ZAVCNFSM6AAAAABMQQY7YKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJTGM4TMMRSGA. You are receiving this because you were mentioned.

ajain-93 commented 2 weeks ago

Can you check in the app what notifications you have?

Petucky commented 2 weeks ago

Should I check anything specific?

The last one I have is 3 days old "The vehicle is now locked". Otherwise, the app works as expected.

ajain-93 commented 2 weeks ago

What about the older ones, say postion 15-16 or so (i.e. 4-5 from bottom)?

Petucky commented 2 weeks ago

I have 37 notifications, from beginning (a new car).

But it's true I have specific notification due to tow installation: 15: Please check the Toyota rear seat. 13 Aug 2024, 11:34 16: O A malfunction in the Sonar System has been detected. Immediately contact any retailer to have your vehicle inspected! 13 Aug 2024, 11:03 17: O A malfunction in the Electronically Controlled Brake System has been detected. Immediately contact any retailer to have your vehicle inspected! 13 Aug 2024, 11:03 18: Toyota boot/ hatch is open. 13 Aug 2024, 09:27 19: Toyota has multiple vehicle alerts, please check app for more details. 13 Aug 2024, 08:51


From: Arnav Jain @.> Sent: 27 August 2024 22:11 To: DurgNomis-drol/ha_toyota @.> Cc: Petucky @.>; Mention @.> Subject: Re: [DurgNomis-drol/ha_toyota] After upgrade to 2.0.4, there are no devices not entities loaded (Issue #290)

What about the older ones, say postion 15-16 or so (i.e. 4-5 from bottom)?

— Reply to this email directly, view it on GitHubhttps://github.com/DurgNomis-drol/ha_toyota/issues/290#issuecomment-2313418228, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AVUGGYJLVUNRPSTILKOYS7TZTTMN5AVCNFSM6AAAAABMQQY7YKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJTGQYTQMRSHA. You are receiving this because you were mentioned.

Petucky commented 1 week ago

Update: Some new notifications came in and the device/entities are loaded correctly now.