DurgNomis-drol / mytoyota

Python client for Toyota Connected Services API
MIT License
80 stars 33 forks source link

Missing odometer information #301

Open DurgNomis-drol opened 10 months ago

DurgNomis-drol commented 10 months ago

Describe the bug A clear and concise description of what the bug is.

Using the API, I am missing the odometer information. This was available from the old endpoints.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Additional context Add any other context about the problem here.

Contract_id: "**********52458"
IMEI: "*************34103"
Katashiki_code: KGB40L-AHMGKW
ASI_code: FC
Brand: T
Car_line_name: Aygo
Car_model_year: "2018"
Car_model_name: Aygo - MC '18
Color: Dark Grey Mica
Generation: 17CYPLUS
Manufactured_date: "2021-03-01"
Date_of_first_use: null
Transmission_type: M
Fuel_type: G
Electrical_platform_code: null
EV_vehicle: false
Features:
  crash_notification: true
  dealer_appointment: true
  drive_pulse: true
  emergency_assist: true
  last_parked: true
  privacy: true
  service_history: true
Extended_capabilities:
  battery_status: true
  bump_collisions: true
  drive_pulse: true
  emergency_assist: true
Remote_service_capabilities: {}
('Dashboard: odometer=None fuel_level=None battery_level=None fuel_range=None '
 'battery_range=None battery_range_with_ac=None range=None '
 'charging_status=None remaining_charge_time=None warning_lights=[]')
('Location: latitude=00.00000 longitude=0.00000 timestamp=2024-01-11 '
 '15:42:03+00:00 state=Last Parked')
'Lock Status: last_updated=None doors=None windows=None hood=None'
'Notifications: []'
("Summary: [[average_speed=52.53 countries=['DK'] duration=5:25:28 "
 'distance=284.928 ev_duration=None ev_distance=None from_date=2023-07-15 '
 'to_date=2023-07-31 fuel_consumed=0.0 average_fuel_consumed=0.0], '
 "[average_speed=49.05 countries=['DK'] duration=12:50:35 distance=629.954 "
 'ev_duration=None ev_distance=None from_date=2023-08-01 to_date=2023-08-31 '
 'fuel_consumed=0.0 average_fuel_consumed=0.0], [average_speed=57.26 '
 "countries=['DK'] duration=20:38:22 distance=1181.861 ev_duration=None "
 'ev_distance=None from_date=2023-09-01 to_date=2023-09-30 fuel_consumed=0.0 '
 "average_fuel_consumed=0.0], [average_speed=63.33 countries=['DK'] duration=1 "
 'day, 3:17:51 distance=1728.835 ev_duration=None ev_distance=None '
 'from_date=2023-10-01 to_date=2023-10-31 fuel_consumed=0.0 '
 "average_fuel_consumed=0.0], [average_speed=49.73 countries=['DK'] "
 'duration=20:07:04 distance=1000.43 ev_duration=None ev_distance=None '
 'from_date=2023-11-01 to_date=2023-11-30 fuel_consumed=0.0 '
 "average_fuel_consumed=0.0], [average_speed=53.63 countries=['DK'] duration=1 "
 'day, 3:19:18 distance=1465.188 ev_duration=None ev_distance=None '
 'from_date=2023-12-01 to_date=2023-12-31 fuel_consumed=0.0 '
 "average_fuel_consumed=0.0], [average_speed=36.97 countries=['DK'] "
 'duration=12:12:12 distance=451.131 ev_duration=None ev_distance=None '
 'from_date=2024-01-01 to_date=2024-01-11 fuel_consumed=0.0 '
 'average_fuel_consumed=0.0]]')
DurgNomis-drol commented 10 months ago

Old app had the information, the new does not. Seems it maybe because of Toyota... They have removed it

CM000n commented 10 months ago

So there may not be much we can do here if it already no longer exists in the official app. Have you looked at the original responses from the endpoints to see if you can still get the information via one of them?

CM000n commented 10 months ago

Hi @DurgNomis-drol. We currently get the odometer information via the telemetry endpoint using the get_telemetry_endpoint function in mytoyota.api. However, there is also an odo information that comes via the status endpoint with the get_remote_status_endpoint. Could you have a look to see if you can get odometer information for your vehicle with that endpoint?

If so, we still need to clarify what the condition is for data to come via this endpoint. Our current assumption was that this status endpoint is only supported if the vehicle has vehicle_info.extended_capabilities.vehicle_status = True in its capabilities. But your car doesn't seem to have this extended capability.

GitOldGrumpy commented 10 months ago

@CM000n when I was investigating the endpoints originally there are stacks of endpoints that have similar names but are /v1, /v2, /legacy, etc. The information for the missing information could be under one of these? I have some code somewhere(back from the original work) that hits all the endpoints looking for useful information. Do you think its useful to add it to the repository for people to try if information is missing?

Although in this case not sure it will find anything if its not showing up in the App.

CM000n commented 10 months ago

That would certainly be interesting. But I think that would be best kept somewhere in the docs, if we ever make them: https://github.com/DurgNomis-drol/mytoyota/issues/18 But I think it's rather confusing and unnecessary directly in the production code.

DurgNomis-drol commented 10 months ago

Can you give me a hint on how to access the endpoint function directly?

CM000n commented 10 months ago

Can you give me a hint on how to access the endpoint function directly?

Set Log level to DEBUG here: https://github.com/DurgNomis-drol/mytoyota/blob/master/mytoyota/utils/logging/log_config.yaml#L30 Set capable to True here: https://github.com/DurgNomis-drol/mytoyota/blob/master/mytoyota/models/vehicle.py#L75 Run simple_client_example.py and have a look what you get back for RemoteStatusResponseModel.