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?