daernsinstantfortress / WeConnect-Cupra-python

Cupra version of the WeConnect python library
MIT License
8 stars 5 forks source link

Extend checking to handle None value in case of hybrid car #13

Open lucas2lab opened 6 months ago

lucas2lab commented 6 months ago

Testing the code with my Formentor Hybrid car I got a crash due to a None value returned on the chargePower_kW and chargeRate_kmph attributed returned as None.

I extend the code to fix it.

neubi4 commented 3 months ago

@daernsinstantfortress this should fix these issues with the home assistant integration: daernsinstantfortress/cupra_we_connect/issues/46 daernsinstantfortress/cupra_we_connect/issues/54 daernsinstantfortress/cupra_we_connect/issues/76

This happens because i have an Cupra Born and an Cupra Leon e-hybrid in my MyCupra App. It seems that the hybrids report None for the two fields. {'carCapturedTimestamp': '2024-08-04T12:25:52Z', 'chargingState': 'charging', 'chargeType': 'ac', 'chargeMode': 'manual', 'chargingSettings': None, 'remainingChargingTimeToComplete_min': 145, 'chargePower_kW': None, 'chargeRate_kmph': None, 'value': {...}}

12retord commented 1 month ago

@neubi4 Hello, that means, it is possible to manage a Born and a second car (Hybrid) with this integration parallel? I have a Born and a Tarraco hybrid (which should be similar to the Formentor) and i‘m not able to get the integration started. As shown it is necessary so change to files. I tried, but it is not working for me. Maybe you can give me some hints/more Information. (Maybe parallel in german language) Thanks and best regards

neubi4 commented 1 month ago

@12retord you need the changes from this PR and also these changes https://github.com/daernsinstantfortress/cupra_we_connect/pull/78/files to get it working.

Du musst die Änderungen von diesem PR hier vornehmen und auch die von https://github.com/daernsinstantfortress/cupra_we_connect/pull/78/files damit das funktioniert. Ich hab das zuletzt aber im August getestet, ich weiß nicht ob das noch aktuell ist.

12retord commented 1 month ago

The changes #78 are no problem. My problem is, either i download the .zip file and make the changes above. But how can i install it with only the .zip file. Or i install it via HACS, but where is the charging_status.py file saved to change it?

Die Änderungen in der sensor.py sind kein Problem, die Datei liegt ja im Verzeichnis: /custom_components/cupra_we_connect

Mit der charging_status.py komme ich nicht klar. Wenn ich mir die zip Datei runterlade kann ich ja die entsprechende Datei editieren, aber wie bekomme ich die zip Datei dann in HA installiert. Oder ich installiere das ganze über HACS, wo finde ich dann die Datei charging_status.py um diese zu editieren. Zgriff auf das Dateisystem über WinSCP ist vorhanden, nur finde ich das entsprechende Verzeichnis nicht.

Oder brauche ich einen komplett anderen Ansatz?

MaHeymann commented 3 weeks ago

I have the same problem with my Cupra Formentor. Is there a solution now?

12retord commented 3 weeks ago

My solution is to use two Integrations, the Seat Connect for my Tarraco Hybrid in combination with the (old)Seat Connect App. And for the born i created a new user with a different Email. You are not able to controll anything in the my_cupra app, but you get all the things shown in HA. For controling your born with the my_cupra app you have to login again with the main-user-account Not the best solution but it is working for me…

MaHeymann commented 3 weeks ago

How do I carry out the modifications? I'm a complete newbie at this. It would be nice if someone could help me with that. Also in German.

where can I find the file "weconnect_cupra/api/cupra/elements/charging_status.py"