Restore averages upon reboot. Or other solution maybe?

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

Still under question. For now i can see the only possibility to set
initial_state: False for the automations in question and then write up the rules which will switch them back on after sensor gets populated. But there must be a better way