Energy dashboard - service to get data

Hey! I just love the energy dashboard however it’s a pity that the data displayed there can’t be retrieved with scripts. So it would be great to access the stored data so that I could fetch daily / monthly / yearly statistics for any entity (such as solar production, consumption and individual device data).

These data could be used for further calculations and predictions.