Electric power used in a specific time interval

My electricity provider is giving me free power between 9PM and midnight.
Is there an easy way to count the kWh I’ve imported during this time?

I believe you can do this with the Utility Meter integration. Just define a seperate tariff that covers that time period.

I would be interested in having a look at the yaml if you get it to work.