Statistics sensor and 2021.12.0

After upgade statistic sensor don’t show Characteristics (median, and so on )
only age_coverage_ratio and buffer_usage_ratio
in log i see error
[homeassistant.components.statistics.sensor] sensor.set_temp_stable_statistic: parsing error, expected number and received None

Have anybody idia how to fix it?
In 2021.11.5 i have same error in log but sensor show attributes
sensor updated as in documentation

- platform: statistics
  name: i_error_vent_stat
  entity_id: sensor.error_vent_nas
  sampling_size: 100
  state_characteristic: mean  
  max_age:
    minutes: 72

Same for me…

  - platform: statistics
    entity_id: sensor.oregon_thermometer
    name: stats_temperature_exerieur
    state_characteristic: mean
    sampling_size: 2000
    max_age:
      hours: 24

It has been reported:

Reading the Github issue, it appears that it’s not a bug rather its a deliberate change

Given it was an internal integration (not driven by an external API or connection), its a little sad that the change has been made without any warning (given it was a breaking change) or depreciation.

Hey all,
the change was an intended breaking change and was accidentally missed in the initial release notes. That’s fixed now. 2021.12: New configuration menu, the button entity, and gorgeous area cards! - Home Assistant

See documentation for all changes and a bunch of new features. If you have ideas for further characteristics and improvements, please do not hesitate to contact me.

2 Likes

according to statistics documentation, the state characteristics value_min/max should be present. But are not. How do I get now min/max temperature value in last 24hours?

This is an example from my configuration.yaml to get minimum temperature:

sensor:
  - platform: statistics
    name: Outdoor Temperature Minimum 24H
    entity_id: sensor.xxxx_temperature
    state_characteristic: value_min
    max_age:
      hours: 24
    sampling_size: 35

Then make a separate sensor for max temp.

2 Likes

thank you, it works now again

1 Like