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