Is it possible to set a filters parameters using a sensor output?
I want to get a average for a set of temperature readings over a pacific time and display in HA at the end of that time.
I’ve set up a duty_time
platform:
- platform: duty_time
id: total_proof_time
name: Total Proofing Time
The start time is the moment the temperature reaches a set temperature and the end time is when the Proofing switch is turned of. This all works and gives a time span in HA.
To get the average I’m using throttle_average
- platform: template
name: "Oven Average Temperature"
id: oven_temp_average
filters:
throttle_average: !lambda: return id(total_proof_time);
device_class: temperature
state_class: measurement
unit_of_measurement: "°C"
But its not compiling due to the
filters:
throttle_average: !lambda: return id(total_proof_time);
line. I’ve tried so many different options here so beginning to wonder if it’s not possible to do.
ie:
lambda: return id(total_proof_time);
!lambda: "return id(total_proof_time);"
!lambda: return id(total_proof_time).state;
!lambda return id(total_proof_time);