Extracting Energy usage data for analysis

The home electricity plan I am on has been discontinued by my provider and I think I will be soon forced to pick between a time-of-use plan that has a variable tariff depending on the time of day, and a flat tariff that costs the same no matter when.

I’ve got all this wonderful historical data that’s been dutifully collected by Home Assistant from my EmonCMS but I’m wondering if there’s a way I can extract hourly power usage data as a CSV.