Flaping between cached and actual state values
Hi, I am running docker version of psa_car_controller and then I pull info from HomeAssistant. Recently I noted that values are flaping from actual state to some older, probably cached values. This behavior is fooling my automations. Well, how it looks like: psa controller regularly requests updates, every minute or so. Cca every 5th requests (so ca every 5 minutes) are psa controller get some old, probably cached values and then, cca after another five minutes it gets actual values. and this is going and going and flaping and flaping....the attached screeen shots were taken around 2 minutes one from another. The car was disconnected, not being charged and turned off. Just to show you the flaping. It is also happening when car is connected and being charged. Anyonw else observed similar behavior?
One more picture, just to better explain, how this flapping looks like in longer time frame:
Same for me. Not a psacc issue. It’s the same on the stellantis official app.
Hm, really seems like Stellantis issue, not PSACC. Is there anything, we can do about it? IS there way to open ticket and report it to Stellantis. This flaping is ruining my charging automation ):
Same here, but I also noticed the same thing happening in the Peugeot app. Very annoing.
My 2c, they have one of the servers in the loadbalancer acting up. As per IT tradition they should turn them off/on again as a start.
I too got the same problem since the beginning of June. Also preconditioning doesn't work properly anymore since that moment, both with PSACC and the Peugeot app. To add to that, also the odometer is not updating anymore ... after so many years they still don't manage to get it right.
I’m having the same issue! It's super frustrating, I hope they get it sorted out fast. SoC keeps jumping back and the 80% limit is being exceeded because of it!"
My 2c, they have one of the servers in the loadbalancer acting up. As per IT tradition they should turn them off/on again as a start.
Where is this based on? Assumption or did you had contact with Stellantis?
It's a very straightforward explanation of what we're seeing. Your request for the car's status hits one of several load balancers. At least one of them is misconfigured to cache values for far too long, so it returns old data. Next request might go to a correctly configured one, returning the true data again -> Flapping starts. Time passes, even the misconfigured, long cache times out, values normalize to actual value.
The question is how to get this to Stellantis DevOps team instead of getting stuck in customer support.
Its a PSA problem, as you can see the same behaviour in the app. As i use the data to control the loading level of my car (with iobroker) i just made a simple workaround and added a script, that just newer data will be recognized. Works.
Its a PSA problem, as you can see the same behaviour in the app. As i use the data to control the loading level of my car (with iobroker) i just made a simple workaround and added a script, that just newer data will be recognized. Works.
Maybe this could also be integrated into the PSACC?
I'm seeing updates like: "updated_at": "2026-06-29 12:16:16+00:00"
And a few minutes later, I receive another update: "updated_at": "2026-06-29 11:55:48+00:00"
Is there a possibility to ignore these false (older) updates? Maybe we could implement a check that only accepts updates where the "updated_at" timestamp is greater than the currently recorded one. If not, we keep the existing record.
Allthough I admit it should be dealt with server side this could be a work around.
Yep, I put something similar in my template sensors now, only updating if the updated_at is actually newer. At least they give us that.
Yep, I put something similar in my template sensors now, only updating if the updated_at is actually newer. At least they give us that.
Hi, sounds interesting. Could you elaborate a bit more please? What, where and how exactly...? (: Thanks!
@zadow78 I'm using this REST sensor to get the data into Homeassistant at all
- platform: rest
name: peugeot_e208
resource: http://192.168.178.XX:5001/get_vehicleinfo/VRXXXXXXXXX?from_cache=1
scan_interval: 60
timeout: 30
value_template: 'OK'
json_attributes:
- energy
- timed_odometer
And then use template sensors to extract the values I care about. With help of Claude I expanded the templates of these sensors to check the updated_at, so far it seems to work (or Stellantis has fixed it, I can't tell any more :D)
template:
- sensor:
- default_entity_id: sensor.e208_battery_level
name: "SoC"
unit_of_measurement: "%"
device_class: battery
state: >-
{% set new_ts = states.sensor.peugeot_e208.attributes["energy"][0]["updated_at"] %}
{% set old_ts = this.attributes.get("energy_updated_at", "") %}
{% if not old_ts or (new_ts | as_datetime) >= (old_ts | as_datetime) %}
{{ states.sensor.peugeot_e208.attributes["energy"][0]["level"] }}
{% else %}
{{ this.state }}
{% endif %}
attributes:
energy_updated_at: >-
{% set new_ts = states.sensor.peugeot_e208.attributes["energy"][0]["updated_at"] %}
{% set old_ts = this.attributes.get("energy_updated_at", "") %}
{% if not old_ts or (new_ts | as_datetime) >= (old_ts | as_datetime) %}{{ new_ts }}{% else %}{{ old_ts }}{% endif %}
Not pretty, but it works.