Peugeot Citroen DS cars - Connected Car

Why Website? You register in the MyPeugeot App.

1 Like

Yes i received it.

I have created to https://mypeugeot.peugeot.fr/

Can you try with other phone number or phone’s operator ?

1 Like

I got the mileage sorted. Reinstalled all the dependencies and it works.
However now I’m able to also get the battery voltage and it shows around 84v at 100@ SoC witch is very odd.
Does anybody know the cell configuration series/parallel?
I thought traction battery should be around 400v but even with the *4 as seen in some configurations here that equals to 336v (battery level 100%)

Hi,
I had this working beautifully and then my wife signed in on the app on her phone, disconnecting me and my login details. Fair enough as it is her car! So I tried to reconnect using her credentials, which shows as successful but it’s all messed up



I get a log of charging but no trips and none of the HA sensors are available any more. Any ideas? I’ve tried uninstalling, removing the folder and reinstalling, and nothing seems to get me one set of clean info and i cannot for the life of me find out why the sensors aren’t working

I wonder if PSA will ever let us set the charge load through the API. This would be very useful for Solar PV as it would enable us to automate the load in function of the Solar array production and house consumption load to ensure we charge the car on solar only. Some EVSEs to that automatically, such as the Zappi, but it’d be great to have that functionality even for dumb chargers.

1 Like

Hi
It was finaly working but now after 3 months when I reconect - I had received the SMS in this format
CÜ_+G ò2e¡¤sFNÖ7djM¥RlÆ:e¡LAs& ?bL_
obviously is not what I expected

1 Like

Hiya, I have the same problem as you.
it’s showing empty stats all around, but if I do the curl command or go to the URL, I can see the stats there.
What’s also very weird to me, is that, the stats doesn’t refresh automatically.
To fish it out, I will need to login to the mobile app. Once the mobile app is refreshed, it will then refreshed it as well on the PSA Controller.

Lastly, I’ve installed the PSA Controller via HACS, then followed this guide → GitHub - Flodu31/HomeAssistant-PeugeotIntegration: Integration between Peugeot API and Home Assistant

I’m only seeing 3 items

The guide here says, that I will need to edit the sensor.yaml file within config folder. but when I started all this, the file was never there to begin with, so I created it from scratch and added/tweak as recommended in the guide.

What I’m lost about is, there’s no pointers anywhere for HA or PSA Controller to refer to sensor.yaml. Hence it’s probably why I’m not seeing any of the sensors that I have entered in that file.

Have I missed something here? Would really appreciated if someone can please point me to the right direction. thanks

I figured this out the entities bit. I realised that I need to declare it in configuration.yaml

But I’m still having the issue that it’s showing blank

Does anyone know where this section should be added into?

I’m guessing is under automation, but all that I’ve done seems only to add sensors and not device. Just wondering of how can I then add the car to have an “id”?

Cheers

This is what I did. The ID has NOTHING to do with your car, but the automation. It needs to be unique.

Thanks Daniel, I recently had my HA crashed, had to uninstall PSACC and reinstalled. All seems well with the registration of my account and SMS token etc.
But none of the entities now are available.
and because they’re unavailable, they cannot be removed.
is there a way to remove unavailable entities? these dormant entities are caused by me uninstalling and reinstalling PSACC.
if you can help in any way, that’d be much appreciated. Cheers

Did you remove them off your configuration yaml? If so, go to https://IPOFYOURHA/config/entities and look for the dormant ones, then remove them.

Hi Daniel,

Yes, so here’s the latest update.
When I remove them from configuration yaml, they finally disappeared.
Then I re-installed PSACC again from scratch and put the same config in for the sensors and they’re back but still unavailable.
I’m again able to login and did all the OTP for PSACC without any issue.

Here are all my configs in relation to this

what I have in the configuration.yaml


switch:

  • platform: command_line

    switches:

    e2008_change_threshold:

    command_on: curl -s "http://MYHAIPADDRESS:5000/charge_control?vin=MYVINNUMBER&percentage=80"
    
    command_off: curl -s "http://MYHAIPADDRESS:5000/charge_control?vin=MYVINNUMBER&percentage=100"
    

    e2008_change_charge_hour:

    command_on: curl -s "http://MYHAIPADDRESS:5000/charge_control?vin=MYVINNUMBER&hour=5&minute=0"
    
    command_off: curl -s "http://MYHAIPADDRESS:5000/charge_control?vin=MYVINNUMBER&hour=0&minute=0"
    

    e2008_clim:

    command_on: curl -s "http://MYHAIPADDRESS:5000/preconditioning/MYVINNUMBER/1"
    
    command_off: curl -s "http://MYHAIPADDRESS:5000/preconditioning/MYVINNUMBER/0"
    

e2008 WakeUp

rest_command:

e2008_wakeup:

url: "http://MYHAIPADDRESS:5000/wakeup/MYVINNUMBER"


I then also have a pointer in configuration.yaml to use sensor.yaml

“sensor: !include sensor.yaml”

and here’s what I have within sensor.yaml

Peugeot e2008

  • platform: rest

    name: peugeot_e2008

    resource: http://MYHAIPADDRESS:5000/get_vehicleinfo/MYVINNUMBER?from_cache=1

    scan_interval: 60

    timeout: 30

    value_template: ‘OK’

    json_attributes:

    • energy

    • timed_odometer

    • battery

  • platform: template

    sensors:

    e2008_battery_voltage:

    friendly_name: "Battery Voltage"
    
    unit_of_measurement: "V"
    
    value_template: '{{ states.sensor.peugeot_e2008.attributes["battery"]["voltage"] * 4 }}'
    

    e2008_battery_level:

    friendly_name: "Battery"
    
    unit_of_measurement: "%"
    
    value_template: '{{ states.sensor.peugeot_e2008.attributes["energy"][0]["level"] }}'
    

    #e2008_battery_autonomy:

    #friendly_name: "Autonomy"
    
    #unit_of_measurement: "km"
    
    #value_template: '{{ states.sensor.peugeot_e2008.attributes["energy"][0]["autonomy"] }}'
    

    Uncomment for miles instead of km

    e2008_battery_autonomy:

    friendly_name: "Autonomy"
    
    unit_of_measurement: "m"
    
    value_template: "{{ ((state_attr('sensor.peugeot_e2008', 'energy')[0]['autonomy']) / 1.609) | round(0)}}"
    

    e2008_charging_status:

    friendly_name: "Charging Status"
    
    value_template: '{{ states.sensor.peugeot_e2008.attributes["energy"][0]["charging"]["status"] }}'
    

    #e2008_mileage:

    #friendly_name: "Mileage"
    
    #unit_of_measurement: "km"
    
    #value_template: '{{ states.sensor.peugeot_e2008.attributes["timed_odometer"]["mileage"] }}'
    

    Uncomment for miles instead of km

    e2008_mileage:

    friendly_name: "Mileage"
    
    unit_of_measurement: "m"
    
    value_template: "{{ ((state_attr('sensor.peugeot_e2008', 'timed_odometer')['mileage']) / 1.609) | round(2)}}"
    

Peugeot e2008 charge_control

  • platform: rest

    name: peugeot_e2008_charge_control

    resource: http://MYHAIPADDRESS:5000/charge_control?vin=MYVINNUMBER&?always_check=true

    scan_interval: 60

    timeout: 30

    value_template: ‘OK’

    json_attributes:

    • _next_stop_hour

    • percentage_threshold

  • platform: template

    sensors:

    e2008_stop_hour:

    friendly_name: "Next Stop Time"
    
    value_template: '{{ states.sensor.peugeot_e2008_charge_control.attributes["_next_stop_hour"]}}'
    

    e2008_threshold:

    friendly_name: "Threshold"
    
    unit_of_measurement: "%"
    
    value_template: '{{ states.sensor.peugeot_e2008_charge_control.attributes["percentage_threshold"] }}'
    

Wait…
I’m not sure how, but it’s now working :rofl:

The integration with a 180 hp diesel ds7 works for someone, I have seen that attributes come out but they do not mark anything, thank you all in advance

I have this error
AttributeError: ‘PSACarController’ object has no attribute ‘myp’

Traceback (most recent call last)
File “/usr/lib/python3/dist-packages/flask/app.py”, line 1950, in full_dispatch_request
rv = self.dispatch_request()
File “/usr/lib/python3/dist-packages/flask/app.py”, line 1936, in dispatch_request
return self.view_functionsrule.endpoint
File “/usr/local/lib/python3.9/dist-packages/psa_car_controller/web/view/views.py”, line 146, in get_vehicle_info
response=json.dumps(APP.myp.get_vehicle_info(vin, from_cache).to_dict(), default=str),
AttributeError: ‘PSACarController’ object has no attribute ‘myp’
The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.
To switch between the interactive traceback and the plaintext one, you can click on the “Traceback” headline. From the text traceback you can also create a paste of it.

In the log, this appears:
2022-06-14 14:34:16,743 :: ERROR :: Bad config
2022-06-14 14:34:16,748 :: WARNING :: Can’t get language
2022-06-14 14:34:16,748 :: WARNING :: Can’t get language
2022-06-14 14:34:17,529 :: INFO :: update_data
2022-06-14 14:43:34,239 :: INFO :: Starting analysis on AndroidManifest.xml
2022-06-14 14:43:34,314 :: INFO :: APK file was successfully validated!
2022-06-14 14:43:34,316 :: WARNING :: Requested API level 30 is larger than maximum we have, returning API level 28 instead.
2022-06-14 14:43:44,303 :: INFO :: save config change
2022-06-14 14:43:46,243 :: WARNING :: Can’t get car model, please report an issue on github with your car model and first ten letter of your VIN : XXXXXXX
2022-06-14 14:43:46,244 :: INFO ::
Your vehicles: ["{‘vin’: ‘XXXXXXXXXX’, ‘vehicle_id’: ‘1566c4978536b4e5a5346705654566b314d446b794e54516a497a49785a5455344e5468694e546b784f444d324e6d51324d47513059325269595451324d446c69593255354d4463315a57566d4e7a49325a545268595467314e4441314e6a4a6d4f544e6b5a47493459545134596d4d3d’, ‘label’: ‘CROSSBACK’, ‘brand’: ‘DS’, ‘abrp_name’: None, ‘battery_power’: 46, ‘fuel_capacity’: 0, ‘max_elec_consumption’: 70, ‘max_fuel_consumption’: 30}"]
2022-06-14 14:43:46,245 :: INFO :: save config change
2022-06-14 14:43:46,247 :: WARNING :: Can’t get car model, please report an issue on github with your car model and first ten letter of your VIN : xxxxxxxxx
2022-06-14 14:43:47,371 :: WARNING :: Can’t get car model, please report an issue on github with your car model and first ten letter of your VIN : xxxxxxxxx
2022-06-14 14:43:47,373 :: INFO :: ["{‘vin’: ‘XXXXXXXXX’, ‘vehicle_id’: ‘1566c4978536b4e5a5346705654566b314d446b794e54516a497a49785a5455344e5468694e546b784f444d324e6d51324d47513059325269595451324d446c69593255354d4463315a57566d4e7a49325a545268595467314e4441314e6a4a6d4f544e6b5a47493459545134596d4d3d’, ‘label’: ‘unknown’, ‘brand’: ‘DS’, ‘abrp_name’: None, ‘battery_power’: 46, ‘fuel_capacity’: 0, ‘max_elec_consumption’: 70, ‘max_fuel_consumption’: 30}"]
2022-06-14 14:43:47,375 :: INFO :: save config change

If someone can help me I would be so thankful

Does anyone know the line to add a fuel level sensor for hybrids?

'{{states.sensor.YOURJSONRESPONSE.attributes["energy"][1]["level"]}}'

You have to access the energy object list and select the second entry.

so

'{{states.sensor.YOURJSONRESPONSE.attributes["energy"][0]["level"]}}'

and thank you