the latest version 2023.6.0 has shown warnings in regards to the way that the sensors and switch platform is current being written.
I’ve tried following the guide but can’t seems to get it parse properly. Anyone had any luck in getting this through?
if yes, can I please see how you’ve done it? Cheers
But with 0.0.0.0 i didn’t get nor date with vehicleinfo.
The problem shoud be the template error (but why, other user have no problem):
Logger: homeassistant.helpers.template_entity
Source: helpers/template_entity.py:422
First occurred: 22:36:38 (35 occurrences)
Last logged: 23:13:21
TemplateError(‘UndefinedError: ‘None’ has no attribute ‘attributes’’) while processing template ‘Template<template=({{ states.sensor.peugeot_e2008.attributes[“energy”][0][“autonomy”] }}) renders=4>’ for attribute ‘_attr_native_value’ in entity ‘sensor.e2008_battery_autonomy’
TemplateError(‘UndefinedError: ‘None’ has no attribute ‘attributes’’) while processing template ‘Template<template=({{ states.sensor.peugeot_e2008.attributes[“energy”][0][“charging”][“status”] }}) renders=4>’ for attribute ‘_attr_native_value’ in entity ‘sensor.e2008_charging_status’
TemplateError(‘UndefinedError: ‘None’ has no attribute ‘attributes’’) while processing template ‘Template<template=({{ states.sensor.peugeot_e2008.attributes[“timed_odometer”][“mileage”] }}) renders=4>’ for attribute ‘_attr_native_value’ in entity ‘sensor.e2008_mileage’
TemplateError(‘UndefinedError: ‘None’ has no attribute ‘attributes’’) while processing template ‘Template<template=({{ states.sensor.peugeot_e2008_charge_control.attributes["_next_stop_hour"]}}) renders=4>’ for attribute ‘_attr_native_value’ in entity ‘sensor.e2008_stop_hour’
TemplateError(‘UndefinedError: ‘None’ has no attribute ‘attributes’’) while processing template ‘Template<template=({{ states.sensor.peugeot_e2008_charge_control.attributes[“percentage_threshold”] }}) renders=4>’ for attribute ‘_attr_native_value’ in entity ‘sensor.e2008_threshold’
Try to replace 0.0.0.0 with the actual IP address of the machine it’s running on.
Do you get a sensor from the rest platform you set up? This is my config (note that I’m running the add-on on port 5001 and I’m pulling some additional attributes):
But I didn’t have the sensor “peugot_2008”!!! Why?
In the Browser I get Data with get_vehicleinformation!
The differenz between your Coding and my (and the coding of Flodu31) is, i have no line “sensor 2008:”
Do you have your coding in sensor.yaml or configuration.yaml?
In the sensor.yaml it is not possible for to insert this line. So I insert only this sensor in the configuration.yaml. That works!
Than I inserted all sensor in the configuration.yaml, it works!
But I did not want to insert all sensor in the configuration.yaml. What was your way?
Later I see, with the inserting all sensors in configuration.yaml I did not get any errors, but no sensor was generated!?
What is the way you assign the attributes of your 208-Sensor to the single sensor eg batery_level?
I have everything in configuration.yaml with no sensor.yaml, so I don’t know why it works in one place but not the other. But it’s good that it’s working now.
I noticed that PSA Car Controller now (sometimes) include the location of the car, this can be added to HA if you add last_position in the list under json_attributes in the main sensor, then add a sensor like this (it can also be condensed into the automation, but I like to have the “raw” output):
e208_last_position:
friendly_name: "e208 Last Position Coordinates"
value_template: '{{ states.sensor.peugeot_e208.attributes["last_position"]["geometry"]["coordinates"] }}'
And then create an automation that updates a device tracker with the location every minute:
Hey
yesterday night was i able to solve the problem. The problem, i moved the code of sensor.yaml to configuration.yaml. So I had 2x rest and 2x template, but without errors.
It works, thank you verry much!
Your sensor I will look again.
And your solution with the device tracker is interesting. which one do you use?
I only just implementet the device tracker, so currently I’m only seeing the inaccuracy of the GPS (I hope…), but it’s showing up nicely on a map and it looks like it’s updating very frequently:
Hey, I am using the home assistant add-on and I don’t know exactly which IP should I use… since it’s a docker container I imagine localhost won’t work, neither my Raspberry Pi local IP right? Should I use the IP it shows in the logs when I launch the add-on? Mine says:
2023-08-04 22:59:22,035 :: INFO :: update_data
2023-08-04 22:59:24,307 :: INFO :: * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
I use the hostname. So when you open PSA Controller addon page and you see all the toggles “start on boot”, “watchdog”, etc. In the same place, you’ll see also hostname field. That’s the value I use plus the :5000 port.
yeah, you need the official app to keep the connection to the car (the car will dropp the connection if the it drives for a while without being connected to your phone).
I got some location info on the 21st. of July, then nothing and the consistantly since the 27th. of July.
Is possible to activate a preconditioning program using this API?
So if I have schedule for 8am, I would like to be able active/deactivate it. In summer time using HA to trigger the preconditioning on/off is not much of an issue, but I’m more thinking about the winter where I assume the outside temperature plays more a role in the preconditioning duration.