Peugeot Citroen DS cars - Connected Car

I paste here the log, previously with 2.5.1 the data was refreshing fine.

File "/psa_car_controller/web/view/views.py", line 196, in get_charge_control
  charge_control = CONFIG.chc.get(vin)
AttributeError: 'Config' object has no attribute 'chc'
172.30.32.1 - - [22/Oct/2021 15:50:49] "GET /charge_control?vin=XXXXXXXXXXXXXXXXX&?always_check=true HTTP/1.1" 500 -
172.30.32.1 - - [22/Oct/2021 15:51:49] "GET /get_vehicleinfo/XXXXXXXXXXXXXXXXX?from_cache=1 HTTP/1.1" 200 -
2021-10-22 15:51:49,636 :: INFO :: <Request 'http://172.30.33.5:5000/charge_control?vin=XXXXXXXXXXXXXXXXX&%3Falways_check=true' [GET]>
Exception on /charge_control [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2070, in wsgi_app
  response = self.full_dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1515, in full_dispatch_request
  rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1513, in full_dispatch_request
  rv = self.dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1499, in dispatch_request
  return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/psa_car_controller/web/view/views.py", line 196, in get_charge_control
  charge_control = CONFIG.chc.get(vin)
AttributeError: 'Config' object has no attribute 'chc'
172.30.32.1 - - [22/Oct/2021 15:51:49] "GET /charge_control?vin=XXXXXXXXXXXXXXXXX&?always_check=true HTTP/1.1" 500 -
172.30.32.1 - - [22/Oct/2021 15:52:49] "GET /get_vehicleinfo/XXXXXXXXXXXXXXXXX?from_cache=1 HTTP/1.1" 200 -
2021-10-22 15:52:49,638 :: INFO :: <Request 'http://172.30.33.5:5000/charge_control?vin=XXXXXXXXXXXXXXXXX&%3Falways_check=true' [GET]>
Exception on /charge_control [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2070, in wsgi_app
  response = self.full_dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1515, in full_dispatch_request
  rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1513, in full_dispatch_request
  rv = self.dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1499, in dispatch_request
  return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/psa_car_controller/web/view/views.py", line 196, in get_charge_control
  charge_control = CONFIG.chc.get(vin)
AttributeError: 'Config' object has no attribute 'chc'
172.30.32.1 - - [22/Oct/2021 15:52:49] "GET /charge_control?vin=XXXXXXXXXXXXXXXXX&?always_check=true HTTP/1.1" 500 -
172.30.32.1 - - [22/Oct/2021 15:53:49] "GET /get_vehicleinfo/XXXXXXXXXXXXXXXXX?from_cache=1 HTTP/1.1" 200 -
2021-10-22 15:53:49,636 :: INFO :: <Request 'http://172.30.33.5:5000/charge_control?vin=XXXXXXXXXXXXXXXXX&%3Falways_check=true' [GET]>
Exception on /charge_control [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2070, in wsgi_app
  response = self.full_dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1515, in full_dispatch_request
  rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1513, in full_dispatch_request
  rv = self.dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1499, in dispatch_request
  return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/psa_car_controller/web/view/views.py", line 196, in get_charge_control
  charge_control = CONFIG.chc.get(vin)
AttributeError: 'Config' object has no attribute 'chc'
172.30.32.1 - - [22/Oct/2021 15:53:49] "GET /charge_control?vin=XXXXXXXXXXXXXXXXX&?always_check=true HTTP/1.1" 500 -
172.30.32.1 - - [22/Oct/2021 15:54:49] "GET /get_vehicleinfo/XXXXXXXXXXXXXXXXX?from_cache=1 HTTP/1.1" 200 -
2021-10-22 15:54:49,639 :: INFO :: <Request 'http://172.30.33.5:5000/charge_control?vin=XXXXXXXXXXXXXXXXX&%3Falways_check=true' [GET]>
Exception on /charge_control [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2070, in wsgi_app
  response = self.full_dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1515, in full_dispatch_request
  rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1513, in full_dispatch_request
  rv = self.dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1499, in dispatch_request
  return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/psa_car_controller/web/view/views.py", line 196, in get_charge_control
  charge_control = CONFIG.chc.get(vin)
AttributeError: 'Config' object has no attribute 'chc'
172.30.32.1 - - [22/Oct/2021 15:54:49] "GET /charge_control?vin=XXXXXXXXXXXXXXXXX&?always_check=true HTTP/1.1" 500 -
172.30.32.1 - - [22/Oct/2021 15:55:49] "GET /get_vehicleinfo/XXXXXXXXXXXXXXXXX?from_cache=1 HTTP/1.1" 200 -
2021-10-22 15:55:49,641 :: INFO :: <Request 'http://172.30.33.5:5000/charge_control?vin=XXXXXXXXXXXXXXXXX&%3Falways_check=true' [GET]>
Exception on /charge_control [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2070, in wsgi_app
  response = self.full_dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1515, in full_dispatch_request
  rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1513, in full_dispatch_request
  rv = self.dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1499, in dispatch_request
  return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/psa_car_controller/web/view/views.py", line 196, in get_charge_control
  charge_control = CONFIG.chc.get(vin)
AttributeError: 'Config' object has no attribute 'chc'
172.30.32.1 - - [22/Oct/2021 15:55:49] "GET /charge_control?vin=XXXXXXXXXXXXXXXXX&?always_check=true HTTP/1.1" 500 -
172.30.32.1 - - [22/Oct/2021 15:56:49] "GET /get_vehicleinfo/XXXXXXXXXXXXXXXXX?from_cache=1 HTTP/1.1" 200 -
2021-10-22 15:56:49,641 :: INFO :: <Request 'http://172.30.33.5:5000/charge_control?vin=XXXXXXXXXXXXXXXXX&%3Falways_check=true' [GET]>
Exception on /charge_control [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2070, in wsgi_app
  response = self.full_dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1515, in full_dispatch_request
  rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1513, in full_dispatch_request
  rv = self.dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1499, in dispatch_request
  return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/psa_car_controller/web/view/views.py", line 196, in get_charge_control
  charge_control = CONFIG.chc.get(vin)
AttributeError: 'Config' object has no attribute 'chc'
172.30.32.1 - - [22/Oct/2021 15:56:49] "GET /charge_control?vin=XXXXXXXXXXXXXXXXX&?always_check=true HTTP/1.1" 500 -

now I restarted, it updated the data and the log it’s this one (let’s see if it’ll update after the restart):

rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1513, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1499, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/psa_car_controller/web/view/views.py", line 196, in get_charge_control
charge_control = CONFIG.chc.get(vin)
AttributeError: 'Config' object has no attribute 'chc'
172.30.32.1 - - [22/Oct/2021 16:01:51] "GET /charge_control?vin=XXXXXXXXXXXXXXXXX&?always_check=true HTTP/1.1" 500 -
172.30.32.1 - - [22/Oct/2021 16:01:51] "GET / HTTP/1.1" 200 -
172.30.32.1 - - [22/Oct/2021 16:01:52] "GET /assets/clientside.js HTTP/1.1" 304 -
172.30.32.1 - - [22/Oct/2021 16:01:52] "GET /_dash-layout HTTP/1.1" 200 -
172.30.32.1 - - [22/Oct/2021 16:01:52] "GET /_dash-dependencies HTTP/1.1" 200 -
172.30.32.1 - - [22/Oct/2021 16:01:52] "POST /_dash-update-component HTTP/1.1" 200 -
172.30.32.1 - - [22/Oct/2021 16:01:52] "GET /assets/images/consumption.svg HTTP/1.1" 304 -
172.30.32.1 - - [22/Oct/2021 16:01:52] "GET /control?header=false HTTP/1.1" 200 -
172.30.32.1 - - [22/Oct/2021 16:01:52] "GET /assets/images/pollution.svg HTTP/1.1" 304 -
172.30.32.1 - - [22/Oct/2021 16:01:52] "GET /assets/images/battery-charge-line.svg HTTP/1.1" 304 -
172.30.32.1 - - [22/Oct/2021 16:01:52] "GET /assets/images/electricity%20bill.svg HTTP/1.1" 304 -
172.30.32.1 - - [22/Oct/2021 16:01:52] "POST /_dash-update-component HTTP/1.1" 200 -
172.30.32.1 - - [22/Oct/2021 16:01:52] "POST /_dash-update-component HTTP/1.1" 200 -
172.30.32.1 - - [22/Oct/2021 16:01:52] "POST /_dash-update-component HTTP/1.1" 200 -
172.30.32.1 - - [22/Oct/2021 16:01:52] "POST /_dash-update-component HTTP/1.1" 204 -
172.30.32.1 - - [22/Oct/2021 16:01:52] "GET /assets/clientside.js HTTP/1.1" 304 -
172.30.32.1 - - [22/Oct/2021 16:01:53] "POST /_dash-update-component HTTP/1.1" 200 -
172.30.32.1 - - [22/Oct/2021 16:01:53] "POST /_dash-update-component HTTP/1.1" 200 -
172.30.32.1 - - [22/Oct/2021 16:01:53] "POST /_dash-update-component HTTP/1.1" 204 -
172.30.32.1 - - [22/Oct/2021 16:01:53] "GET /style.json HTTP/1.1" 200 -
172.30.32.1 - - [22/Oct/2021 16:01:53] "GET /_dash-layout HTTP/1.1" 200 -
172.30.32.1 - - [22/Oct/2021 16:01:53] "GET /_dash-dependencies HTTP/1.1" 200 -
172.30.32.1 - - [22/Oct/2021 16:01:53] "GET /assets/sprites/osm-liberty@[email protected] HTTP/1.1" 404 -
172.30.32.1 - - [22/Oct/2021 16:01:53] "GET /assets/sprites/osm-liberty@[email protected] HTTP/1.1" 404 -
172.30.32.1 - - [22/Oct/2021 16:01:53] "POST /_dash-update-component HTTP/1.1" 200 -
172.30.32.1 - - [22/Oct/2021 16:01:53] "GET /assets/images/sync.svg HTTP/1.1" 200 -
172.30.32.1 - - [22/Oct/2021 16:01:53] "GET /assets/images/battery-charge.svg HTTP/1.1" 304 -
172.30.32.1 - - [22/Oct/2021 16:01:53] "GET /assets/images/mileage.svg HTTP/1.1" 304 -
172.30.32.1 - - [22/Oct/2021 16:02:49] "GET /get_vehicleinfo/XXXXXXXXXXXXXXXXX?from_cache=1 HTTP/1.1" 200 -
2021-10-22 16:02:49,647 :: INFO :: <Request 'http://172.30.33.5:5000/charge_control?vin=XXXXXXXXXXXXXXXXX&%3Falways_check=true' [GET]>
Exception on /charge_control [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2070, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1515, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1513, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1499, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/psa_car_controller/web/view/views.py", line 196, in get_charge_control
charge_control = CONFIG.chc.get(vin)
AttributeError: 'Config' object has no attribute 'chc'
172.30.32.1 - - [22/Oct/2021 16:02:49] "GET /charge_control?vin=XXXXXXXXXXXXXXXXX&?always_check=true HTTP/1.1" 500 -
172.30.32.1 - - [22/Oct/2021 16:03:49] "GET /get_vehicleinfo/XXXXXXXXXXXXXXXXX?from_cache=1 HTTP/1.1" 200 -
2021-10-22 16:03:49,645 :: INFO :: <Request 'http://172.30.33.5:5000/charge_control?vin=XXXXXXXXXXXXXXXXX&%3Falways_check=true' [GET]>
Exception on /charge_control [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2070, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1515, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1513, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1499, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/psa_car_controller/web/view/views.py", line 196, in get_charge_control
charge_control = CONFIG.chc.get(vin)
AttributeError: 'Config' object has no attribute 'chc'
172.30.32.1 - - [22/Oct/2021 16:03:49] "GET /charge_control?vin=XXXXXXXXXXXXXXXXX&?always_check=true HTTP/1.1" 500 -
172.30.32.1 - - [22/Oct/2021 16:04:49] "GET /get_vehicleinfo/XXXXXXXXXXXXXXXXX?from_cache=1 HTTP/1.1" 200 -
2021-10-22 16:04:49,649 :: INFO :: <Request 'http://172.30.33.5:5000/charge_control?vin=XXXXXXXXXXXXXXXXX&%3Falways_check=true' [GET]>
Exception on /charge_control [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2070, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1515, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1513, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1499, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/psa_car_controller/web/view/views.py", line 196, in get_charge_control
charge_control = CONFIG.chc.get(vin)
AttributeError: 'Config' object has no attribute 'chc'
172.30.32.1 - - [22/Oct/2021 16:04:49] "GET /charge_control?vin=XXXXXXXXXXXXXXXXX&?always_check=true HTTP/1.1" 500 -
172.30.32.1 - - [22/Oct/2021 16:05:49] "GET /get_vehicleinfo/XXXXXXXXXXXXXXXXX?from_cache=1 HTTP/1.1" 200 -
Exception on /charge_control [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2070, in wsgi_app
2021-10-22 16:05:49,651 :: INFO :: <Request 'http://172.30.33.5:5000/charge_control?vin=XXXXXXXXXXXXXXXXX&%3Falways_check=true' [GET]>
172.30.32.1 - - [22/Oct/2021 16:05:49] "GET /charge_control?vin=XXXXXXXXXXXXXXXXX&?always_check=true HTTP/1.1" 500 -
response = self.full_dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1515, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1513, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1499, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/psa_car_controller/web/view/views.py", line 196, in get_charge_control
charge_control = CONFIG.chc.get(vin)
AttributeError: 'Config' object has no attribute 'chc'

If it doesn’t work, an uninstall/reinstall might do the trick. And, don’t forget to do the initial config.

1 Like

done… let’s see :slight_smile:

What are requirements from the car to have this working? Does need to be an electric model or have wifi?

I’ve 2019 model 3008 which syncs trips over Bluetooth to MyPeugeot app. Should this integration work with that?

Short answer : nope. The API on Peugeot’s side is not open for our cars (I have quite the same model, same year : 5008).
The API does not find the car even if the credentials are OK

Do the official Peugeot app find your cars? Then the API should work too.

yep. but we tried with the script original dev and then the API is not (not an electric or “that” recent car)

Sounds like it’s time for a bug report on github then…

Yah it’s maddening. I have the same car too, it would be nice to be able to detect fuel level and mileage even if nothing else worked. On the other hand the MyPeugeot app is so unreliable it probably wouldn’t have been usable anyway. I use a wireless CarPlay dongle in my car and the car is incapable of connecting CarPlay and bluetooth at the same time. So I have to unplug the dongle at the beginning and end of every journey and sit there for a few seconds to allow the MyPeugeot app to connect. I’m never going to remember to do that, that’s barely a step ahead of writing the mileage down on a piece of paper lol. I love the car but it’s got a bunch of weird quirks.

Same with C3 Aircross. Every time I need to check something in the app, last sync was ages ago and that makes the app useless. Also it request for login at least once a month.

I would also love to have some info in HA. I don’t need much detail, just millage and some timestaps for start and end of travels.

I am running version v2.5.4 on Home Assistant OS 6.6
All addon data show perfectly well but I still have trouble getting the right address of IPofTheSoftware.
When starting the addon, the log shows:
Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
When opening the PSA Car Controller Dashboard then new lines are added to the log including:
172.30.32.1 - - [07/Nov/2021 17:45:00] “GET / HTTP/1.1” 200 -
With these IPs still all the additional sensors are unavailable.
Anyone with a solution?

Check the container ip from portainer.

Just go to the configuratiojn of the addin and write Port 5000 in the web interface forwarding and then use the IP of your HA instance.

Thanks a lot!
Indeed enabeling that web interface did the trick.

1 Like

I have same problem, and cannot modify the IP in configuration Tab, when i put the IP after saving the ip was truncate and remaining only the fist octet of IP

That’s not the IP, it’s the port. If you add the port the IP will be the same as HA, local host will work as well.

Hi to all the authentication do not run
ERROR :: Error during activation: {‘newversion’: ‘2.0.0’, ‘newversionurl’: ‘http://m.inwebo.com/’, ‘err’: ‘NOK:FORBIDDEN’}

How is this done, I want to integrate my ds7, although it is diesel, I know that you can get data, thank you very much.

Is it possible to use an helper to input a variable threshold %?
WHat I want to achieve is to be able to have a input value in home assistant where I can input the charge percentage, then switching on the entity charge threshold the car will stop charging on that %.

switches:
      e208_change_threshold:
        command_on: curl -s "http://XXXXX:5000/charge_control?vin=XXXXXXXXXX&percentage=80"

let’s say I create an helper named input.number.percentage_e208 can be changed in something similar (with the correct sintax):

switches:
      e208_change_threshold:
        command_on: curl -s "http://XXXXX:5000/charge_control?vin=XXXXXXXXXX&percentage=[input.number.percentage_e208]"