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

Energy Cost Not Calculated #139

Closed fibilt closed 1 year ago

fibilt commented 1 year ago

I am not able to get the cost when I set up the gas consumption with “use an entity with current price”.

My electricity is set up exactly as the gas, but for some reason, the gas cost is always £0. My energy (gas) dashboard configuration and energy dashboard information:

Screenshot 2023-02-05 at 09 41 17

I am using "Octopus Energy Gas G4P21843641700 621077107 Previous Accumulative Consumption" for gas usage and "Octopus Energy Gas G4P21843641700 621077107 Current Rate" to track cost using the option "Use an entity with current price".

Am I missing something?

BottlecapDave commented 1 year ago

I usually add the "previous total cost" entity under the option of "use an entity tracking the total costs" as the current rate will be a day out in relation to the consumption (not an issue on fixed rate tariffs).

However I'd expect it to be higher than zero. Does the entity have a value? If not do you have any errors in your Home Assistant logs? Also what tariff are you on (this should be in the attributes of your gas sensors)?

fibilt commented 1 year ago

Thanks for your support here.

If I use option "use an entity tracking the total costs" it works, but I realised that cost is higher than what it should be. "Use static price" option also works (tested it today).

Re your question, yes the entity has a value (PFA), and no errors are reported in my HA logs. The only error I can see is when I try to use entity "Octopus Energy Gas G4P21843641700 621077107 Previous Accumulative Consumption (kWh)" that I get an unexpected unit of measurement warning (see screenshot attached).

My tariff is Occupier Flexible Octopus October 2021 v1.

Please let me know if further information is required.

Screenshot 2023-02-05 at 17 47 52 Screenshot 2023-02-05 at 17 54 50 Screenshot 2023-02-05 at 17 50 27
fibilt commented 1 year ago

I have created a template sensor that reads the previous gas consumption in kWh value from the octopus integration sensor but I get the same unexpected unit of measurement when I select it as the gas consumption sensor in the energy dashboard.

Am I only the only one facing this issue? I run HA on docker btw.

Any help would be really appreciated!

BottlecapDave commented 1 year ago

Hmm very odd, this should have the correct measurement. I'll take a look at some point within the next week.

fibilt commented 1 year ago

cool thanks. Let me know if you need any further information.

BottlecapDave commented 1 year ago

I've had a look and the unit of measurement is correct (this can be seen by finding the entity in /developer-tools/state and looking up unit_of_measurement). This might be an issue on Home Assistant side.

When you said the total cost was higher than expected, how much higher? Did you perform any reboots? If so, this might be fixed in the latest release.

fibilt commented 1 year ago

I think you are right. Since the last update, cost calculations seem to be correct. I have been monitoring energy cost on a daily basis and so far so good.

And yes, I have a crontab rule set up to reboot my HA server every day at 5am. Not sure I understand why a reboot could have been causing the issue though.

BottlecapDave commented 1 year ago

Ok. Are you happy for me to close this issue?

fibilt commented 1 year ago

Sure! Thanks for your support.