BottlecapDave / HomeAssistant-OctopusEnergy

Unofficial Home Assistant integration for interacting with Octopus Energy
https://bottlecapdave.github.io/HomeAssistant-OctopusEnergy/
MIT License
572 stars 57 forks source link

Add daily standing charge #24

Closed kinnectus closed 2 years ago

kinnectus commented 2 years ago

As per title, it would be helpful to see the daily standing charges also added to the energy dashboard.

When yesterday's consumption is available to the past accumulative gas/electricity consumption sensors (which then gets turned into the past accumulative cost sensor based on the current rate * past accumulative consumption) it should be fairly easy to add a new sensor to obtain the tariff daily standing charge per energy source and add this to the accumulative cost - especially as Energy dashboard has no ability to take into consideration daily standing charges yet.

BottlecapDave commented 2 years ago

Hello sorry for the late response. I could add a sensor to expose the standing charge, but I don't currently expose any sensors for the accumulative consumption. Currently this is calculated by Energy Dashboard if you add the previous consumption and current rate, which only really works if you're on a fixed rate. I have it on my list to expose a sensor for the previous days consumption cost, so I'll add a daily standing charge as an attribute to that sensor.

Unless, I have gotten the wrong end of the stick for your request?

kinnectus commented 2 years ago

https://developer.octopus.energy/docs/api/#list-tariff-charges

Requests to get tariff standing charges.

As the current sensors your component obtains are including VAT, thankfully the API also exposes value_inc_vat.

I think what would help, as you already have a SMETS1 checkbox, would be another checkbox to enable users to choose whether to include daily standing charges and have the respective previous_accumulative_cost add the daily standing charge for each energy.

I've also noticed that the daily gas unit price sensor never updates. I've had to manually enter my tariff unit cost. I can obtain this value from the API when using the likes of Postman, though.

I'm not an Agile customer - whether that helps or not. I'm actually a SoLR customer and was excited to find out I could access daily energy usage via an API. I've just noticed these niggling little omissions or yet-to-be-implemented things that could make this component even better.

Excellent component, regardless. It's made integrating the daily data and cost so trivial.

BottlecapDave commented 2 years ago

and have the respective previous_accumulative_cost add the daily standing charge for each energy.

This is the part that confused me, as I currently don't expose such a sensor. It's on my list however, but gets a little complicated with some of the tariffs (e.g. agile)

I've also noticed that the daily gas unit price sensor never updates

Again I don't currently expose such a sensor, but it's on my list to (see https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/issues/17)

kinnectus commented 2 years ago

Sorry, you are right, no such cost sensor is exposed. Ugh, this is going to be non-trivial, as I feel this problem shouldn't be your responsibility. Having an additional sensor just for the daily standing charge (alongside the sensor for current rate) would be useful, however it seems HA core needs to be updated to accommodate for consumers who have standing charges on their tariffs.

BottlecapDave commented 2 years ago

Yeah unfortunately the HA Energy dashboard has been built for live data, not historic (like what Octopus provides), as well as being built for live pricing or fixed pricing. That's why I added the previous day accumulation sensor to try and get some useful information out which could be added to the energy dashboard (if a little weirdly with todays consumption actually being yesterdays). I'll try and take a look at the previous accumulation cost sensor within the next couple of weeks as I think it's useful information to provide. I'll also try and expose the standing charge on the sensor (either included in the value and/or as an attribute on the sensor)

BottlecapDave commented 2 years ago

There is now a previous day accumulation cost sensor which includes the daily standing charge within the cost as well as having the value as an attribute on the sensor. Closing the ticket.