Use data from the Energy dashboard

Hi there dear HA-community,

I would like to use the data from the Energy dashboard in other parts of HA. For example I would like to use the total costs of the previous day to announce it the next day; example: “Yesterday the total cost of electric and gas was xxx.xx. You’ve used xxx kWh on electric and xxx m3 of gas, xxx kWh of energy was generated by the solarpanels”.

Of course I can create my own sensor, but this data is already somewhere in HA.

Duplicate.