wubbl0rz/FiatChamp

Alfa Romeo support

ofirr9100 opened this issue · 17 comments

Should I code a patch? :)

do you have any data like api keys and urls for alfa romeo ? i guess they use different values for different regions too. so if you find out the correct values it would be really nice to support it.

Here's what I saw so far:
domain: www.alfaromeoconnect.com
URL for lock action: https://www.alfaromeoconnect.com/moparsvc/connect/lock?remoteServiceRequestID=XXX&vin=XXX&action=LOCK
API Key: 3_etlYkCXNEhz4_KJVYDqnK1CqxQjvJStJMawBohJU2ch3kp30b0QCJtLCzxJ93N-M
"api": {
"ssoKey": "3_etlYkCXNEhz4_KJVYDqnK1CqxQjvJStJMawBohJU2ch3kp30b0QCJtLCzxJ93N-M",
"customAPIDomainPrefix": "",
"gmidTicketExpiration": 3600,
"baseDomains": [
"jeep.com",
"sso-master.com"
]
},
"sso": {
"validDomains": [
"gigya.com",
"alfaromeo.com",
"fiat.com",
"gigya", ...

gigya.defaultApiDomain = 'gigya.com';
gigya.dataCenter = 'us1';

Is there any specific additional information I can send or anything you want me to try?

Thanks!

there should be multiple api keys. login url used etc. i think i need to make a fake account and capture some traffic 😄

this works until the point where you need a real car to verify if its really working.

I'm not seeing them in the traffic or in the session. Would be happy to work together with you on finding out the missing data.
Do you have a postman config or something similar?

ok i had time to look into it 👀 www.alfaromeoconnect.com is not the correct service. does your car work with https://myalfaconnect.alfaromeo.com ? idk why they have 1 billion different uconnect services but only the ones listed in the readme can work.

That link sends me to https://connect.alfaromeo.com/us/ but when logging in there I can only configure the virtual assistant and not get information about my car.
Trying to go to the displayed dashboard link from there goes to https://federation.chrysler.com/sp/startSSO.ping?PartnerIdpId=https://fidm.gigya.com/saml/v2.0/3_VFF-z...
which gives me an error message:

#Ping-Msg#E036 - Sorry, an unexpected error condition has occurred. Please contact your system administrator for assistance and provide the following reference number to help locate additional information about this problem in the system log files.
Error Reference#: 4729-1339

Meanwhile, https://www.alfaromeoconnect.com/en-us/my-vehicle/dashboard.html does give me access to my vehicle.
Looking at it step by step, the initial page gives a lot of SSO errors:
gigya sso: https://www.alfaromeoconnect.com is not in valid domain: gigya.com,alfaromeo.com,fiat.com,gigya,gsapi,com.fca.myconnect.jeep.nafta,jeep.com,myuconnect.na.cpa.headunit.alfaromeo,com.fca.uconnect.cpa,dodge.com,prod.gsdp.na.server.calls.allbrands,idpbroker.passwordmodification.na.allbrand,com.fca.myconnect.wagoneer.nafta,wagoneer.com,fcagcv.com,ram.com,ramtrucks.com,mopar.na.web.dodge,idpbroker.na.allbrand,myuconnect

Going through the login action on the page, it seems like it initially went through:
https://login-us.alfaromeo.com/accounts.webSdkBootstrap?apiKey=4_z5ouAf50NbNHhxdqDSqZhQ&pageURL=https%3A%2F%2Fwww.alfaromeoconnect.com%2Fen-us%2Fmy-vehicle%2Fdashboard.html&sdk=js_latest&sdkBuild=13642&format=json

And then it's back to alfaromeoconnect...

Maybe that's the service you're looking for?

yes that login url looks better. at least the api key and login url should be correct. maybe i can add it for north america alfraromeo only and push a test build and you can try ?

Gladly

Hi,

I have an alfa romeo giulia my2021 and the setup went well, many data is being pulled from the car (gas quantity, tyre pressures, odometer, kms till service, etc)

It seems, that the controls are not working though :(
I have an account set up at https://myalfaconnect.alfaromeo.com/, I am from Hungary, Europe.

Is there anything I can be helpful with? I am not a programmer but I have advanced understanding in Home Assistant and related services/solutions.

At least I could help with testing. I really wish to have the controls available :)

Thanks,
Peter

Tried again, works from the website but the add-on returns a login error.

I would love to have this up and running.

Hello,

I just used the integration, and it works fine with my new Alfa Romeo Tonale (Hybrid)

Thanks.
Florent

Hello,

I just used the integration, and it works fine with my new Alfa Romeo Tonale (Hybrid)

Thanks.

Florent

What country are you in?

Hello,
I just used the integration, and it works fine with my new Alfa Romeo Tonale (Hybrid)
Thanks.
Florent

What country are you in?

Belgium

Hello, trying to use this addon for '24 Alfa Romeo Stelvio, but all I get is

[14:27:13 ERR] System.Exception: Authentication failed. 403120 Forbidden Account Temporarily Locked Out
   at FiatResponse.ThrowOnError(String message) in /home/runner/work/FiatChamp/FiatChamp/FiatChampAddon/FiatClient/FiatResponse.cs:line 31
   at FiatChamp.FiatClient.Login() in /home/runner/work/FiatChamp/FiatChamp/FiatChampAddon/FiatClient/FiatClient.cs:line 448
   at FiatChamp.FiatClient.LoginAndKeepSessionAlive() in /home/runner/work/FiatChamp/FiatChamp/FiatChampAddon/FiatClient/FiatClient.cs:line 396
   at Program.<>c__DisplayClass0_0.<<<Main>$>b__0>d.MoveNext() in /home/runner/work/FiatChamp/FiatChamp/FiatChampAddon/FiatClient/Program.cs:line 72
[14:27:13 INF] Fetching COMPLETED. Next update in 15 minutes.

(Please ignore the Account Temporarily Locked Out message. :))

Looking at the code I don't see an "else if" branch for Alfa Romeo! Is it possible that it's contacting the wrong server? I'm in North America.

Thank you.

It's working for Stelvio, although some errors are thrown:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 639, in state
    numerical_value = int(value)
                      ^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'null'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 642, in state
    numerical_value = float(value)
                      ^^^^^^^^^^^^
ValueError: could not convert string to float: 'null'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/mqtt/models.py", line 305, in process_write_state_requests
    entity.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 945, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1066, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1003, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 951, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 646, in state
    raise ValueError(
ValueError: Sensor sensor.car_car_vehicleinfo_fuel_distancetoempty_value has device class 'distance', state class 'None' unit 'km' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: 'null' (<class 'str'>)
2024-01-18 19:41:38.387 ERROR (MainThread) [homeassistant.components.mqtt.models] Exception raised when updating state of sensor.car_car_vehicleinfo_tripsinfo_trips_array_0_totalelectricdistance_value, topic: 'homeassistant/sensor/ZARPAHDN5N7D39795_car_vehicleInfo_tripsInfo_trips_array_0_totalElectricDistance_value/state' with payload: b'null'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 639, in state
    numerical_value = int(value)
                      ^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'null'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 642, in state
    numerical_value = float(value)
                      ^^^^^^^^^^^^
ValueError: could not convert string to float: 'null'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/mqtt/models.py", line 305, in process_write_state_requests
    entity.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 945, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1066, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1003, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 951, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 646, in state
    raise ValueError(
ValueError: Sensor sensor.car_car_vehicleinfo_tripsinfo_trips_array_0_totalelectricdistance_value has device class 'distance', state class 'None' unit 'km' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: 'null' (<class 'str'>)
2024-01-18 19:41:38.404 ERROR (MainThread) [homeassistant.components.mqtt.models] Exception raised when updating state of sensor.car_car_vehicleinfo_tripsinfo_trips_array_0_energyused_value, topic: 'homeassistant/sensor/ZARPAHDN5N7D39795_car_vehicleInfo_tripsInfo_trips_array_0_energyUsed_value/state' with payload: b'null'

etc.