Invalid config for [sensor.statistics]: required key not provided @ data['state_characteristic']. Got None. (See ?, line ?)

Hi,
since yesterday my Home Assistant Instance show me this error:

Invalid config for [sensor.statistics]: required key not provided @ data['state_characteristic']. Got None. (See ?, line ?).
Invalid config for [sensor.statistics]: required key not provided @ data['state_characteristic']. Got None. (See ?, line ?).
Invalid config for [sensor.statistics]: required key not provided @ data['state_characteristic']. Got None. (See ?, line ?).
Invalid config for [sensor.statistics]: required key not provided @ data['state_characteristic']. Got None. (See ?, line ?).
Invalid config for [sensor.statistics]: required key not provided @ data['state_characteristic']. Got None. (See ?, line ?).
Invalid config for [sensor.statistics]: required key not provided @ data['state_characteristic']. Got None. (See ?, line ?).
Invalid config for [sensor.statistics]: required key not provided @ data['state_characteristic']. Got None. (See ?, line ?).
Invalid config for [sensor.statistics]: required key not provided @ data['state_characteristic']. Got None. (See ?, line ?).
Invalid config for [sensor.statistics]: required key not provided @ data['state_characteristic']. Got None. (See ?, line ?).
Invalid config for [sensor.statistics]: required key not provided @ data['state_characteristic']. Got None. (See ?, line ?).
Invalid config for [sensor.statistics]: required key not provided @ data['state_characteristic']. Got None. (See ?, line ?).
Invalid config for [sensor.statistics]: required key not provided @ data['state_characteristic']. Got None. (See ?, line ?).
Invalid config for [sensor.statistics]: required key not provided @ data['state_characteristic']. Got None. (See ?, line ?).
Invalid config for [sensor.statistics]: required key not provided @ data['state_characteristic']. Got None. (See ?, line ?).

Did anyone have an idea to solve this.
I’ve deletet all statistic entities with problems.

Thanks

Have the same error…
See for the solution:
https://community.home-assistant.io/t/the-entity-id-option-is-deprecated-please-remove-it-from-your-configuration/227764
But it’s a complicated one…

I have:

# Overige statistieken in utility.yaml
  - platform: statistics
    name: Ford km stats
    entity_id: sensor.fordpass_odometer
    sampling_size: 20

But don’t know how to solve this.

Hi,

I had the same error now after the latest OS update. (OS 9.4)
It seems that the statistics sensor now requires a state characteristic to be defined.
Check out the documentation for more options, Statistics

Here is an example of a statistics sensor with state_characteristic: mean added.

  - platform: statistics
    name: "Power_Battery_SOC_Stats"
    entity_id: sensor.Power_Battery_SOC
    precision: 1
    state_characteristic: mean
    sampling_size: 5
    max_age:
    minutes: 20    

Adding state_characteristic: mean, solved this issue for me.

5 Likes

thanks, that work for me