Trying to configure PSA Car Connection and having issues

I’m currently trying to configure GitHub - Flodu31/HomeAssistant-PeugeotIntegration: Integration between Peugeot API and Home Assistant for my HA but i’m having a few issues.

Firstly the instructions advise adding everything into the config/sensor.yaml which i didn’t have so i’ve created this. However when validating it i’m getting an error.

#Corsa E
  - platform: rest
	 name: corsa-e
	 resource: http://censored:5000/get_vehicleinfo/censored?from_cache=1
	 scan_interval: 60
	 timeout: 30
	 value_template: 'OK'
	 json_attributes:
		- energy
		- timed_odometer
		- battery
		
  - platform: template
    sensors:
      corsa-e_battery_voltage:
        friendly_name: "Battery Voltage"
        unit_of_measurement: "V"
        value_template: '{{ states.sensor.corsa-e.attributes["battery"]["voltage"] * 4 }}'
      corsa-e_battery_level:
        friendly_name: "Battery"
        unit_of_measurement: "%"
        value_template: '{{ states.sensor.corsa-e.attributes["energy"][0]["level"] }}'
      corsa-e_battery_autonomy:
        friendly_name: "Autonomy"
        unit_of_measurement: "km"
        value_template: '{{ states.sensor.corsa-e.attributes["energy"][0]["autonomy"] }}'
       # Uncomment for miles instead of km
       #corsa_battery_autonomy:
        #friendly_name: "Autonomy"
        #unit_of_measurement: "m"    
        #value_template: "{{ ((state_attr('sensor.corsa-e', 'energy')[0]['autonomy']) / 1.609) | round(0)}}"
      corsa-e_charging_status:
        friendly_name: "Charging Status"
        value_template: '{{ states.sensor.corsa-e.attributes["energy"][0]["charging"]["status"] }}'
      #corsa_mileage:
        #friendly_name: "Mileage"
        #unit_of_measurement: "km"
        #value_template: '{{ states.sensor.corsa-e.attributes["timed_odometer"]["mileage"] }}'
       # Uncomment for miles instead of km
       corsa-e_mileage:
        friendly_name: "Mileage"
        unit_of_measurement: "m"
        value_template: "{{ ((state_attr('sensor.corsa-e', 'timed_odometer')['mileage']) / 1.609) | round(2)}}"
# Corsa charge_control
  - platform: rest
    name: corsa-e_charge_control
    resource: http://censored:5000/charge_control?vin=censored&?always_check=true
    scan_interval: 60
    timeout: 30
    value_template: 'OK'
    json_attributes:
     - _next_stop_hour
     - percentage_threshold
  - platform: template
    sensors:
      corsa-e_stop_hour:
        friendly_name: "Next Stop Time"
        value_template: '{{ states.sensor.corsa-e_charge_control.attributes["_next_stop_hour"]}}'
      corsa-e_threshold:
        friendly_name: "Threshold"
        unit_of_measurement: "%"
        value_template: '{{ states.sensor.corsa-e_charge_control.attributes["percentage_threshold"] }}'

The error states;

end of the stream or a document separator is expected (3:3)

1 | #Corsa E
2 | - platform: rest
3 | → name: corsa-e
-------^
4 | → resource: http://192.168.1.7:500
5 | → scan_interval: 60

Also once i resolve this i assume i’m going to have to add to the configuration.yaml a line

sensors = !include sensors.yaml

for it too work. Apprecate anyones help

“name” and the following keywords should be aligned to “platform”, like for “corsa-e_charge_control”

Thanks Koying, i joined the discord group and one of the guys spent the best part of day going through it with me. It’s all up and running now.

Appreciate you coming back to me

Is it still working?

My new integration (BETA version) is available:

(inspired by GitHub - flobz/psa_car_controller: Control psa car with connected_car v4 API.)

Don’t forget to include logs in issue requests.

Many thanks.

@andreadegiovine what would be the added benefit of using your integration above the psa_car_controller one?

I’m looking for a way to get my Citroen EC4 to be able to send commands (like preconditioning) to my car without the need to use the My Citroen App. The reason a command like preconditioning does not always work is because sometimes when you want to activate preconditioning in the citroen app you need to pass in your pincode. I think that flow is not supported in the psa_car_controller version. Is this something that is fixed in your version?