Have rules for my kitchen hood. They take humidity and gas levels to detect when someone is cooking.
Ti make things work had to use the statistics sensors taking the previous average readings
So in the rules i have something like
condition:
- condition: template
value_template: '{{ states.sensor.gas.state | int - states.sensor.gas_avg_mean.state |int > 15}}'
The problem is - as the statistics sensor is not populated upon restart i have a rule fyring up. So wonder how can this be solved