batpred icon indicating copy to clipboard operation
batpred copied to clipboard

Actual cost daily/weekly graph display - request

Open timparker71 opened this issue 1 year ago • 8 comments

It would be great if one of the cards/graphs could show the actual cost at the end of each day and maybe display the last weeks worth of daily actuals. I view mine by checking the history at 23:59. Hopefully most people keep at least seven days worth of data to call on, I keep a months worth, but something showing the last seven days 'actual' would be great! Thank you.

timparker71 avatar Feb 29 '24 17:02 timparker71

If you set your import and export rates up and your import and export sensors on the Energy dashboard in Home Assistant, it’ll do all this for you and you can view consumption, battery charge/discharge, import and export costs by day, week, month, etc.If you are using the Octopus Energy integration (bottlecapdave) then there’s instructions for how to use the rates supplied by Octopus in the github documentation for the integrationOn 29 Feb 2024, at 17:18, timparker71 @.***> wrote: It would be great if one of the cards/graphs could show the actual cost at the end of each day and maybe display the last weeks worth of daily actuals. I view mine by checking the history at 23:59. Hopefully most people keep at least seven days worth of data to call on, I keep a months worth, but something showing the last seven days 'actual' would be great! Thank you.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

gcoan avatar Feb 29 '24 18:02 gcoan

I've done this using a template "Daily Cost" sensor from {{states('predbat.cost_today')}}, then use a statistics-graph card to show values from the last N days

Nilogax avatar Feb 29 '24 19:02 Nilogax

graph.txt

If you have Apex custom cards installed then paste the attached code into a card and it will show you a 14 day graph of daily electric costs

7Van737 avatar Feb 29 '24 19:02 7Van737

Thank you for this @7Van737. I've created the card, but it doesn't show me the actual cost at the end of the day, ie at 23:59. Sometimes for me this is a negative number, sometimes it's pence. Thanks image

timparker71 avatar Feb 29 '24 21:02 timparker71

@7Van737 This is the figure I'd like at the end of each day: image

timparker71 avatar Feb 29 '24 21:02 timparker71

@7Van737 I've fixed it! Simple! Thanks again image

timparker71 avatar Feb 29 '24 21:02 timparker71

I don't currently have an export MPAN so don't export - hence I don't have any negative costs. I guess you've changed the entity to use predbat.cost_today ??

7Van737 avatar Feb 29 '24 21:02 7Van737

I can add this to the sample graphs so other users can benefit from it, thanks @Nilogax @7Van737

It is worth getting the Energy card working as well though as its much better at looking at longer term consumption trends/graphs - although annoyingly it only shows total cost for the time period eg for last week, not broken down cost per day

gcoan avatar Feb 29 '24 22:02 gcoan