Hi: I have been using statistics sensor with the below configuration but it didn’t work very well. It generates random spikes around restart (which is a known issue). My goals is simple: I have a helper input_number that captures the lowest electricity price every day, the value is produced once per day between 13-14 (depending on when tomorrow’s el price is known). My goal is to capture the moving average and use the average as a threshold to control charging of my car (basically it provides a cheap signal to the charger):
- platform: statistics
name: Cheap Electricity Prices Past Week
entity_id: input_number.cheapest_electricity_price
state_characteristic: mean
unique_id: electricity_cheap_threshold
sampling_size: 7
# max_age:
# days: 7
Can I do the average with another approach in Home Assistant without using statistics sensor?
Many thanks in advance!