Peugeot Citroen DS cars - Connected Car

thanks, so it is a common problem from the API output. Hope for a fix then

Hi
How did you get the fuel level. On my hybrid 508 the fuel level is not displayed in the MyPeugeot API and it seems there is no sensor for it in sensor.yaml

And the Autonomy only shows of course the value relative to the electric part. Is is possible to display the whole Autonomy also with gas tank?

To anyone with the same problem, finallly managed to solve it:

name: E-C4 was unusuable. Changed it to EC4, so the sensors were need to be changed to sensor.EC4.attributes, etc…

Then everithing started to work.

2 Likes

reply to myself maybe helpful for others, just enough to put energy=1 to display benzine autonomy

508_fuel_autonomy:
friendly_name: “Autonomy Benzin”
unit_of_measurement: “km”
value_template: ‘{{ states.sensor.peugeot_508.attributes[“energy”][1][“autonomy”] }}’

But I could not find the way to check the open closed doors and windows, and if there is a way to open and close them from remote. Is it possible?

1 Like

Did you guys get a text back from the OTP set up on the web ui ? I have tried multipul times, get the Sms sent banner in light green but no text arrives, and I have no data to show on the MY car info screen.

you have to download the mypeugeot app, register an account, put the mobile number, VIN verifiy it with the code they send and so on. After that you start the configuration on home assistant and you will receive the code

Yes I have the app side up and running ok, its just the webUI OTP config that I dont get a code and pin ??

PSA addon has own separate container and you can’t access it using HA file editor.

To see config.ini you have to install SSH & Web terminal addon.
In Terminal view type: docker ps
It will show you all the running containers.

For example my PSA container looks like this:
64d88cde50b7 flobz/psa_car_controller:v3.0.6

To enter this container you type: docker exec -it 64d88cde50b7 sh (use your own container id)
Then to find config.ini follow this:
cd ..
cd data
ls
Now you should see files and config.ini
To read your config.ini type: cat config.ini
To see inside config.json type: cat config.json

But as Daniel_Reimer said be careful what you do. I changed the khw price using “” which broke the config.ini and I couldn’t start PSA addon anymore. The only solution was to reinstall PSA addon again. And cat is quite primitive editor so you have to re-write the file instead of modifying it.

1 Like

Hello @Daniel_Reimer , thank you for the great contribution in this forum!
I got an e-208 but I wonder what to do as I do not have a PSA account because Peugeot doesn’t allow the app in Brazil, it is not available for download :sob:

I am afraid that even if I bypass it with some VPN and download the app, the car might not have eSim connectivity. However, the multimedia panel does have the possibility to connect with the local wi-fi so it can be part of my home network.

Could you or anyone, give me some guidance? I really don’t know what to do now, but it really need this :yum:

No clue if this works, but just load the APK: MYPEUGEOT APP 1.37.3 APK Download by Peugeot Automobiles - APKMirror

Otherwise there is nothing we can do for you. If the car does not connect anywhere, you are out of luck.

Thank you very much, I will try it soon when the world cup game mode = off. :yum:

Hi,
I have peugeot 308 sw 2015. I’m using MyPeugeot app from google app store. I’m trying to set up PSA Car Controller addon. For config I used my e mail address and password for connecting to the app. For country code I used hr-HR as I saw that this is in the link when I’m registering to the app. In addon I have this log:

2022-12-02 14:54:47,663 :: INFO :: 172.30.32.1 - - [02/Dec/2022 14:54:47] "e[37mPOST /_dash-update-component HTTP/1.1e[0m" 200 -
2022-12-02 14:57:53,498 :: INFO :: Starting analysis on AndroidManifest.xml
2022-12-02 14:57:53,500 :: INFO :: Namespace mapping (60, 420) already seen! This is usually not a problem but could indicate packers or broken AXML compilers.
2022-12-02 14:57:53,501 :: INFO :: Namespace mapping (60, 420) already seen! This is usually not a problem but could indicate packers or broken AXML compilers.
2022-12-02 14:57:53,502 :: INFO :: Namespace mapping (60, 420) already seen! This is usually not a problem but could indicate packers or broken AXML compilers.
2022-12-02 14:57:53,503 :: INFO :: Namespace mapping (60, 420) already seen! This is usually not a problem but could indicate packers or broken AXML compilers.
2022-12-02 14:57:53,503 :: INFO :: Namespace mapping (60, 420) already seen! This is usually not a problem but could indicate packers or broken AXML compilers.
2022-12-02 14:57:53,504 :: INFO :: Namespace mapping (60, 420) already seen! This is usually not a problem but could indicate packers or broken AXML compilers.
2022-12-02 14:57:53,509 :: INFO :: Namespace mapping (60, 420) already seen! This is usually not a problem but could indicate packers or broken AXML compilers.
2022-12-02 14:57:53,509 :: INFO :: Namespace mapping (60, 420) already seen! This is usually not a problem but could indicate packers or broken AXML compilers.
2022-12-02 14:57:53,510 :: INFO :: Namespace mapping (60, 420) already seen! This is usually not a problem but could indicate packers or broken AXML compilers.
2022-12-02 14:57:53,510 :: INFO :: Namespace mapping (60, 420) already seen! This is usually not a problem but could indicate packers or broken AXML compilers.
2022-12-02 14:57:53,541 :: INFO :: APK file was successfully validated!
2022-12-02 14:57:53,541 :: WARNING :: Requested API level 31 is larger than maximum we have, returning API level 28 instead.
2022-12-02 14:57:56,547 :: ERROR :: 'hr-HR'
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/config_views.py", line 133, in connectPSA
res = firstLaunchConfig(app_name, email, password, countrycode)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 31, in firstLaunchConfig
apk_parser = get_content_from_apk(filename, country_code)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 24, in get_content_from_apk
apk_parser.retrieve_content_from_apk()
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/apk_parser.py", line 36, in retrieve_content_from_apk
self.culture = self.__get_cultures_code(a.get_file("res/raw/cultures.json"), self.country_code)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/apk_parser.py", line 25, in __get_cultures_code
return cultures[country_code]["languages"][0]
KeyError: 'hr-HR'
2022-12-02 14:57:56,688 :: INFO :: 172.30.32.1 - - [02/Dec/2022 14:57:56] "e[37mPOST /_dash-update-component HTTP/1.1e[0m" 200 -
2022-12-02 15:02:27,957 :: INFO :: Starting analysis on AndroidManifest.xml
2022-12-02 15:02:27,959 :: INFO :: Namespace mapping (60, 420) already seen! This is usually not a problem but could indicate packers or broken AXML compilers.
2022-12-02 15:02:27,960 :: INFO :: Namespace mapping (60, 420) already seen! This is usually not a problem but could indicate packers or broken AXML compilers.
2022-12-02 15:02:27,961 :: INFO :: Namespace mapping (60, 420) already seen! This is usually not a problem but could indicate packers or broken AXML compilers.
2022-12-02 15:02:27,962 :: INFO :: Namespace mapping (60, 420) already seen! This is usually not a problem but could indicate packers or broken AXML compilers.
2022-12-02 15:02:27,963 :: INFO :: Namespace mapping (60, 420) already seen! This is usually not a problem but could indicate packers or broken AXML compilers.
2022-12-02 15:02:27,963 :: INFO :: Namespace mapping (60, 420) already seen! This is usually not a problem but could indicate packers or broken AXML compilers.
2022-12-02 15:02:27,968 :: INFO :: Namespace mapping (60, 420) already seen! This is usually not a problem but could indicate packers or broken AXML compilers.
2022-12-02 15:02:27,969 :: INFO :: Namespace mapping (60, 420) already seen! This is usually not a problem but could indicate packers or broken AXML compilers.
2022-12-02 15:02:27,969 :: INFO :: Namespace mapping (60, 420) already seen! This is usually not a problem but could indicate packers or broken AXML compilers.
2022-12-02 15:02:27,970 :: INFO :: Namespace mapping (60, 420) already seen! This is usually not a problem but could indicate packers or broken AXML compilers.
2022-12-02 15:02:28,011 :: INFO :: APK file was successfully validated!
2022-12-02 15:02:28,011 :: WARNING :: Requested API level 31 is larger than maximum we have, returning API level 28 instead.
2022-12-02 15:02:31,348 :: ERROR :: 'hr-HR'
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/config_views.py", line 133, in connectPSA
res = firstLaunchConfig(app_name, email, password, countrycode)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 31, in firstLaunchConfig
apk_parser = get_content_from_apk(filename, country_code)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/app_decoder.py", line 24, in get_content_from_apk
apk_parser.retrieve_content_from_apk()
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/apk_parser.py", line 36, in retrieve_content_from_apk
self.culture = self.__get_cultures_code(a.get_file("res/raw/cultures.json"), self.country_code)
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/setup/apk_parser.py", line 25, in __get_cultures_code
return cultures[country_code]["languages"][0]
KeyError: 'hr-HR'
2022-12-02 15:02:31,473 :: INFO :: 172.30.32.1 - - [02/Dec/2022 15:02:31] "e[37mPOST /_dash-update-component HTTP/1.1e[0m" 200 -
2022-12-02 15:02:42,675 :: INFO :: 172.30.32.1 - - [02/Dec/2022 15:02:42] "e[37mPOST /_dash-update-component HTTP/1.1e[0m" 200 -
2022-12-02 15:02:58,317 :: ERROR :: get_vehicles:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psacc/application/psa_client.py", line 137, in get_vehicles
res = self.api().get_vehicles_by_device()
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api/vehicles_api.py", line 1331, in get_vehicles_by_device
(data) = self.get_vehicles_by_device_with_http_info(**kwargs) # noqa: E501
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api/vehicles_api.py", line 1400, in get_vehicles_by_device_with_http_info
return self.api_client.call_api(
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/oauth.py", line 96, in call_api
raise e
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/oauth.py", line 78, in call_api
return self._ApiClient__call_api(resource_path, method,
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 157, in __call_api
response_data = self.request(
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/api_client.py", line 347, in request
return self.rest_client.GET(url,
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/rest.py", line 234, in GET
return self.request("GET", url,
File "/usr/local/lib/python3.9/dist-packages/psa_car_controller/psa/connected_car_api/rest.py", line 228, in request
raise ApiException(http_resp=r)
psa_car_controller.psa.connected_car_api.rest.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'X-Backside-Transport': 'FAIL FAIL', 'Connection': 'close', 'Cache-Control': 'no-store, no-cache, must-revalidate, private', 'Content-Type': 'application/hal+json', 'Date': 'Fri, 02 Dec 2022 14:02:58 GMT', 'Expires': '0', 'X-Global-Transaction-ID': '08f333a5638a0592863c0aff', 'Access-Control-Expose-Headers': 'APIm-Debug-Trans-Id, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Global-Transaction-ID', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET', 'Set-Cookie': 'rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Thu, 01-Dec-2022 14:02:58 GMT, JSESSIONID=zJeacAsVafyqaZQaJJC4tO0TN_KceHFsA0nNQdDA; path=/, PSACountry=AT; Domain=.groupe-psa.com; Path=/'})
HTTP response body: {"uuid":"f7d5ccea-f975-4657-83a7-48cc10add69e","code":40410,"message":"No vehicule found"}

2022-12-02 15:02:58,325 :: INFO :: []
2022-12-02 15:02:58,326 :: INFO :: save config change
2022-12-02 15:02:58,328 :: WARNING :: Can't get language
2022-12-02 15:02:58,328 :: WARNING :: Can't get language
2022-12-02 15:02:58,949 :: INFO :: update_data
2022-12-02 15:02:58,951 :: INFO :: * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
2022-12-02 15:03:37,144 :: INFO :: 172.30.32.1 - - [02/Dec/2022 15:03:37] "e[37mGET / HTTP/1.1e[0m" 200 -
2022-12-02 15:03:37,437 :: INFO :: 172.30.32.1 - - [02/Dec/2022 15:03:37] "e[37mGET /_dash-layout HTTP/1.1e[0m" 200 -
2022-12-02 15:03:37,439 :: INFO :: 172.30.32.1 - - [02/Dec/2022 15:03:37] "e[37mGET /_dash-dependencies HTTP/1.1e[0m" 200 -
2022-12-02 15:03:37,499 :: WARNING :: Failed to generate figure, there is probably not enough data yet
2022-12-02 15:03:37,502 :: INFO :: 172.30.32.1 - - [02/Dec/2022 15:03:37] "e[37mPOST /_dash-update-component HTTP/1.1e[0m" 200 -
2022-12-02 15:03:42,938 :: INFO :: 172.30.32.1 - - [02/Dec/2022 15:03:42] "e[37mPOST /_dash-update-component HTTP/1.1e[0m" 200 -
2022-12-02 15:03:43,089 :: INFO :: 172.30.32.1 - - [02/Dec/2022 15:03:43] "e[37mPOST /_dash-update-component HTTP/1.1e[0m" 200 -
2022-12-02 15:03:43,093 :: INFO :: 172.30.32.1 - - [02/Dec/2022 15:03:43] "e[37mPOST /_dash-update-component HTTP/1.1e[0m" 204 -
2022-12-02 15:03:43,097 :: INFO :: 172.30.32.1 - - [02/Dec/2022 15:03:43] "e[37mPOST /_dash-update-component HTTP/1.1e[0m" 204 -
2022-12-02 15:07:22,010 :: INFO :: 172.30.32.1 - - [02/Dec/2022 15:07:22] "e[37mPOST /_dash-update-component HTTP/1.1e[0m" 200 -
2022-12-02 15:08:27,522 :: INFO :: 172.30.32.1 - - [02/Dec/2022 15:08:27] "e[37mPOST /_dash-update-component HTTP/1.1e[0m" 200 -
2022-12-02 15:08:27,699 :: INFO :: 172.30.32.1 - - [02/Dec/2022 15:08:27] "e[37mPOST /_dash-update-component HTTP/1.1e[0m" 204 -
2022-12-02 15:08:27,703 :: INFO :: 172.30.32.1 - - [02/Dec/2022 15:08:27] "e[37mPOST /_dash-update-component HTTP/1.1e[0m" 200 -
2022-12-02 15:08:27,708 :: INFO :: 172.30.32.1 - - [02/Dec/2022 15:08:27] "e[37mPOST /_dash-update-component HTTP/1.1e[0m" 204 -
2022-12-02 18:12:36,692 :: INFO :: 172.30.32.1 - - [02/Dec/2022 18:12:36] "e[37mGET / HTTP/1.1e[0m" 200 -
2022-12-02 18:12:37,050 :: INFO :: 172.30.32.1 - - [02/Dec/2022 18:12:37] "e[37mGET /_dash-layout HTTP/1.1e[0m" 200 -
2022-12-02 18:12:37,054 :: INFO :: 172.30.32.1 - - [02/Dec/2022 18:12:37] "e[37mGET /_dash-dependencies HTTP/1.1e[0m" 200 -
2022-12-02 18:12:37,134 :: INFO :: 172.30.32.1 - - [02/Dec/2022 18:12:37] "e[37mPOST /_dash-update-component HTTP/1.1e[0m" 200 -

It’s seems to me that this addon doesn’t work in my case. Any suggestions?

Never saw a country code longer than two letters in this case here. Maybe just try HR?

I tried HR, for addon config I use

PSACC_OPTIONS: "-r --web-conf -c --remote-disable"

because I don’t have remote controlled car, but still no luck.
I log I have this

HTTP response headers: HTTPHeaderDict({'X-Backside-Transport': 'FAIL FAIL', 'Connection': 'close',
'Cache-Control': 'no-store, no-cache, must-revalidate, private', 'Content-Type': 'application/hal+json',
'Date': 'Sat, 03 Dec 2022 06:59:42 GMT', 'Expires': '0', 'X-Global-Transaction-ID':
'08f333a5638af4089561a56f', 'Access-Control-Expose-Headers': 'APIm-Debug-Trans-Id, 
X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Global-Transaction-ID', 
'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET', 'Set-Cookie': 'rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Fri, 02-Dec-2022 06:59:42 GMT,
JSESSIONID=ITBah-c6shJA2MQ4SGw3lbDu2BWCHwbzmXWoAGEQ; path=/, 
PSACountry=AT; Domain=.groupe-psa.com; Path=/'})
HTTP response body: {"uuid":"some_uid","code":some_code"message":"No vehicule found"}

Seems to be worth a question on flobz’ Github. No clue why this does not work. Alpha-2 code of Croatia is HR. Maybe the Alpha-3 one? HRV? Otherwise you should go and ask over there maybe.

It should be HR, because when I use HR I get this

Screenshot from 2022-12-03 15-05-16

Hi,

Can anybody point me into direction how to use this command in an automation:
command_on: curl -s “http://[IP]:5000/preconditioning/[VIN]/1”

Thanks

  - platform: command_line
    switches:
      e208_clim:
        unique_id: e208_clim
        command_on: curl -s "http://192.168.181.42:5000/preconditioning/VR3UHZKXZMT008152/1"
        command_off: curl -s "http://192.168.181.42:5000/preconditioning/VR3UHZKXZMT008152/0"

And in Automation

  action:
  - service: homeassistant.turn_on
    entity_id: switch.e208_clim

or turn_off as you wish.

1 Like

Hi all,

I’ve spent the past few days working through setting up Home Assistant, installing the various add-ons etc. needed to get the PSA car add-on working. Wow, what a steep learning curve :smiley:

I think I’m nearly there, the only issue I think I have now is that Remote Control is not available in here in New Zealand, so I’m running into the SMS/OTP issue previously mentioned.

I have entered “–remote-disable” into the config of the add-on, is this the correct format?

When I put http://yourIP:5000/get_vehicleinfo/yourVIN (with my HA IP and VIN # of course) into a browser
image


The “401: Unauthorized” has me thinking the remote-disable either isn’t correctly entered or isn’t working.

Thanks in advance :slight_smile: