Timebound energy sensor

I have an energy sensor for my air-condition and I have created a utility meter that cuts me the hourly consumption. I would like to view the aggregated consumption over a time bound period like between 23.00 - 06.00, is it possible to configure a sensor to get these values that I can plug into a statistics graph ?

I’m using HA 2023.7 core


Use a utility meter helper with two tariffs. This will create two sensors. Switch tariffs with an automation basted on your required times. One of the tarrif sensors will contain your wanted energy total. The other will contain the remainder.