hacf-fr / renault-api

https://readthedocs.org/projects/renault-api/
MIT License
107 stars 38 forks source link

charging-settings is available for other cars also #194

Closed ZMan88 closed 3 years ago

ZMan88 commented 3 years ago

I have a Zoe R135, and from the testing I have done, the charging-settings is working for it although it doesn't appear that I have a contract "ZEINTER" as is specified in the code. From my testing the charge-mode endpoint also returns a response. I'm not sure if the endpoints functionality are directly connected to the contracts or if it country related, my car being registered to Romania. Another odd thing is that recently I have noticed that now it shows notifications in My Renault app when the hvac preconditioning is over, notifications that didn't appear before. Hope this helps somewhat

ZMan88 commented 3 years ago

When I execute the contracts endpoint I get a couple of _CONNECTEDSERVICES contracts, don't know if that is equivalent to ZEINTER

epenet commented 3 years ago

What do you have in the contract list? Can you post a json extract or log here?

ZMan88 commented 3 years ago

This is part of the json for the contracts endpoint [ { "type": "CONNECTED_SERVICES", "contractId": ..., "code": "IV20000320", "group": "L", "durationMonths": 36, "startDate": "2020-12-15", "endDate": "2023-12-15", "status": "ACTIVE", "description": "Remote Car Dashboard 36 months in base ", "conditions": ... }, { "type": "CONNECTED_SERVICES", "contractId": ..., "code": "PACK_J2_EV", "group": "N", "durationMonths": 36, "startDate": "2020-12-15", "endDate": "2023-12-15", "status": "ACTIVE", "description": "Connectivity Pack EV 36 months in base ", "conditions": ... }, { "type": "CONNECTED_SERVICES", "contractId": ..., "code": "PACK_C1_E4", "group": "Z", "durationMonths": 36, "startDate": "2020-12-15", "endDate": "2023-12-15", "status": "ACTIVE", "description": "Remote Control 36 months serial ", "conditions": ... }, { "type": "CONNECTED_SERVICES", "contractId": ..., "code": "IV20000520", "group": "L", "durationMonths": 36, "startDate": "2020-12-15", "endDate": "2023-12-15", "status": "ACTIVE", "description": "Firmware update over the Air for life ", "conditions": ... } ...

epenet commented 3 years ago

Contracts were implemented in PR #145 with @oncleben31 If each country has different contract codes then I guess with have to remove the automatic checks.

Is it an issue for you in renault-api (with the CLI) or in home assistant (https://github.com/hacf-fr/hassRenaultZE)?

ZMan88 commented 3 years ago

I use it with homeassistant, could the link between contracts and endpoints be switched to the group of the contract? I can see that i have groups L,Z and N

epenet commented 3 years ago

You can look at the samples on this folder: https://github.com/hacf-fr/renault-api/tree/main/tests/fixtures/kamereon/vehicle_contract As you can see there, ZECONNECTP and ZEINTER are both in the same group (Z) so we couldn't use that either.

I think it was useful to have the contract endpoint implemented but sadly it seems we cannot use it reliably. I suggest that we remove the contract check in the home-assistant component (https://github.com/hacf-fr/hassRenaultZE/blob/master/custom_components/renault/renault_vehicle.py#L149) and in the CLI (https://github.com/hacf-fr/renault-api/blob/main/src/renault_api/cli/renault_vehicle.py#L186)

Maybe for the home-assistant component we add a option on the configuration screen ("has interactive contract" for charge-mode) and use that instead.

ZMan88 commented 3 years ago

I know that this is not the right place where to ask, but couldn't find another place to ask this. Where do you guys get the endpoints that are available? The reason I ask is because with the latest version of the My Renault app, I now get in app notifications that the Preconditioning has started and also that it has ended, this hasn't worked before, but the for me the hvac-status endpoint returns that it is not implemented so I am wondering how is this implemented in the app. If there is another place where I should ask this, point me that way and I will move it. Thanks.

epenet commented 3 years ago

You can reach me via a private message on Discord: https://discord.gg/PaZFEjX (epenet)

mfonville commented 3 years ago

Also the app nowadays has push-messages on Android (it already did this longer on iPhone) the starting and ending of charging sessions for my R135.

epenet commented 3 years ago

Hi @mfonville, I am fully open to PR, but I don't have the bandwidth for this at the moment...

epenet commented 3 years ago

Hi @mfonville, I will close the original issue. If you want to pursue the push-messages, then please open a new issue or PR.