Statistics of a filtered value does not appear to work

This is driving me somewhat crazy… I’m assuming its some kind of mistake on my side, but I cannot figure it out. I have the following goal:

Template: I calculate my home’s actual consumption based on meter and solar production.
Filter: Then I filter it to remove peaks and limit the range
Statistics: Then, I want to take the minimum of this value for a further calculation, however it shows “unavailable”.

However, if I skip the filter and feed the home_power_consumption value directly into the statistics, it works with no issues.

Both the consumption and consumption filtered sensors are showing values as per screenshot above.

And the code itself, which is in a YAML package file.

# # # # # # # Sensors # # # # # # #
sensor:

      # # # # # #     Filters      # # # # # #  

  - platform: filter
    name: "EnergyMgmt - Home Power - Consumption - Filtered"
    unique_id: "sensor.energymgmt_home_power_filtered"
    entity_id: sensor.energymgmt_home_power_consumption
    filters:
      - filter: lowpass
        time_constant: 2
        precision: 2
      - filter: lowpass
        time_constant: 2
        precision: 2
      - filter: range
        upper_bound: 850
        lower_bound: 50
        



      # # # # # #     Statistics      # # # # # #  

  - platform: statistics
    name: "EnergyMgmt - Home Power - Consumption - Filtered - Min"
    unique_id: energymgmt_home_power_consumption_filtered_min
    entity_id: sensor.energymgmt_home_power_filtered
    state_characteristic: value_min
    max_age:
      minutes: 3

Does anyone else get this to work?

Your filtered entity you have referred to as both sensor.energymgmt_home_power_filtered and sensor.energymgmt_home_power_consumption_filtered

Make sure you have the right ID.

@karwosts Thank you for the quick and professional reply. That was indeed my issue, assuming the unique_id would be used instead of the (snake_cased?) name… and of course, having them different in the firstplace. Looks like I have a lot to learn still.
Cheers!

Many people use a UUID generator (there are many websites, just google for one) to populate the unique_id field. The only requirement for the field is that it is unique. Using the name of the sensor or the entity ID will only mislead you to think it is used for something else. And inevitably when you change a sensor name or entity ID, you can’t change the Unique ID along with it, so now it becomes really confusing.