DurgNomis-drol / ha_toyota

Toyota Connected Services integration for Home Assistant.
MIT License
148 stars 29 forks source link

Use new mytoyota api endpoints #198

Closed CM000n closed 8 months ago

CM000n commented 9 months ago

This MR uses a mytoyota version >= 1.0 and therefore also the new ctpa-oneapi API version from Toyota for the Home Assistant toyota Custom Component. Some of the previous functionalities of the custom component have been removed as they are not (yet) supported by the revised mytoyota lib version.

CM000n commented 8 months ago

The binary_sensors and device_trackers are now working again with the current status πŸŽ‰: Screenshot 2024-01-06 223501

I hope I can find some time next week to take care of the sensors. Then we could release a first version based on the new API endpoints. 😊 The comments about the custom components no longer working are slowly piling up in Issue https://github.com/DurgNomis-drol/ha_toyota/issues/160

lkucytowski commented 8 months ago

Hey, not sure if this is any help but I tried your latest commit and I'm still getting:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/toyota/__init__.py", line 54, in async_setup_entry
    use_metric_values = entry.data[CONF_METRIC_VALUES]
                        ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
KeyError: 'use_metric_values'
CM000n commented 8 months ago

Hey, not sure if this is any help but I tried your latest commit and I'm still getting:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/toyota/__init__.py", line 54, in async_setup_entry
    use_metric_values = entry.data[CONF_METRIC_VALUES]
                        ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
KeyError: 'use_metric_values'

It looks like the custom component is missing the information for use_metric_values. Did you also completely removed the integration before you copied the files from the last commit state? The custom component must be completely set up and configured from scratch before you can use it.

lkucytowski commented 8 months ago

At first I just replaced the files but this didn't work, so I removed the integration and just placed the folder in the custom_components folder, still the same error. I'm probably doing something wrong, could you tell me what is the correct way?

CM000n commented 8 months ago

At first I just replaced the files but this didn't work, so I removed the integration and just placed the folder in the custom_components folder, still the same error. I'm probably doing something wrong, could you tell me what is the correct way?

That sounds valid at first. Have you also restarted in between after deleting the integration completely and manually copying the files from the development branch?

What does your UI dialog look like when you set up the integration again? Is the option for metric values available there? Do you have a screenshot?

lkucytowski commented 8 months ago

I was able to get it to work by removing it completely from integrations as well as from custom_components and redoing credentials. It seems to be connecting fine, however, only car location is working for me at the moment.

CleanShot 2024-01-07 at 22 23 18@2x

CM000n commented 8 months ago

I was able to get it to work by removing it completely from integrations as well as from custom_components and redoing credentials. It seems to be connecting fine, however, only car location is working for me at the moment.

That is the intention. It looks like your car (even via the official app) doesn't provide any information on the status of windows and doors, right? And more is not yet integrated in the current state of work.

lkucytowski commented 8 months ago

That's actually correct πŸ˜… Let me know if I can be any help with testing other stuff.

amastrogiacomo1968 commented 8 months ago

Good evening, after I copy the files into the custom_component folder, how do I enter the user and password for the new app? Thank you

lkucytowski commented 8 months ago

Good evening, after I copy the files into the custom_component folder, how do I enter the user and password for the new app? Thank you

You need to delete this integration from settings -> devices and re-add it.

amastrogiacomo1968 commented 8 months ago

Good evening, after I copy the files into the custom_component folder, how do I enter the user and password for the new app? Thank you

You need to delete this integration from settings -> devices and re-add it.

Forgive me I don't understand :-( I removed the "old" integration in HACS Toyota Connected Services Europe and deleted the Toyota directory under custom_components. I copied the new mytoyota (with all its contents) always under custom_components. At this point what steps should I follow? Thanks and sorry for the disturbance

CM000n commented 8 months ago

Good evening, after I copy the files into the custom_component folder, how do I enter the user and password for the new app? Thank you

You need to delete this integration from settings -> devices and re-add it.

Forgive me I don't understand :-( I removed the "old" integration in HACS Toyota Connected Services Europe and deleted the Toyota directory under custom_components. I copied the new mytoyota (with all its contents) always under custom_components. At this point what steps should I follow? Thanks and sorry for the disturbance

Why are you talking about mytoyota? mytoyota is the python lib for the custom component and not a custom component itself. Please guys, don't let this degenerate into a "how to install a custom component manually" discussion. The branch is under development and its contents may be incomplete or in the process of being changed at any time. So you should know what you are doing before you try to use this working state πŸ˜‰

amastrogiacomo1968 commented 8 months ago

Good evening, after I copy the files into the custom_component folder, how do I enter the user and password for the new app? Thank you

You need to delete this integration from settings -> devices and re-add it.

Forgive me I don't understand :-( I removed the "old" integration in HACS Toyota Connected Services Europe and deleted the Toyota directory under custom_components. I copied the new mytoyota (with all its contents) always under custom_components. At this point what steps should I follow? Thanks and sorry for the disturbance

Why are you talking about mytoyota? mytoyota is the python lib for the custom component and not a custom component itself. Please guys, don't let this degenerate into a "how to install a custom component manually" discussion. The branch is under development and its contents may be incomplete or in the process of being changed at any time. So you should know what you are doing before you try to use this working state πŸ˜‰

Of course, I thought the installation was "simple" and within the reach of the average user. I'm waiting for the release, even in beta, to test it with my CHR. Thank you

CM000n commented 8 months ago

Aaaand statistics sensors now also working again ☺️

Screenshot 2024-01-08 160947
desosav commented 8 months ago

Hi @CM000n , Thank you for your amazing work updating this integration. I have applied your latest commits and the new sensors are now available in HA. I have noticed something weird in the current month/year sensor. I was expecting both of them to display the same value since this is the first month of 2024. However the current year stats display double kilometers compared to the current month stats. Screenshot_20240108-202909_Home Assistant~2

Are you planning to update the sensors to include additional attributes like driver score, EV driving time, etc as it was the previous version of the integration?

CM000n commented 8 months ago

Hi @CM000n , Thank you for your amazing work updating this integration. I have applied your latest commits and the new sensors are now available in HA. I have noticed something weird in the current month/year sensor. I was expecting both of them to display the same value since this is the first month of 2024. However the current year stats display double kilometers compared to the current month stats.

Are you planning to update the sensors to include additional attributes like driver score, EV driving time, etc as it was the previous version of the integration?

There is already an issue open for the inconsistent statistic summaries on the mytoyota lib: https://github.com/DurgNomis-drol/mytoyota/issues/281#issue-2070810003 πŸ˜‰

Additional information is currently no longer provided by the mytoyota lib. We will certainly expand this in the future. But the initial release will probably include any further informations.

MaximeNagel commented 8 months ago

Hi @CM000n to add my contribution to the effort I also install your last commit to help you test your new change.

As already explained in this MR I delete my integration and uninstal the int from hacs. Then I put manually the integration.

Setup flow seems to work correctly. But when int try to create entities it seems that some value required is not always send by toyota

2024-01-09 08:41:14.233 ERROR (MainThread) [custom_components.toyota] Unexpected error fetching toyota data: 2 validation errors for VehiclesResponseModel
payload -> 0 -> dcm
  none is not an allowed value (type=type_error.none.not_allowed)
payload -> 0 -> electricalPlatformCode
  none is not an allowed value (type=type_error.none.not_allowed)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 256, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/toyota/__init__.py", line 72, in async_get_vehicle_data
    vehicles = await asyncio.wait_for(client.get_vehicles(metric=use_metric_values), 15)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/tasks.py", line 489, in wait_for
    return fut.result()
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mytoyota/client.py", line 63, in get_vehicles
    vehicles = await self._api.get_vehicles_endpoint()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mytoyota/api.py", line 75, in get_vehicles_endpoint
    return await self._request_and_parse(VehiclesResponseModel, "GET", VEHICLE_GUID_ENDPOINT)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mytoyota/api.py", line 49, in _request_and_parse
    return model(**response)
           ^^^^^^^^^^^^^^^^^
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 2 validation errors for VehiclesResponseModel
payload -> 0 -> dcm
  none is not an allowed value (type=type_error.none.not_allowed)
payload -> 0 -> electricalPlatformCode
  none is not an allowed value (type=type_error.none.not_allowed)
2024-01-09 08:41:14.237 DEBUG (MainThread) [custom_components.toyota] Finished fetching toyota data in 0.515 seconds (success: False)

I have a Toyota Corolla Touring 2021 I don't see all the payload of the message in the Log...

CM000n commented 8 months ago

Hi @CM000n to add my contribution to the effort I also install your last commit to help you test your new change.

As already explained in this MR I delete my integration and uninstal the int from hacs. Then I put manually the integration.

Setup flow seems to work correctly. But when int try to create entities it seems that some value required is not always send by toyota I have a Toyota Corolla Touring 2021 I don't see all the payload of the message in the Log...

This is a problem with a model of the used mytoyota python lib. Please open a separate issue there for better tracking of the problem: https://github.com/DurgNomis-drol/mytoyota/issues

lkucytowski commented 8 months ago

After loading the latest commit, I can see all info on VIM entity, but the statistics stopped working for me.

The errors I'm seeing are:

[140095905274688] Unable to serialize to JSON. Bad data found at $(State: sensor.rav4_phev_current_year_statistics).attributes.EV_duration=11:11:06(<class 'datetime.timedelta'>
[140095914808384] Unable to serialize to JSON. Bad data found at $(State: sensor.rav4_phev_current_day_statistics).attributes.EV_duration=0:01:57(<class 'datetime.timedelta'>
[140095914808384] Unable to serialize to JSON. Bad data found at $(State: sensor.rav4_phev_current_week_statistics).attributes.EV_duration=0:40:14(<class 'datetime.timedelta'>
[140095914808384] Unable to serialize to JSON. Bad data found at $(State: sensor.rav4_phev_current_month_statistics).attributes.EV_duration=5:35:33(<class 'datetime.timedelta'>
[140095914808384] Unable to serialize to JSON. Bad data found at $(State: sensor.rav4_phev_current_year_statistics).attributes.EV_duration=11:11:06(<class 'datetime.timedelta'>

CleanShot 2024-01-09 at 11 51 59

CM000n commented 8 months ago

After loading the latest commit, I can see all info on VIM entity, but the statistics stopped working for me.

The errors I'm seeing are:

[140095905274688] Unable to serialize to JSON. Bad data found at $(State: sensor.rav4_phev_current_year_statistics).attributes.EV_duration=11:11:06(<class 'datetime.timedelta'>
[140095914808384] Unable to serialize to JSON. Bad data found at $(State: sensor.rav4_phev_current_day_statistics).attributes.EV_duration=0:01:57(<class 'datetime.timedelta'>
[140095914808384] Unable to serialize to JSON. Bad data found at $(State: sensor.rav4_phev_current_week_statistics).attributes.EV_duration=0:40:14(<class 'datetime.timedelta'>
[140095914808384] Unable to serialize to JSON. Bad data found at $(State: sensor.rav4_phev_current_month_statistics).attributes.EV_duration=5:35:33(<class 'datetime.timedelta'>
[140095914808384] Unable to serialize to JSON. Bad data found at $(State: sensor.rav4_phev_current_year_statistics).attributes.EV_duration=11:11:06(<class 'datetime.timedelta'>

Thanks for reporting. Can you test it again?

lkucytowski commented 8 months ago

Working back again, thanks!

lkucytowski commented 8 months ago

The latest commit is working great for me. Any chance for the battery percentage sensor? πŸ™ƒ

CleanShot 2024-01-09 at 15 17 00@2x

CM000n commented 8 months ago

The latest commit is working great for me. Any chance for the battery percentage sensor? πŸ™ƒ

The battery level sensor is already included. However, I only generate this if the vehicle returns battery_status = true in its capabilities. Maybe this assumption is wrong. It looks like you have a plug-in hybrid? I only have a mild hybrid myself, which definitely doesn't return any status to its battery, so I can't try it out myself.

Could you please post the Features and Extended capabilities from the attributes of the Vin sensor for your vehicle here? We might be able to understand it better with that information. 😊

lkucytowski commented 8 months ago

Yeah it's a plugin hybrid, so the app is providing info like battery state of charge in percentage and range in kilometres.

Click me ![IMG_5996](https://github.com/DurgNomis-drol/ha_toyota/assets/20861355/d1403bab-c7f8-41d7-927f-f331d4e5fc01) ``` extended_capabilities: c_scheduling: true battery_status: false bonnet_status: false bump_collisions: false buzzer_capable: false charge_management: true climate_capable: false climate_temperature_control_full: false climate_temperature_control_limited: false dashboard_warning_lights: false door_lock_unlock_capable: false drive_pulse: false ecare: false econnect_climate_capable: true econnect_vehicle_status_capable: true electric_pulse: false emergency_assist: false enhanced_security_system_capable: false equipped_with_alarm: false ev_battery: false ev_charge_stations_capable: true fcv_stations_capable: false front_defogger: true front_driver_door_lock_status: false front_driver_door_open_status: false front_driver_door_window_status: false front_driver_seat_heater: false front_driver_seat_ventilation: false front_passenger_door_lock_status: false front_passenger_door_open_status: false front_passenger_door_window_status: false front_passenger_seat_heater: false front_passenger_seat_ventilation: false fuel_level_available: true fuel_range_available: true guest_driver: true hazard_capable: false horn_capable: false hybrid_pulse: true hydrogen_pulse: false last_parked_capable: true light_status: false lights_capable: false manual_rear_windows: false mirror_heater: false moonroof: false next_charge: true power_tailgate_capable: false power_windows_capable: false rear_defogger: true rear_driver_door_lock_status: false rear_driver_door_open_status: false rear_driver_door_window_status: false rear_driver_seat_heater: false rear_driver_seat_ventilation: false rear_hatch_rear_window: true rear_passenger_door_lock_status: false rear_passenger_door_open_status: false rear_passenger_door_window_status: false rear_passenger_seat_heater: false rear_passenger_seat_ventilation: false remote_econnect_capable: true remote_engine_start_stop: false smart_key_status: false steering_heater: false stellantis_climate_capable: false stellantis_vehicle_status_capable: false sunroof: false telemetry_capable: true trunk_lock_unlock_capable: false try_and_play: false vehicle_diagnostic_capable: true vehicle_finder: false vehicle_status: false we_hybrid_capable: false weekly_charge: false ``` ``` features: ach_payment: false add_service_record: false auto_drive: false cerence: false charging_station: true climate_start_engine: false collision_assistance: false connected_card: false connected_insurance: false connected_support: false crash_notification: false critical_alert: false dashboard_lights: false dealer_appointment: true digital_key: false door_lock_capable: false drive_pulse: false driver_companion: false driver_score: false dtc_access: false dynamic_navi: false eco_history: false eco_ranking: false electric_pulse: false emergency_assist: false enhanced_security_system: false ev_charge_station: true ev_remote_services: false ev_vehicle_status: false financial_services: false flex_rental: false h2_fuel_station: false home_charge: true how_to_videos: false hybrid_pulse: true hydrogen_pulse: false important_message: false insurance: false last_parked: true lcfs: false linked_accounts: false maintenance_timeline: false marketing_card: false marketing_consent: false master_consent_editable: false my_destination: false owners_manual: false paid_product: false parked_vehicle_locator: false parking: false parking_notes: false personalized_settings: false privacy: true recent_trip: false remote_dtc: false remote_parking: false remote_service: true roadside_assistance: false safety_recall: false schedule_maintenance: false service_history: true shop_genuine_parts: false smart_charging: true ssa_download: false sxm_radio: false telemetry: true tff: false tire_pressure: false v1g: false va_setting: false vehicle_diagnostic: true vehicle_health_report: false vehicle_specifications: false vehicle_status: false we_hybrid: false wifi: false xcapp: false ```
lkucytowski commented 8 months ago

Actually, it's returning ev_vehicle: true above extended_capabilities

CleanShot 2024-01-09 at 16 06 12@2x

CM000n commented 8 months ago

Thank you very much! 😊 You should now see the battery level sensor

lkucytowski commented 8 months ago

Thank you very much! 😊 You should now see the battery level sensor

No, no, I'm the one thanking you! Thank You for making my Home Assistant instance better ❀️

Will confirm soon. My wife is driving the car right now and the API is refusing to work, even in the official app 🀣

IMG_5998

lkucytowski commented 8 months ago

It's there but it seems to be pulling fuel level stat. The current battery state of charge is 88%

CleanShot 2024-01-09 at 16 22 48@2x

If I can be any help with testing other sensors related to EV (EV range etc), let me know.

lkucytowski commented 8 months ago

Working now!

lkucytowski commented 8 months ago

You are flying, all is working fine and matching the app.

Click me ![IMG_5999](https://github.com/DurgNomis-drol/ha_toyota/assets/20861355/8b0ba9da-6faf-4dd9-8fcd-ac0706c6686c) ![CleanShot 2024-01-09 at 20 21 45@2x](https://github.com/DurgNomis-drol/ha_toyota/assets/20861355/0c629465-8cc4-43f7-af6b-d0ae13102de0)
desosav commented 8 months ago

Once again great work. Just letting you know that "fuel consumed" is the only attribute that is incorrect for all day/week/month/year sensors. I get 2lt fuel consumption for 256km travelled which is inconsistent with actual consumption provided by the myToyota app

Click me ![Screenshot_20240109-233900_Home Assistant~2](https://github.com/DurgNomis-drol/ha_toyota/assets/47779640/2a5d2743-8463-4adf-ac12-51ce3fc15a10) ![Screenshot_20240109-234040_MyToyota~2](https://github.com/DurgNomis-drol/ha_toyota/assets/47779640/f76c1a6f-a206-45e3-9271-b0972bd4f555)
CM000n commented 8 months ago

Once again great work. Just letting you know that "fuel consumed" is the only attribute that is incorrect for all day/week/month/year sensors. I get 2lt fuel consumption for 256km travelled which is inconsistent with actual consumption provided by the myToyota app

This is a problem with the mytoyota lib. Please open a separate issue there: https://github.com/DurgNomis-drol/mytoyota/issues

skgsergio commented 8 months ago

Does it make sense to have the VIN as an attribute of the VIN sensor that already shows the VIN? Also masking it in the attribute doesn't provide much value as the sensor itself shows it complete.

CM000n commented 8 months ago

Does it make sense to have the VIN as an attribute of the VIN sensor that already shows the VIN? Also masking it in the attribute doesn't provide much value as the sensor itself shows it complete.

The idea was simply to be able to copy and paste the content of the attributes of the VIN sensor somewhere for debugging purposes if required. But you are probably right and the redundant specification of the masked VIN number is not really necessary there.

CM000n commented 8 months ago

I think we are good to go for a first release based on the new API @DurgNomis-drol 😊

MaximeNagel commented 8 months ago

Awesome work man. So much effort during the last few weeks!

Maybe you have a community shared coffee machine or beer tap as a German ;) ? I would be happy to contribute. :)

CM000n commented 8 months ago

Awesome work man. So much effort during the last few weeks!

Maybe you have a community shared coffee machine or beer tap as a German ;) ? I would be happy to contribute. :)

Thank you, that's nice of you πŸ˜— But if you have money to spare, spend it on someone who can really use it:

MaximeNagel commented 8 months ago

Awesome work man. So much effort during the last few weeks! Maybe you have a community shared coffee machine or beer tap as a German ;) ? I would be happy to contribute. :)

Thank you, that's nice of you πŸ˜— But if you have money to spare, spend it on someone who can really use it:

image

You seem to be a really nice person, and I have done my duty with pleasure if that's what makes you happy :)

CM000n commented 8 months ago

image

You seem to be a really nice person, and I have done my duty with pleasure if that's what makes you happy :)

❀️ ❀️ ❀️

DurgNomis-drol commented 8 months ago

image

Just tested your amazing work.

My car is not an electric or a hybrid, but I still get these sensors?

Also it says T instead of Toyota

We can still merge it, only posted for info

Also why can't i get statistical information anymore, it was available before?

CM000n commented 8 months ago

image

Just tested your amazing work.

My car is not an electric or a hybrid, but I still get these sensors?

Also it says T instead of Toyota

The T is the oficial brand description from the API. Maybe we can add a additional mapping on our side to full names.

Regarding the sensors it seems we have to investigate further to find the correct conditions. Can you pls paste the content from the attributes of the vin sensor here?

DurgNomis-drol commented 8 months ago
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: {}

Remote service should be enabled in the app, maybe there lays the problem?

CM000n commented 8 months ago

Remote service should be enabled in the app, maybe there lays the problem?

No, the problem is rather that I thought batery_status stood for the battery information of EV cars. But that probably refers more to the starter battery

CM000n commented 8 months ago

Should be fixed/adjusted now @DurgNomis-drol 😊

DurgNomis-drol commented 8 months ago

Can confirm it fixes it

It's probably a replacement for the old starter battery sensor.

Any clues why odometer and statistics does not work for me?

CM000n commented 8 months ago

Can confirm it fixes it

It's probably a replacement for the old starter battery sensor.

Any clues why odometer and statistics does not work for me?

The condition for statistics is currently that the vehicle is telemetry-capable. I have not yet found a better indication in the capabilities or features of a vehicle that point to the generation of trip statistics. I saw in your screenshot that the odometer was created for you but displayed "unknown". I then also applied the telemetry condition for the odometer.

However, this might be something that we should investigate with the actual mytoyota lib to see if and where the odometer information for your vehicle comes from and if the statistic information is available there.

CM000n commented 8 months ago

The statistics sensors should now be available @DurgNomis-drol. In the mytoyota lib we also do not yet have a condition for retrieving the trip and statistics data.

DurgNomis-drol commented 8 months ago
('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]]')

output from mytoyota

CM000n commented 8 months ago

output from mytoyota

So there are also no values for odometer etc. because your vehicle does not support telemetry (https://github.com/DurgNomis-drol/mytoyota/blob/master/mytoyota/models/vehicle.py#L64). Perhaps the information still arrives via one of the other end points?

Have you looked at what comes back from the endpoint if you bypass the conditions in the vehicle model or address the endpoint directly?

By the way, I think this is getting a bit off topic here. :wink: Shouldn't we move the search for your Odometer values to an issue in the mytoyota repo?

lkucytowski commented 8 months ago

Just loaded the latest commit and all is working as expected for me πŸ’ͺ