Peugeot Citroen DS cars - Connected Car

input_number:
limitador_carga:
name: Límite de carga
initial: 100
min: 70
max: 100
step: 5

shell_command:
cmd_limitador_carga: “curl -s http://XXXXXXXXXX/charge_control?vin=XXXXXXXXXX&percentage={{ ‘%02d’|format(states(‘input_number.limitador_carga’)|int) }}”
cmd_fin_carga: “curl -s http://XXXXXXXXXX/charge_control?vin=XXXXXXXXXX&hour={{ strptime(states(‘input_datetime.fin_carga’), ‘%H:%M:%S’).hour }}&minute={{ strptime(states(‘input_datetime.fin_carga’), ‘%H:%M:%S’).minute }}”

cmd_fin_carga: “curl -s http://XXXXXXXXXX/charge_control?vin=XXXXXXXXXX&hour={{ as_datetime(strptime(state_attr(‘input_datetime.fin_carga’, ‘timestamp’) | timestamp_custom(’%H:%M-+0200’, False), ‘%H:%M-%z’) | as_timestamp | timestamp_utc).hour }}&minute={{ as_datetime(strptime(state_attr(‘input_datetime.fin_carga’, ‘timestamp’) | timestamp_custom(’%H:%M-+0200’, False), ‘%H:%M-%z’) | as_timestamp | timestamp_utc).minute }}”

input_datetime:
fin_carga:
name: Fin de carga
has_date: false
has_time: true

Just install this as an addon and follow the documentation.

Not that way, but with a mix of rest commands and a template switch:

rest_command:
  e208_wakeup:
    url: "http://192.168.181.42:5000/wakeup/VR3UHZKXZMT008152"
  e208_change_threshold:
    url: "http://192.168.181.42:5000/charge_control?vin=VR3UHZKXZMT008152&percentage={{ states('input_number.charge_threshold') | int }}"
  e208_reset_threshold:
    url: "http://192.168.181.42:5000/charge_control?vin=VR3UHZKXZMT008152&percentage=100"
  e208_change_charge_hour:
    url: "http://192.168.181.42:5000/charge_control?vin=VR3UHZKXZMT008152&hour={{ states('input_number.charge_hour') | int }}&minute=0"
  e208_reset_charge_hour:
    url: "http://192.168.181.42:5000/charge_control?vin=VR3UHZKXZMT008152&hour=0&minute=0"
switch:
  - platform: template
    switches:
      e208_change_threshold:
        turn_on:
          service: rest_command.e208_change_threshold
        turn_off:
          service: rest_command.e208_reset_threshold
      e208_change_charge_hour:
        turn_on:
          service: rest_command.e208_change_charge_hour
        turn_off:
          service: rest_command.e208_reset_charge_hour
1 Like

Hi to all

how to change the output for sensor.e2008_charging_time i see PT0S0. is possible remove the PT?

An other sensor sensor.e2008_charging_power i see the output km/h how to convert to kW?

Thanks

I don’t use supervised, it has core in docker

Thanks Daniel, I’ll study it and implement asap! :slight_smile:

Post #57 and #58.
km/h to kW is difficult. I still have no 100% valid solution either. For my car the factor is ~ km/h *0.14 = kW

Yeah, that one isn’t easy to solve, since km/h depends on km/kWh, which is variable (if the weather is cold you’ll get lower km/kWh than if it’s hot).

But, let’s say that the car has calculated that you get 10km on 2,5kWh (4km / kWh), then you can use the formula

[charging power (km/h)] / [estimated km per kWh] = [charging power] , i.e.

12 / 4 = 3

But, as stated earlier [estimated km per kWh] will vary depending on the weather, previous driving pattern, etc.

Another route would be if there’s an integration available for your charge box, that will give you the current kWh? Not working for public charging though…

You’ll have to install it manually. The docker information is provided in the documentation as well. Not as easy as the addon but you should be able to solve it if you know Docker.

I might ask a dumb question here:
but I’ve got the sms and the next field is pin,
where the hell do you get the pin :smiley:

I’ve entered the same one as in the app hoping that’s the good one, but no where on the myopel site do i see a reference to it :slight_smile: it’s just a 4 digit one?
can’t remember ever setting one

Hi
I filled the email address, pasword and the country code at the setup - no SMS…
I get some info:
vin’: ‘correct vin’, ‘vehicle_id’: ‘a bunch of numbers’, ‘label’: ‘e-208’, ‘brand’: ‘Peugeot’, ‘abrp_name’: ‘peugeot:e208:20:50’, ‘battery_power’: 46, ‘fuel_capacity’: 0, ‘max_elec_consumption’: 70, ‘max_fuel_consumption’: 0}"]
but still

  • Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
    So please help me a little… the IP address - the duckdns address:5000 is ok?
    Why no sms?

Hi to all to day this command do not working

http://xxx.xxx.xxx.xxx:5000/charge_control?vin=YOURVIN

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

I have removed and reinstalled PSA Car controller but i have same problem…

Hi to all
I cannot configure PSA Car control, i receive this error
“local variable ‘customer_id’ referenced before assignment”

It happens exactly the same

After
-I updated the aplication,

Psa_controller version 2.4.6 is out

@mamutel Update the app. And what do you plan to do with that account? You need a account in the app. Who told you to make a dev account?

Hi
The PSA controler version is updated.(Current version: v2.5.6 )
I have an account on the MyPeugeot app that is also updated.
Invalid password or PKCS12 data on the app also…
I thought that I need developer account like in the Spotify app…

Nope, you need the same account as the app uses as this addin tries to replicate the app behavior to access a API that is still not open for public. It was promised ages ago, but still they were not able to just hand out some official API documentation and are quite uppish if you try to report some misbehavior to them.

Regarding your login problem. If the app does not login, too then your problem is your account. There was a PKCS12 / passwort error problem in the previous version, but it is fixed and the app works fine again. (Except a lil bug in the Charge Control feature. To fix that you need to chnage the addin options line to: -r --web-conf -c)

Hi
Now I had looged in (thank you for your help) but next fence is harder to pass… NO SMS received - could you help on this one too… please?
After a while without SMS activation it goes -Summary Trips Charge Map Control but no infos available
The http://192.168.181.42:5000 is from your raspbery/HA inside the home network?
I need also to manualy put vin no?
Thank you again