skodaconnect / homeassistant-skodaconnect

Skoda Connect - A home assistant plugin to add integration with your car
Apache License 2.0
232 stars 28 forks source link

Bad Gateway / Forbidden error #8

Closed JeffreySnijders closed 3 years ago

JeffreySnijders commented 3 years ago

Hi! I was trying to setup this integration but I can't get it to work. I keep getting Bad Gateway / Forbidden errors. When I log in to the Skoda Connect portal everything works, so my credentials are correct. This is my config:

I'm running Home Assistant version: 2020.12.0 SkodaConnect integration version: 1.0.27

skodaconnect:
  username: !secret skoda_username
  password: !secret skoda_password
  scandinavian_miles: false
  imperial_units: false
  scan_interval:
    minutes: 5

And this is the errorlog:

Could not fetch tripstatistics, error: 403, message='Forbidden', url=URL('https://msg.volkswagen.de/fs-car/bs/tripstatistics/v1/skoda/CZ/vehicles/TMBAP9NE6xxxxxx/tripdata/shortTerm?newest')

Could not fetch StoredVehicleDataResponse, error: 502, message='Bad Gateway', url=URL('https://msg.volkswagen.de/fs-car/bs/vsr/v1/skoda/CZ/vehicles/TMBAP9NE6xxxxxx/status')

Could not fetch position (ClientResponseError), error: 502, message='Bad Gateway', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMBAP9NE6xxxxxx/position')

I tried with and without the S-PIN and also resetted the S-PIN as well as the password for my account. What am I missing?

Thank you in advance!

Jeffrey

lendy007 commented 3 years ago

Hello, is Skoda App on your mobile phone fully working? Do you see trip statistics, car status (kilometres, if it is locked, windows closed, fuel level) and car position in the app on mobile phone?

JeffreySnijders commented 3 years ago

Thank you for reaching out so quickly. Yes the Skoda app is fully functioning. All statistics are displayed.

lendy007 commented 3 years ago

And what country are you in?

JeffreySnijders commented 3 years ago

The Netherlands

lendy007 commented 3 years ago

Hmm I am missing VIN number in your config posted above. Do you have it there (lowercase)? It is really strange, because there are some guys in NL using it fine...

JeffreySnijders commented 3 years ago

Is that the part of name: vwv12345678='name' ?

JeffreySnijders commented 3 years ago

I now have this:

skodaconnect:
  username: "!secret skoda_username"
  password: !secret skoda_password
  scandinavian_miles: false
  imperial_units: false
  scan_interval:
    minutes: 5
  name:
    tmbap9ne6jxxxxxxx: "Octavia"

Still same error

lendy007 commented 3 years ago

This looks correct (assuming xxxxx you replaced only here for privacy). Try to restart HA and you should be good

JeffreySnijders commented 3 years ago

I'm getting the same error. One thing I noticed is that the Skoda Connect portal (web version) doesn't display my statistics, while the app does. Maybe that's the problem?

Farfar commented 3 years ago

I think this might be related to wrong homeregion set in the integration. I see that your homeregion (base url for api requests) gets set to msg.volkswagen.de, this might be the reason why it's not working. I don't remember though if there's any debugging information available that might tell us what's wrong. I will have to take a look in the code.

Farfar commented 3 years ago

I'm getting the same error. One thing I noticed is that the Skoda Connect portal (web version) doesn't display my statistics, while the app does. Maybe that's the problem?

Could you enable debugging for the library with: logger: logs: skodaconnect.api: debug

Look for lines like theese in the log: 2021-01-01 11:05:04 DEBUG (MainThread) [skodaconnect.api] Getting homeregion for TMBXXXXXXXXX 2021-01-01 11:05:04 DEBUG (MainThread) [skodaconnect.api] Request for https://mal-1a.prd.ece.vwg-connect.com/api/cs/vds/v1/vehicles/TMBXXXXXXXXX/homeRegion 2021-01-01 11:05:06 DEBUG (MainThread) [skodaconnect.api] Received [200] response: {'homeRegion': {'baseUri': {'systemId': 'ICTO-25343', 'content': 'https://mal-3a.prd.eu.dp.vwg-connect.com/api'}}} 2

lendy007 commented 3 years ago

@Farfar I have also homeregion msg.volkswagen.de, most probably it’s related to car model... You have very “new” model and have different capabilities so maybe different servers. But let’s see what debug from @JeffreySnijders will show...

JeffreySnijders commented 3 years ago

I'm getting the same error. One thing I noticed is that the Skoda Connect portal (web version) doesn't display my statistics, while the app does. Maybe that's the problem?

Could you enable debugging for the library with: logger: logs: skodaconnect.api: debug

Look for lines like theese in the log: 2021-01-01 11:05:04 DEBUG (MainThread) [skodaconnect.api] Getting homeregion for TMBXXXXXXXXX 2021-01-01 11:05:04 DEBUG (MainThread) [skodaconnect.api] Request for https://mal-1a.prd.ece.vwg-connect.com/api/cs/vds/v1/vehicles/TMBXXXXXXXXX/homeRegion 2021-01-01 11:05:06 DEBUG (MainThread) [skodaconnect.api] Received [200] response: {'homeRegion': {'baseUri': {'systemId': 'ICTO-25343', 'content': 'https://mal-3a.prd.eu.dp.vwg-connect.com/api'}}} 2

Thank for reaching out. I'm not quite sure where I have to put this line of code (not a developer, sorry...).

Farfar commented 3 years ago

@JeffreySnijders you need to put the code in your configuration.yaml (where you put the config for the integration) and then look for the log lines in home-assistant.log in the same directory. I see though that the code got messed up here, should be newline after every ':' and proper indentation for every new sub clause

JeffreySnijders commented 3 years ago

Right! So it would become like this:

skodaconnect:
  username: "!secret skoda_username"
  password: !secret skoda_password
  scandinavian_miles: false
  imperial_units: false
  scan_interval:
    minutes: 5
  name:
    tmbap9ne6xxxxxxxx: "Octavia"
  logger:
    logs: 
      skodaconnect.api: debug

Trying that out now. Thank you.

JeffreySnijders commented 3 years ago

Hmm not quite: Invalid config for [skodaconnect]: [logger] is an invalid option for [skodaconnect]. Check: skodaconnect->skodaconnect->logger. (See /config/configuration.yaml, line 168).

JeffreySnijders commented 3 years ago

O wait. You said in my configuration.yml, period. Not in the Skoda Connect integration config. Sorry...

JeffreySnijders commented 3 years ago

Alright, so I have the lines you requested (I think):

2021-01-03 17:26:02 DEBUG (MainThread) [skodaconnect.api] Tokens OK
2021-01-03 17:26:02 DEBUG (MainThread) [skodaconnect.api] Fetching vehicles
2021-01-03 17:26:02 DEBUG (MainThread) [skodaconnect.api] Request for https://msg.volkswagen.de/fs-car/usermanagement/users/v1/skoda/CZ/vehicles
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] Response headers: <CIMultiDictProxy('X-FS-Tracking-ID': '81932e63-ceda-4428-8044-371e7112843f', 'Content-Encoding': 'gzip', 'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '66', 'Date': 'Sun, 03 Jan 2021 16:26:03 GMT', 'Server': 'www')>
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] Received [200] response: {'userVehicles': {'vehicle': ['TMBAP9NXXXXXXXXX']}}
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] URL loaded
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] Vehicle JSON string exists
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] Vehicle_URL TMBAP9NXXXXXXXXX
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] Going to call vehicle updates
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] Updating vehicle status TMBAP9NXXXXXXXXX
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] Getting homeregion for TMBAP9NXXXXXXXXX
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] Request for https://mal-1a.prd.ece.vwg-connect.com/api/cs/vds/v1/vehicles/TMBAP9NXXXXXXXXX/homeRegion
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] Response headers: <CIMultiDictProxy('X-FS-Tracking-ID': '5ab1beae-efb9-4c76-a049-4ae37a071ff6', 'Content-Encoding': 'gzip', 'Content-Type': 'application/json;charset=utf-8', 'Content-Length': '120', 'Date': 'Sun, 03 Jan 2021 16:26:03 GMT', 'Server': 'www')>
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] Received [200] response: {'homeRegion': {'baseUri': {'systemId': 'ICTO-10487', 'content': 'https://mal-1a.prd.ece.vwg-connect.com/api'}}}
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] Request for https://msg.volkswagen.de/fs-car/promoter/portfolio/v1/skoda/CZ/vehicle/TMBAP9NXXXXXXXXX/carportdata
2021-01-03 17:26:04 DEBUG (MainThread) [skodaconnect.api] Response headers: <CIMultiDictProxy('X-FS-Tracking-ID': '0f273df3-2134-484f-9f66-cffb1f01b995', 'Content-Encoding': 'gzip', 'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '249', 'Date': 'Sun, 03 Jan 2021 16:26:04 GMT', 'Server': 'www')>
2021-01-03 17:26:04 DEBUG (MainThread) [skodaconnect.api] Received [200] response: {'carportData': {'systemId': 'msg', 'requestId': 'MSG-ivwb2196-1609691163607-02733-SCZ', 'brand': 'skoda', 'country': 'CZ', 'vin': 'TMBAP9NXXXXXXXXX', 'modelCode': '5E33BD', 'modelName': 'OCTAVIA AMB TS85/1.0 A7F', 'modelYear': 2018, 'color': 'LF7Y', 'countryCode': 'NL', 'engine': 'CHZ', 'mmi': '7UF', 'transmission': 'SML'}}
2021-01-03 17:26:04 DEBUG (MainThread) [skodaconnect.api] Request for https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/position
2021-01-03 17:26:04 WARNING (MainThread) [skodaconnect.api] Could not fetch position (ClientResponseError), error: 502, message='Bad Gateway', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/position')
2021-01-03 17:26:04 DEBUG (MainThread) [skodaconnect.api] Request for https://msg.volkswagen.de/fs-car/bs/vsr/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/status
2021-01-03 17:26:04 WARNING (MainThread) [skodaconnect.api] Could not fetch StoredVehicleDataResponse, error: 502, message='Bad Gateway', url=URL('https://msg.volkswagen.de/fs-car/bs/vsr/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/status')
2021-01-03 17:26:04 DEBUG (MainThread) [skodaconnect.api] Request for https://msg.volkswagen.de/fs-car/bs/tripstatistics/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/tripdata/shortTerm?newest
2021-01-03 17:26:04 WARNING (MainThread) [skodaconnect.api] Could not fetch tripstatistics, error: 403, message='Forbidden', url=URL('https://msg.volkswagen.de/fs-car/bs/tripstatistics/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/tripdata/shortTerm?newest')
2021-01-03 17:26:04 DEBUG (MainThread) [skodaconnect.api] Request for https://msg.volkswagen.de/fs-car/bs/climatisation/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/climater
2021-01-03 17:26:04 DEBUG (MainThread) [skodaconnect.api] Could not fetch climatisation, error 403 (not supported on car?), error: 403, message='Forbidden', url=URL('https://msg.volkswagen.de/fs-car/bs/climatisation/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/climater')
2021-01-03 17:26:04 DEBUG (MainThread) [skodaconnect.api] Request for https://msg.volkswagen.de/fs-car/bs/batterycharge/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/charger
2021-01-03 17:26:05 DEBUG (MainThread) [skodaconnect.api] Could not fetch charger, error 403 (not supported on car?), error: 403, message='Forbidden', url=URL('https://msg.volkswagen.de/fs-car/bs/batterycharge/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/charger')
2021-01-03 17:26:05 DEBUG (MainThread) [skodaconnect.api] Request for https://msg.volkswagen.de/fs-car/bs/rs/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/status
2021-01-03 17:26:05 DEBUG (MainThread) [skodaconnect.api] Could not fetch pre-heating, error 403/502 (not supported on car?), error: 502, message='Bad Gateway', url=URL('https://msg.volkswagen.de/fs-car/bs/rs/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/status')
Kaibob2 commented 3 years ago

Many thanks for this integration. I was was waiting for something like this. Goos job until here, but same problem here:

2021-01-04 16:02:03 WARNING (MainThread) [skodaconnect.api] Could not fetch carportData, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/promoter/portfolio/v1/skoda/CZ/vehicle/TMBJJ7*********/carportdata')
2021-01-04 16:02:03 WARNING (MainThread) [skodaconnect.api] Could not fetch position (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMBJJ7*********/position')
2021-01-04 16:02:04 WARNING (MainThread) [skodaconnect.api] Could not fetch StoredVehicleDataResponse, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/vsr/v1/skoda/CZ/vehicles/TMBJJ7*********/status')
2021-01-04 16:02:04 WARNING (MainThread) [skodaconnect.api] Could not fetch tripstatistics, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/tripstatistics/v1/skoda/CZ/vehicles/TMBJJ7*********/tripdata/shortTerm?newest')
2021-01-04 16:02:04 WARNING (MainThread) [skodaconnect.api] Could not fetch climatisation (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/climatisation/v1/skoda/CZ/vehicles/TMBJJ7*********/climater')
2021-01-04 16:02:04 WARNING (MainThread) [skodaconnect.api] Could not fetch charger (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/batterycharge/v1/skoda/CZ/vehicles/TMBJJ7*********/charger')
2021-01-04 16:02:04 WARNING (MainThread) [skodaconnect.api] Could not fetch pre-heating (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/rs/v1/skoda/CZ/vehicles/TMBJJ7*********/status')
2021-01-04 16:02:04 WARNING (MainThread) [skodaconnect.api] Could not fetch carportData, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/promoter/portfolio/v1/skoda/CZ/vehicle/TMBJJ7*********/carportdata')
2021-01-04 16:02:04 WARNING (MainThread) [skodaconnect.api] Could not fetch position (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMBJJ7*********/position')
2021-01-04 16:02:04 WARNING (MainThread) [skodaconnect.api] Could not fetch StoredVehicleDataResponse, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/vsr/v1/skoda/CZ/vehicles/TMBJJ7*********/status')
2021-01-04 16:02:04 WARNING (MainThread) [skodaconnect.api] Could not fetch tripstatistics, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/tripstatistics/v1/skoda/CZ/vehicles/TMBJJ7*********/tripdata/shortTerm?newest')
2021-01-04 16:02:04 WARNING (MainThread) [skodaconnect.api] Could not fetch climatisation (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/climatisation/v1/skoda/CZ/vehicles/TMBJJ7*********/climater')
2021-01-04 16:02:04 WARNING (MainThread) [skodaconnect.api] Could not fetch charger (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/batterycharge/v1/skoda/CZ/vehicles/TMBJJ7*********/charger')
2021-01-04 16:02:04 WARNING (MainThread) [skodaconnect.api] Could not fetch pre-heating (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/rs/v1/skoda/CZ/vehicles/TMBJJ7*********/status')
2021-01-04 16:02:05 WARNING (MainThread) [skodaconnect.api] Could not fetch carportData, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/promoter/portfolio/v1/skoda/CZ/vehicle/TMBJJ7*********/carportdata')
2021-01-04 16:02:05 WARNING (MainThread) [skodaconnect.api] Could not fetch position (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMBJJ7*********/position')
2021-01-04 16:02:05 WARNING (MainThread) [skodaconnect.api] Could not fetch StoredVehicleDataResponse, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/vsr/v1/skoda/CZ/vehicles/TMBJJ7*********/status')
2021-01-04 16:02:05 WARNING (MainThread) [skodaconnect.api] Could not fetch tripstatistics, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/tripstatistics/v1/skoda/CZ/vehicles/TMBJJ7*********/tripdata/shortTerm?newest')
2021-01-04 16:02:05 WARNING (MainThread) [skodaconnect.api] Could not fetch climatisation (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/climatisation/v1/skoda/CZ/vehicles/TMBJJ7*********/climater')
2021-01-04 16:02:05 WARNING (MainThread) [skodaconnect.api] Could not fetch charger (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/batterycharge/v1/skoda/CZ/vehicles/TMBJJ7*********/charger')

And many more.

This is my configuration entry:

skodaconnect:
  username: *****@***.com
  password: **********
  scandinavian_miles: false
  imperial_units: false
  scan_interval:
      minutes: 10
  name:
      tmbjj7**********: 'Octavia'
  resources:
      - distance
      - position
      - service_inspection
      - oil_inspection
      - door_locked
      - trunk_locked
      - fuel_level
      - windows_closed
      - last_connected
      - combustion_range
      - trip_last_average_speed
      - trip_last_average_fuel_consumption
      - trip_last_duration
      - trip_last_length
      - parking_light
      - door_closed_left_front
      - door_closed_left_back
      - door_closed_right_front
      - door_closed_right_back
      - trunk_closed
      - window_closed_left_front
      - window_closed_left_back
      - window_closed_right_front
      - window_closed_right_back
      - service_inspection_km
      - oil_inspection_km
      - outside_temperature
      - window_heater
      - battery_level
      - requests_remaining

The App shows everything correct and the state in HA gets updated too according to the actual state of the car.

JeffreySnijders commented 3 years ago

@Kaibob2 That's odd. I'm not seeing any sign of the skoda integration in my HA entities. So you're saying that the integration works, despite the error messages?

Kaibob2 commented 3 years ago

All specified entites are there and populated with correct values.

SharedScreenshot

Doors unlocked, Trunk unlocked, left front door open: Screenshot_20210104-170438_Samsung Internet

The two screenshots don't correspond with one another as they are taken at different car states. Edit: And, no, i'm not satisfied with the car image. I will build a better one when the integration works perfect. ;)

Farfar commented 3 years ago

Alright, so I have the lines you requested (I think):

2021-01-03 17:26:02 DEBUG (MainThread) [skodaconnect.api] Tokens OK
2021-01-03 17:26:02 DEBUG (MainThread) [skodaconnect.api] Fetching vehicles
2021-01-03 17:26:02 DEBUG (MainThread) [skodaconnect.api] Request for https://msg.volkswagen.de/fs-car/usermanagement/users/v1/skoda/CZ/vehicles
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] Response headers: <CIMultiDictProxy('X-FS-Tracking-ID': '81932e63-ceda-4428-8044-371e7112843f', 'Content-Encoding': 'gzip', 'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '66', 'Date': 'Sun, 03 Jan 2021 16:26:03 GMT', 'Server': 'www')>
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] Received [200] response: {'userVehicles': {'vehicle': ['TMBAP9NXXXXXXXXX']}}
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] URL loaded
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] Vehicle JSON string exists
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] Vehicle_URL TMBAP9NXXXXXXXXX
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] Going to call vehicle updates
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] Updating vehicle status TMBAP9NXXXXXXXXX
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] Getting homeregion for TMBAP9NXXXXXXXXX
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] Request for https://mal-1a.prd.ece.vwg-connect.com/api/cs/vds/v1/vehicles/TMBAP9NXXXXXXXXX/homeRegion
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] Response headers: <CIMultiDictProxy('X-FS-Tracking-ID': '5ab1beae-efb9-4c76-a049-4ae37a071ff6', 'Content-Encoding': 'gzip', 'Content-Type': 'application/json;charset=utf-8', 'Content-Length': '120', 'Date': 'Sun, 03 Jan 2021 16:26:03 GMT', 'Server': 'www')>
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] Received [200] response: {'homeRegion': {'baseUri': {'systemId': 'ICTO-10487', 'content': 'https://mal-1a.prd.ece.vwg-connect.com/api'}}}
2021-01-03 17:26:03 DEBUG (MainThread) [skodaconnect.api] Request for https://msg.volkswagen.de/fs-car/promoter/portfolio/v1/skoda/CZ/vehicle/TMBAP9NXXXXXXXXX/carportdata
2021-01-03 17:26:04 DEBUG (MainThread) [skodaconnect.api] Response headers: <CIMultiDictProxy('X-FS-Tracking-ID': '0f273df3-2134-484f-9f66-cffb1f01b995', 'Content-Encoding': 'gzip', 'Content-Type': 'application/json;charset=UTF-8', 'Content-Length': '249', 'Date': 'Sun, 03 Jan 2021 16:26:04 GMT', 'Server': 'www')>
2021-01-03 17:26:04 DEBUG (MainThread) [skodaconnect.api] Received [200] response: {'carportData': {'systemId': 'msg', 'requestId': 'MSG-ivwb2196-1609691163607-02733-SCZ', 'brand': 'skoda', 'country': 'CZ', 'vin': 'TMBAP9NXXXXXXXXX', 'modelCode': '5E33BD', 'modelName': 'OCTAVIA AMB TS85/1.0 A7F', 'modelYear': 2018, 'color': 'LF7Y', 'countryCode': 'NL', 'engine': 'CHZ', 'mmi': '7UF', 'transmission': 'SML'}}
2021-01-03 17:26:04 DEBUG (MainThread) [skodaconnect.api] Request for https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/position
2021-01-03 17:26:04 WARNING (MainThread) [skodaconnect.api] Could not fetch position (ClientResponseError), error: 502, message='Bad Gateway', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/position')
2021-01-03 17:26:04 DEBUG (MainThread) [skodaconnect.api] Request for https://msg.volkswagen.de/fs-car/bs/vsr/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/status
2021-01-03 17:26:04 WARNING (MainThread) [skodaconnect.api] Could not fetch StoredVehicleDataResponse, error: 502, message='Bad Gateway', url=URL('https://msg.volkswagen.de/fs-car/bs/vsr/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/status')
2021-01-03 17:26:04 DEBUG (MainThread) [skodaconnect.api] Request for https://msg.volkswagen.de/fs-car/bs/tripstatistics/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/tripdata/shortTerm?newest
2021-01-03 17:26:04 WARNING (MainThread) [skodaconnect.api] Could not fetch tripstatistics, error: 403, message='Forbidden', url=URL('https://msg.volkswagen.de/fs-car/bs/tripstatistics/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/tripdata/shortTerm?newest')
2021-01-03 17:26:04 DEBUG (MainThread) [skodaconnect.api] Request for https://msg.volkswagen.de/fs-car/bs/climatisation/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/climater
2021-01-03 17:26:04 DEBUG (MainThread) [skodaconnect.api] Could not fetch climatisation, error 403 (not supported on car?), error: 403, message='Forbidden', url=URL('https://msg.volkswagen.de/fs-car/bs/climatisation/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/climater')
2021-01-03 17:26:04 DEBUG (MainThread) [skodaconnect.api] Request for https://msg.volkswagen.de/fs-car/bs/batterycharge/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/charger
2021-01-03 17:26:05 DEBUG (MainThread) [skodaconnect.api] Could not fetch charger, error 403 (not supported on car?), error: 403, message='Forbidden', url=URL('https://msg.volkswagen.de/fs-car/bs/batterycharge/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/charger')
2021-01-03 17:26:05 DEBUG (MainThread) [skodaconnect.api] Request for https://msg.volkswagen.de/fs-car/bs/rs/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/status
2021-01-03 17:26:05 DEBUG (MainThread) [skodaconnect.api] Could not fetch pre-heating, error 403/502 (not supported on car?), error: 502, message='Bad Gateway', url=URL('https://msg.volkswagen.de/fs-car/bs/rs/v1/skoda/CZ/vehicles/TMBAP9NXXXXXXXXX/status')

Edit: I read this wrong, it's @kaibob2 who's got strange behaviour and perhaps too fast polling: Something is strange, the integration shouldn't request data every second and won't retry if one endpoint fails. In your case it looks as if it tries to poll every second, strange indeed. @jeffreysnijders Could you try uninstalling everything, restart home assistant, reinstall and then restart again?

Kaibob2 commented 3 years ago

@Farfar In fact i didn't touch anything beside the necessary config. With scan_interval: minutes: 10 i thought this would be a good polling interval, but i suppose this is not the polling interval you mean. I left the resources part out at first installation and only added it after seeing the errors in the log. I hoped to eliminate the errors by leaving the respective entrys out. For example everything with charger and climatisation it not in resources but appears in the errors.

Farfar commented 3 years ago

@Farfar In fact i didn't touch anything beside the necessary config. With scan_interval: minutes: 10 i thought this would be a good polling interval, but i suppose this is not the polling interval you mean. I left the resources part out at first installation and only added it after seeing the errors in the log. I hoped to eliminate the errors by leaving the respective entrys out. For example everything with charger and climatisation it not in resources but appears in the errors.

Most probably there's some mismatch in refresh interval and when the integration will refresh tokens. It will refresh tokens if they expire within 1 minute of the update, but tokens should be validated and refreshed if expired on every update. I use 1 minute update interval in the configuration and it's working fine. States will update a little faster then.

I will try 10 minute interval and see if I can reproduce.

JeffreySnijders commented 3 years ago

@Farfar I have tried uninstalling and reinstalling the integration, but without success. Same errors keep showing up.

Farfar commented 3 years ago

@Farfar I have tried uninstalling and reinstalling the integration, but without success. Same errors keep showing up.

Ok. What model year is your car? Do you have multiple users, it isn't the guest user you are trying to login with?

I will try to find the time to release next version soon with quite a lot of fixes and will also try to implement a check on startup for which services/endpoints are available. That might help pinpoint this issue.

JeffreySnijders commented 3 years ago

Model year is 2018. I'm the only user, no guest user. Tomorrow I'll be getting te new Octavia 2021 model, so I'm not able to continue testing this (unless I get the same errors with the new model). Though I found it useful for other people that might have the same errors to create this issue. I will of course test it with the new car and report back if that works fine or not.

Farfar commented 3 years ago

Model year is 2018. I'm the only user, no guest user. Tomorrow I'll be getting te new Octavia 2021 model, so I'm not able to continue testing this (unless I get the same errors with the new model). Though I found it useful for other people that might have the same errors to create this issue. I will of course test it with the new car and report back if that works fine or not.

Have you had a chance to test the integration with your new car? I am having a hard time trying to reproduce this and if you have no trouble with the new car I will close this issue. There's a new release in the works and it will make it easier to debug what API endpoints are available for the car so we can easier debug issues like this.

JeffreySnijders commented 3 years ago

I have tested it just now and can confirm it works with my new car. Thank you very much for your help.

Kaibob2 commented 3 years ago

In my case nothing has changed until now. These are the log entries:

2021-01-11 07:30:56 ERROR (MainThread) [homeassistant.util.logging] Exception in see_vehicle when dispatching 'skodaconnect.updated': ()
Traceback (most recent call last):
  File "/config/custom_components/skodaconnect/device_tracker.py", line 35, in see_vehicle
    gps=instrument.state,
  File "/usr/local/lib/python3.8/site-packages/skodaconnect/dashboard.py", line 291, in state
    state = super().state or {}
  File "/usr/local/lib/python3.8/site-packages/skodaconnect/dashboard.py", line 58, in state
    return self.vehicle.get_attr(self.attr)
  File "/usr/local/lib/python3.8/site-packages/skodaconnect/vehicle.py", line 166, in get_attr
    return find_path(self.attrs, attr)
  File "/usr/local/lib/python3.8/site-packages/skodaconnect/utilities.py", line 86, in find_path
    return find_path(src[path[0]], path[1:])
KeyError: 'position'

2021-01-11 04:53:40 WARNING (MainThread) [skodaconnect.api] Could not fetch pre-heating (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/rs/v1/skoda/CZ/vehicles/TMB*******************8/status')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch carportData, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/promoter/portfolio/v1/skoda/CZ/vehicle/TMB*******************8/carportdata')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch position (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMB*******************8/position')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch StoredVehicleDataResponse, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/vsr/v1/skoda/CZ/vehicles/TMB*******************8/status')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch tripstatistics, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/tripstatistics/v1/skoda/CZ/vehicles/TMB*******************8/tripdata/shortTerm?newest')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch climatisation (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/climatisation/v1/skoda/CZ/vehicles/TMB*******************8/climater')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch charger (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/batterycharge/v1/skoda/CZ/vehicles/TMB*******************8/charger')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch pre-heating (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/rs/v1/skoda/CZ/vehicles/TMB*******************8/status')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch carportData, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/promoter/portfolio/v1/skoda/CZ/vehicle/TMB*******************8/carportdata')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch position (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMB*******************8/position')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch StoredVehicleDataResponse, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/vsr/v1/skoda/CZ/vehicles/TMB*******************8/status')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch tripstatistics, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/tripstatistics/v1/skoda/CZ/vehicles/TMB*******************8/tripdata/shortTerm?newest')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch climatisation (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/climatisation/v1/skoda/CZ/vehicles/TMB*******************8/climater')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch charger (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/batterycharge/v1/skoda/CZ/vehicles/TMB*******************8/charger')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch pre-heating (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/rs/v1/skoda/CZ/vehicles/TMB*******************8/status')
2021-01-11 04:53:42 WARNING (MainThread) [skodaconnect.api] Could not fetch carportData, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/promoter/portfolio/v1/skoda/CZ/vehicle/TMB*******************8/carportdata')
2021-01-11 04:53:42 WARNING (MainThread) [skodaconnect.api] Could not fetch position (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMB*******************8/position')
2021-01-11 04:53:42 WARNING (MainThread) [skodaconnect.api] Could not fetch StoredVehicleDataResponse, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/vsr/v1/skoda/CZ/vehicles/TMB*******************8/status')
2021-01-11 04:53:42 WARNING (MainThread) [skodaconnect.api] Could not fetch tripstatistics, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/tripstatistics/v1/skoda/CZ/vehicles/TMB*******************8/tripdata/shortTerm?newest')
2021-01-11 04:53:42 WARNING (MainThread) [skodaconnect.api] Could not fetch climatisation (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/climatisation/v1/skoda/CZ/vehicles/TMB*******************8/climater')
2021-01-11 04:53:42 WARNING (MainThread) [skodaconnect.api] Could not fetch charger (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/batterycharge/v1/skoda/CZ/vehicles/TMB*******************8/charger')
2021-01-11 04:53:42 WARNING (MainThread) [skodaconnect.api] Could not fetch pre-heating (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/rs/v1/skoda/CZ/vehicles/TMB*******************8/status')
2021-01-11 05:07:33 WARNING (MainThread) [skodaconnect.api] Could not fetch position (ClientResponseError), error: 500, message='Internal Server Error', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMB*******************8/position')
2021-01-11 05:36:29 WARNING (MainThread) [skodaconnect.api] Could not fetch position (ClientResponseError), error: 500, message='Internal Server Error', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMB*******************8/position')
Farfar commented 3 years ago

In my case nothing has changed until now. These are the log entries:

2021-01-11 07:30:56 ERROR (MainThread) [homeassistant.util.logging] Exception in see_vehicle when dispatching 'skodaconnect.updated': ()
Traceback (most recent call last):
  File "/config/custom_components/skodaconnect/device_tracker.py", line 35, in see_vehicle
    gps=instrument.state,
  File "/usr/local/lib/python3.8/site-packages/skodaconnect/dashboard.py", line 291, in state
    state = super().state or {}
  File "/usr/local/lib/python3.8/site-packages/skodaconnect/dashboard.py", line 58, in state
    return self.vehicle.get_attr(self.attr)
  File "/usr/local/lib/python3.8/site-packages/skodaconnect/vehicle.py", line 166, in get_attr
    return find_path(self.attrs, attr)
  File "/usr/local/lib/python3.8/site-packages/skodaconnect/utilities.py", line 86, in find_path
    return find_path(src[path[0]], path[1:])
KeyError: 'position'

2021-01-11 04:53:40 WARNING (MainThread) [skodaconnect.api] Could not fetch pre-heating (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/rs/v1/skoda/CZ/vehicles/TMB*******************8/status')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch carportData, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/promoter/portfolio/v1/skoda/CZ/vehicle/TMB*******************8/carportdata')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch position (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMB*******************8/position')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch StoredVehicleDataResponse, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/vsr/v1/skoda/CZ/vehicles/TMB*******************8/status')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch tripstatistics, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/tripstatistics/v1/skoda/CZ/vehicles/TMB*******************8/tripdata/shortTerm?newest')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch climatisation (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/climatisation/v1/skoda/CZ/vehicles/TMB*******************8/climater')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch charger (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/batterycharge/v1/skoda/CZ/vehicles/TMB*******************8/charger')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch pre-heating (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/rs/v1/skoda/CZ/vehicles/TMB*******************8/status')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch carportData, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/promoter/portfolio/v1/skoda/CZ/vehicle/TMB*******************8/carportdata')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch position (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMB*******************8/position')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch StoredVehicleDataResponse, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/vsr/v1/skoda/CZ/vehicles/TMB*******************8/status')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch tripstatistics, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/tripstatistics/v1/skoda/CZ/vehicles/TMB*******************8/tripdata/shortTerm?newest')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch climatisation (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/climatisation/v1/skoda/CZ/vehicles/TMB*******************8/climater')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch charger (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/batterycharge/v1/skoda/CZ/vehicles/TMB*******************8/charger')
2021-01-11 04:53:41 WARNING (MainThread) [skodaconnect.api] Could not fetch pre-heating (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/rs/v1/skoda/CZ/vehicles/TMB*******************8/status')
2021-01-11 04:53:42 WARNING (MainThread) [skodaconnect.api] Could not fetch carportData, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/promoter/portfolio/v1/skoda/CZ/vehicle/TMB*******************8/carportdata')
2021-01-11 04:53:42 WARNING (MainThread) [skodaconnect.api] Could not fetch position (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMB*******************8/position')
2021-01-11 04:53:42 WARNING (MainThread) [skodaconnect.api] Could not fetch StoredVehicleDataResponse, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/vsr/v1/skoda/CZ/vehicles/TMB*******************8/status')
2021-01-11 04:53:42 WARNING (MainThread) [skodaconnect.api] Could not fetch tripstatistics, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/tripstatistics/v1/skoda/CZ/vehicles/TMB*******************8/tripdata/shortTerm?newest')
2021-01-11 04:53:42 WARNING (MainThread) [skodaconnect.api] Could not fetch climatisation (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/climatisation/v1/skoda/CZ/vehicles/TMB*******************8/climater')
2021-01-11 04:53:42 WARNING (MainThread) [skodaconnect.api] Could not fetch charger (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/batterycharge/v1/skoda/CZ/vehicles/TMB*******************8/charger')
2021-01-11 04:53:42 WARNING (MainThread) [skodaconnect.api] Could not fetch pre-heating (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/rs/v1/skoda/CZ/vehicles/TMB*******************8/status')
2021-01-11 05:07:33 WARNING (MainThread) [skodaconnect.api] Could not fetch position (ClientResponseError), error: 500, message='Internal Server Error', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMB*******************8/position')
2021-01-11 05:36:29 WARNING (MainThread) [skodaconnect.api] Could not fetch position (ClientResponseError), error: 500, message='Internal Server Error', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMB*******************8/position')

Can you try with minutes: 1 for update interval and see if the problem persists?

Kaibob2 commented 3 years ago

OK

Kaibob2 commented 3 years ago

Nope. Changing to minutes: 1 doesn't change anything.

Farfar commented 3 years ago

Nope. Changing to minutes: 1 doesn't change anything.

OK. I suspect there's some issue when tokens expire but I haven't been able to reproduce it myself. The upcoming release will hopefully take care of this issue for you. I will release it ASAP.

Kaibob2 commented 3 years ago

That would be great

Kaibob2 commented 3 years ago

Any progress here?

zoogian commented 3 years ago

Works for me, but hade not tester so much

Kaibob2 commented 3 years ago

I still see this in the logs:

Could not fetch StoredVehicleDataResponse, error: 504, message='Gateway Timeout', url=URL('https://msg.volkswagen.de/fs-car/bs/vsr/v1/skoda/CZ/vehicles/TMB*******/status')
19:07:57 – /usr/local/lib/python3.8/site-packages/skodaconnect/api.py (WARNING) - Die Nachricht ist zum ersten Mal um 16:25:12 aufgetreten und erscheint 79 mal
Could not fetch position (ClientResponseError), error: 504, message='Gateway Timeout', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMB*******/position')
19:07:47 – /usr/local/lib/python3.8/site-packages/skodaconnect/api.py (WARNING) - Die Nachricht ist zum ersten Mal um 16:25:27 aufgetreten und erscheint 71 mal
Could not fetch pre-heating (ClientResponseError), error: 504, message='Gateway Timeout', url=URL('https://msg.volkswagen.de/fs-car/bs/rs/v1/skoda/CZ/vehicles/TMB*******/status')
17:46:26 – /usr/local/lib/python3.8/site-packages/skodaconnect/api.py (WARNING) - Die Nachricht ist zum ersten Mal um 16:25:28 aufgetreten und erscheint 69 mal
Could not fetch charger (ClientResponseError), error: 504, message='Gateway Timeout', url=URL('https://msg.volkswagen.de/fs-car/bs/batterycharge/v1/skoda/CZ/vehicles/TMB*******/charger')
17:46:26 – /usr/local/lib/python3.8/site-packages/skodaconnect/api.py (WARNING) - Die Nachricht ist zum ersten Mal um 16:25:26 aufgetreten und erscheint 70 mal
Could not fetch climatisation (ClientResponseError), error: 504, message='Gateway Timeout', url=URL('https://msg.volkswagen.de/fs-car/bs/climatisation/v1/skoda/CZ/vehicles/TMB*******/climater')
17:46:26 – /usr/local/lib/python3.8/site-packages/skodaconnect/api.py (WARNING) - Die Nachricht ist zum ersten Mal um 16:25:28 aufgetreten und erscheint 72 mal
Could not fetch tripstatistics, error: 502, message='Bad Gateway', url=URL('https://msg.volkswagen.de/fs-car/bs/tripstatistics/v1/skoda/CZ/vehicles/TMB*******/tripdata/shortTerm?newest')
17:46:26 – /usr/local/lib/python3.8/site-packages/skodaconnect/api.py (WARNING) - Die Nachricht ist zum ersten Mal um 16:25:24 aufgetreten und erscheint 71 mal
Could not fetch carportData, error: 500, message='Internal Server Error', url=URL('https://msg.volkswagen.de/fs-car/promoter/portfolio/v1/skoda/CZ/vehicle/TMB*******/carportdata')
17:46:25 – /usr/local/lib/python3.8/site-packages/skodaconnect/api.py (WARNING) - Die Nachricht ist zum ersten Mal um 16:25:24 aufgetreten und erscheint 69 mal

Clicking on a log entry ends in:

Logger: skodaconnect.api
Source: /usr/local/lib/python3.8/site-packages/skodaconnect/api.py:423
First occurred: 16:25:12 (79 occurrences)
Last logged: 19:07:57

    Could not fetch StoredVehicleDataResponse, error: 504, message='Gateway Timeout', url=URL('https://msg.volkswagen.de/fs-car/bs/vsr/v1/skoda/CZ/vehicles/TMB*******/status')
    Could not fetch StoredVehicleDataResponse, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/vsr/v1/skoda/CZ/vehicles/TMB*******/status')
    Could not fetch StoredVehicleDataResponse, error: 500, message='Internal Server Error', url=URL('https://msg.volkswagen.de/fs-car/bs/vsr/v1/skoda/CZ/vehicles/TMB*******/status')

or

Logger: skodaconnect.api
Source: /usr/local/lib/python3.8/site-packages/skodaconnect/api.py:405
First occurred: 16:25:27 (71 occurrences)
Last logged: 19:07:47

    Could not fetch position (ClientResponseError), error: 504, message='Gateway Timeout', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMB*******/position')
    Could not fetch position (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMB*******/position')
    Could not fetch position (ClientResponseError), error: 500, message='Internal Server Error', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMB*******/position')

I only have these resources in my configuration.yaml:

  resources:
      - distance
      - position
      - service_inspection
      - oil_inspection
      - door_locked
      - trunk_locked
      - fuel_level
      - windows_closed
      - combustion_range
      - parking_light
      - door_closed_left_front
      - door_closed_left_back
      - door_closed_right_front
      - door_closed_right_back
      - trunk_closed
      - window_closed_left_front
      - window_closed_left_back
      - window_closed_right_front
      - window_closed_right_back
      - outside_temperature
      - battery_level

Entries like charger or climatisation shouldn't come up in the error log, or am i missing something.

Even with the reduced resources i get the following entities created and they are most likely working as far as i can tell: Screenshot_20210126-200133_Samsung Internet

Farfar commented 3 years ago

I still see this in the logs:

Could not fetch StoredVehicleDataResponse, error: 504, message='Gateway Timeout', url=URL('https://msg.volkswagen.de/fs-car/bs/vsr/v1/skoda/CZ/vehicles/TMB*******/status')
19:07:57 – /usr/local/lib/python3.8/site-packages/skodaconnect/api.py (WARNING) - Die Nachricht ist zum ersten Mal um 16:25:12 aufgetreten und erscheint 79 mal
Could not fetch position (ClientResponseError), error: 504, message='Gateway Timeout', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMB*******/position')
19:07:47 – /usr/local/lib/python3.8/site-packages/skodaconnect/api.py (WARNING) - Die Nachricht ist zum ersten Mal um 16:25:27 aufgetreten und erscheint 71 mal
Could not fetch pre-heating (ClientResponseError), error: 504, message='Gateway Timeout', url=URL('https://msg.volkswagen.de/fs-car/bs/rs/v1/skoda/CZ/vehicles/TMB*******/status')
17:46:26 – /usr/local/lib/python3.8/site-packages/skodaconnect/api.py (WARNING) - Die Nachricht ist zum ersten Mal um 16:25:28 aufgetreten und erscheint 69 mal
Could not fetch charger (ClientResponseError), error: 504, message='Gateway Timeout', url=URL('https://msg.volkswagen.de/fs-car/bs/batterycharge/v1/skoda/CZ/vehicles/TMB*******/charger')
17:46:26 – /usr/local/lib/python3.8/site-packages/skodaconnect/api.py (WARNING) - Die Nachricht ist zum ersten Mal um 16:25:26 aufgetreten und erscheint 70 mal
Could not fetch climatisation (ClientResponseError), error: 504, message='Gateway Timeout', url=URL('https://msg.volkswagen.de/fs-car/bs/climatisation/v1/skoda/CZ/vehicles/TMB*******/climater')
17:46:26 – /usr/local/lib/python3.8/site-packages/skodaconnect/api.py (WARNING) - Die Nachricht ist zum ersten Mal um 16:25:28 aufgetreten und erscheint 72 mal
Could not fetch tripstatistics, error: 502, message='Bad Gateway', url=URL('https://msg.volkswagen.de/fs-car/bs/tripstatistics/v1/skoda/CZ/vehicles/TMB*******/tripdata/shortTerm?newest')
17:46:26 – /usr/local/lib/python3.8/site-packages/skodaconnect/api.py (WARNING) - Die Nachricht ist zum ersten Mal um 16:25:24 aufgetreten und erscheint 71 mal
Could not fetch carportData, error: 500, message='Internal Server Error', url=URL('https://msg.volkswagen.de/fs-car/promoter/portfolio/v1/skoda/CZ/vehicle/TMB*******/carportdata')
17:46:25 – /usr/local/lib/python3.8/site-packages/skodaconnect/api.py (WARNING) - Die Nachricht ist zum ersten Mal um 16:25:24 aufgetreten und erscheint 69 mal

Clicking on a log entry ends in:

Logger: skodaconnect.api
Source: /usr/local/lib/python3.8/site-packages/skodaconnect/api.py:423
First occurred: 16:25:12 (79 occurrences)
Last logged: 19:07:57

    Could not fetch StoredVehicleDataResponse, error: 504, message='Gateway Timeout', url=URL('https://msg.volkswagen.de/fs-car/bs/vsr/v1/skoda/CZ/vehicles/TMB*******/status')
    Could not fetch StoredVehicleDataResponse, error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/vsr/v1/skoda/CZ/vehicles/TMB*******/status')
    Could not fetch StoredVehicleDataResponse, error: 500, message='Internal Server Error', url=URL('https://msg.volkswagen.de/fs-car/bs/vsr/v1/skoda/CZ/vehicles/TMB*******/status')

or

Logger: skodaconnect.api
Source: /usr/local/lib/python3.8/site-packages/skodaconnect/api.py:405
First occurred: 16:25:27 (71 occurrences)
Last logged: 19:07:47

    Could not fetch position (ClientResponseError), error: 504, message='Gateway Timeout', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMB*******/position')
    Could not fetch position (ClientResponseError), error: 401, message='Unauthorized', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMB*******/position')
    Could not fetch position (ClientResponseError), error: 500, message='Internal Server Error', url=URL('https://msg.volkswagen.de/fs-car/bs/cf/v1/skoda/CZ/vehicles/TMB*******/position')

I only have these resources in my configuration.yaml:

  resources:
      - distance
      - position
      - service_inspection
      - oil_inspection
      - door_locked
      - trunk_locked
      - fuel_level
      - windows_closed
      - combustion_range
      - parking_light
      - door_closed_left_front
      - door_closed_left_back
      - door_closed_right_front
      - door_closed_right_back
      - trunk_closed
      - window_closed_left_front
      - window_closed_left_back
      - window_closed_right_front
      - window_closed_right_back
      - outside_temperature
      - battery_level

Entries like charger or climatisation shouldn't come up in the error log, or am i missing something.

Even with the reduced resources i get the following entities created and they are most likely working as far as i can tell: Screenshot_20210126-200133_Samsung Internet

Is this the latest code on github or the latest release? If it is the latest release then it is the same status as last time, 13 days ago, upcoming release should fix it.

As the code is written in last release it will try to fetch data for all API endpoints regardless of enabled resources.

Kaibob2 commented 3 years ago

It's the latest release 1.0.27 as provided in HACS. I hoped i could provide more Info with my last post. If not, sorry, just ignore it :)

Farfar commented 3 years ago

It's the latest release 1.0.27 as provided in HACS. I hoped i could provide more Info with my last post. If not, sorry, just ignore it :)

No problem, I think I know where the problem lies. I could be wrong though but the new code is so different that all problems that might persist should be as good as new ;)

Just feeling a bit stressed to get next version released as it should fix many issues and help troubleshoot others. It's stable enough that I think I'll release it tomorrow.

Farfar commented 3 years ago

It's the latest release 1.0.27 as provided in HACS. I hoped i could provide more Info with my last post. If not, sorry, just ignore it :)

I have released 1.0.30 as a beta (v1.0.30-rc) that can be installed from HACS with beta releases enabled (press reinstall on repo and enable beta to get access). When enough people have tested this I will release as a stable version. The critical part would be legacy pre-heater on non-PHEV cars, the code have changed quite a bit and I can't test it since my car only got the newer style climater with auxiliary heater.

Kaibob2 commented 3 years ago

Hi. Just installed RC2. The only error in the log is:

Logger: skodaconnect.connection
Source: /usr/local/lib/python3.8/site-packages/skodaconnect/connection.py:598
First occurred: 13:22:32 (1 occurrences)
Last logged: 13:22:32
Could not fetch pre-heating, error: name 'err' is not defined 

and all entities appear as restored:true in the entity list. None gets updated. All are unavailable. Only the following seem to work:

binary_sensor.octavia_request_in_progress
device_tracker.octavia
sensor.octavia_requests_remaining
switch.octavia_force_data_refresh

switch.octavia_force_data_refresh is not supported here, by the way

lissmeister commented 3 years ago

Hi, i am also on RC3 and no sensors gets updated any longer.

2018 Superb L&K 190hp TDI 4x4, living in Sweden.

When trying to activate the parking heater the error log is the following:


Source: custom_components/skodaconnect/switch.py:32
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 1:48:06 PM (1 occurrences)
Last logged: 1:48:06 PM

[140018450977408] 'Vehicle' object has no attribute 'is_combustion_climatisation_supported'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 135, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1445, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 593, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 664, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 630, in _handle_entity_call
    await result
  File "/config/custom_components/skodaconnect/switch.py", line 32, in async_turn_on
    await self.instrument.turn_on()
  File "/usr/local/lib/python3.8/site-packages/skodaconnect/dashboard.py", line 528, in turn_on
    await self.vehicle.set_pheater(mode='heating', spin=self.spin)
  File "/usr/local/lib/python3.8/site-packages/skodaconnect/vehicle.py", line 352, in set_pheater
    if not self.is_combustion_climatisation_supported:
AttributeError: 'Vehicle' object has no attribute 'is_combustion_climatisation_supported'```
Kaibob2 commented 3 years ago

I edited my above post. I installed RC2 there. Now with RC3 the log error is gone, but the entities are still in the state as described above

Farfar commented 3 years ago

Please restart home assistant completeley, looks as if the library isn't updated since there's no variable named "err" anymore. Check library version from shell with "pip show skodaconnect" logged in with correct user and in venv if applicable.

Can you supply the start of home-assistant.log please? The logs from within home assistant is rather useless unless something acutally throws an error. What I am interested in is the lines with: INFO (MainThread) [skodaconnect.vehicle] Vehicle XYZWXYZWXYZW added from Skoda Connect. Homeregion is "https://mal-3a.prd.eu.dp.vwg-connect.com/api" DEBUG (MainThread) [skodaconnect.vehicle] Enabled API endpoints: dict_keys(['preheater', 'realcar', 'carport', 'mobiledevicemgmt_v1', 'rolesrights_secondaryuser_v2', 'rolesrights_securitypin_v1', 'rclima_v1', 'statusreport_v1', 'timerprogramming_v1', 'cc_breakdown_v2', 'speedalert_v1', 'rolesrights_secondaryuser_v1', 'rolesrights_primaryuser_v2', 'dwap', 'rbatterycharge_v1', 'rlu_v1', 'dealerappoint_v1', 'rolesrights_securitypin_v2', 'rolesrights_authorization_v2', 'rhonk_v1', 'geofence_v1', 'usermanagement_users_v1', 'carfinder_v1', 'rolesrights_primaryuser_v1', 'trip_statistic_v1', 'pso_v1', 'rolesrights_permissions_v1', 'hotspotwlan_v1'])

Farfar commented 3 years ago

@kaibob2 and @lissmeister easiest might be to send me the complete log file. Please redact all sensitive data before doing so.

lissmeister commented 3 years ago

@Farfar Attached is anything related to skodaconnect from the log file.

Ps. I´ve installed rc3 through hacs, but manifest.json still says rc2 and so does the log. 😀

skodaconnect.log

Farfar commented 3 years ago

@Farfar Attached is anything related to skodaconnect from the log file.

Ps. I´ve installed rc3 through hacs, but manifest.json still says rc2 and so does the log.

skodaconnect.log

Thanks I already see what I think is the culprit. Something errs when the integration tries to auto discover what API endpoints are enabled so most are disabled. I will work on a fix right away.

Farfar commented 3 years ago

and

RC4 is available now. I have reworked the API service discovery since it seems to fail for most cars for some reason. If it keeps mucking up at least I have added some more debugging so I might catch exactly what goes wrong.