Can I extract data from the Energy dashboard?

In my Energy dashboard, I get the daily cost of running my electric radiators:

Great. But it’s in the Energy dashboard and I’d like to display it on another dashboard (next to the thermostats), ideally displaying today’s and yesterday’s values.

Can I get that number from the Energy dashboard? Or do I need to create a power meter and whatnot (I’m sorry, the operation of this side of HA isn’t clear to met at the moment) to do the math a second time?

So HA does create a sensor for the cost column, but it’s not automatically a “daily” sensor. It just accumulates and if you want it reset regularly you’ll need to pass it through a utility meter.

Look for entity IDs that end in “_cost” or “_compensation”, those are the ones that HA creates for energy.

I added them to my dashboard yesterday before asking but I didn’t understand how they worked…

They were reset yesterday at noon. And this is my energy dashboard from yesterday:

So I don’t really know what to do with them. Isn’t there a risk sensor.radiateur_nicolas_electric_energy_consumption_cost resets mid-day and throws off the utility meter?

I believe utility_meters can be built to handle/ignore resets of their source sensor:

https://www.home-assistant.io/integrations/utility_meter/#periodically-resetting

Thank you.

And how can I build a sensor for yesterday’s cost? Do I need to create an automation that stores today’s value in a sensor everyday at 23:59 or is there a more elegant solution?