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'
		- energy
		- timed_odometer
		- battery
  - platform: template
        friendly_name: "Battery Voltage"
        unit_of_measurement: "V"
        value_template: '{{ states.sensor.corsa-e.attributes["battery"]["voltage"] * 4 }}'
        friendly_name: "Battery"
        unit_of_measurement: "%"
        value_template: '{{ states.sensor.corsa-e.attributes["energy"][0]["level"] }}'
        friendly_name: "Autonomy"
        unit_of_measurement: "km"
        value_template: '{{ states.sensor.corsa-e.attributes["energy"][0]["autonomy"] }}'
       # Uncomment for miles instead of km
        #friendly_name: "Autonomy"
        #unit_of_measurement: "m"    
        #value_template: "{{ ((state_attr('sensor.corsa-e', 'energy')[0]['autonomy']) / 1.609) | round(0)}}"
        friendly_name: "Charging Status"
        value_template: '{{ states.sensor.corsa-e.attributes["energy"][0]["charging"]["status"] }}'
        #friendly_name: "Mileage"
        #unit_of_measurement: "km"
        #value_template: '{{ states.sensor.corsa-e.attributes["timed_odometer"]["mileage"] }}'
       # Uncomment for miles instead of km
        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'
     - _next_stop_hour
     - percentage_threshold
  - platform: template
        friendly_name: "Next Stop Time"
        value_template: '{{ states.sensor.corsa-e_charge_control.attributes["_next_stop_hour"]}}'
        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:
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