skodaconnect / homeassistant-myskoda

Homeassistant integration for MySkoda.
97 stars 15 forks source link

Prerelease 1.3.0 won't start #27

Closed sonar98 closed 2 months ago

sonar98 commented 2 months ago

Version 1.3.0 gives an error when starting.


Deze fout is ontstaan door een aangepaste integratie.

Logger: custom_components.myskoda.coordinator
Bron: helpers/update_coordinator.py:354
integratie: MySkoda (documentatie, problemen)
Eerst voorgekomen: 21:00:31 (14 gebeurtenissen)
Laatst gelogd: 21:14:53

Unexpected error fetching myskoda data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/myskoda/coordinator.py", line 65, in _async_update_data
    vehicles = await self.myskoda.get_all_vehicles()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/myskoda/myskoda.py", line 209, in get_all_vehicles
    return await gather(*(self.get_vehicle(vin) for vin in vins))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/myskoda/myskoda.py", line 199, in get_vehicle
    vehicle.charging = await self.get_charging(vin)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/myskoda/myskoda.py", line 140, in get_charging
    return await self.rest_api.get_charging(vin)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/myskoda/rest_api.py", line 61, in get_charging
    return Charging.parse_raw(response_text)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "pydantic/main.py", line 549, in pydantic.main.BaseModel.parse_raw
  File "pydantic/main.py", line 526, in pydantic.main.BaseModel.parse_obj
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for Charging
status -> state
  field required (type=value_error.missing)
dvx76 commented 2 months ago

Please enable debug and provide the line which looks like "vin {vin}: received charging info: {response_text}" which should be just before the error.

sonar98 commented 2 months ago
2024-09-22 22:37:33.969 DEBUG (MainThread) [myskoda.rest_api] vin XXXXXXXXXXXXXXXXXX: received charging info: {"isVehicleInSavedLocation":false,"status":{"chargingRateInKilometersPerHour":0.0,"chargePowerInKw":0.0,"remainingTimeToFullyChargedInMinutes":0,"battery":{"remainingCruisingRangeInMeters":208000,"stateOfChargeInPercent":48}},"settings":{"targetStateOfChargeInPercent":80,"preferredChargeMode":"MANUAL","availableChargeModes":["MANUAL"],"chargingCareMode":"ACTIVATED","autoUnlockPlugWhenCharged":"OFF","maxChargeCurrentAc":"MAXIMUM","batterySupport":"DISABLED"},"carCapturedTimestamp":"2024-09-22T15:34:14Z","errors":[{"type":"STATUS_OF_CHARGING_NOT_AVAILABLE","description":"Status of charging is not available."}]}

I tried reloading the integration when charging was started and then it worked.

sonar98 commented 2 months ago

And this version does not fix the other issue. After a while all sensors and switches are unavailable in HA. I will revert back to 1.2.4 for now.


Deze fout is ontstaan door een aangepaste integratie.

Logger: custom_components.myskoda.coordinator
Bron: helpers/update_coordinator.py:354
integratie: MySkoda (documentatie, problemen)
Eerst voorgekomen: 22 september 2024 om 23:48:25 (20 gebeurtenissen)
Laatst gelogd: 09:18:25

Unexpected error fetching myskoda data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/myskoda/coordinator.py", line 65, in _async_update_data
    vehicles = await self.myskoda.get_all_vehicles()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/myskoda/myskoda.py", line 208, in get_all_vehicles
    vins = await self.list_vehicle_vins()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/myskoda/myskoda.py", line 176, in list_vehicle_vins
    return await self.rest_api.list_vehicles()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/myskoda/rest_api.py", line 147, in list_vehicles
    headers=await self._headers(),
            ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/myskoda/rest_api.py", line 153, in _headers
    return {"authorization": f"Bearer {await self.idk_session.get_access_token(self.session)}"}
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/myskoda/authorization.py", line 96, in get_access_token
    await self.perform_refresh(session)
  File "/usr/local/lib/python3.12/site-packages/myskoda/authorization.py", line 81, in perform_refresh
    data = json.loads(await response.text())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/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)
WebSpider commented 2 months ago

I see not everything made it into the prerelease indeed. Thanks for letting us know!

dvx76 commented 2 months ago

Closing, superseded by #28