As you know HA provides built in integrator for those, who need to derrive an integral of some value for some purpose. However I cannot figure out how to set integration limits using this thing. No matter what I do it starts integrating fom now to infinity. Let start with zero approximation code to understand the direction to advance to, here is an example:

- platform: integration
source: sensor.engineering_filtered_temp_gas_heater_1
name: engineering_filtered_temp_integral_gas_heater_1
unit_time: min

does anyone know what needs to be done to tell this thing to start integrate at T1 and stop at T2?

It’s used to convert power to energy sensors (or flow to volume, etc…). If you want a fixed period of time to record the energy then feed it to a utility meter with the required cycle length (15m to yearly):

Actually, I need to integrate with arbitrary interval into the history to determiny the minimal state of the ‘action’ as it would give the optimal set of parameters for heat production to consume smallest amount of fuel (gas). Thus fixed interval is not quet what I need…