BottlecapDave / HomeAssistant-OctopusEnergy

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

v10.2.1 Override Rates reporting in pence not pounds #839

Closed psfshr closed 1 month ago

psfshr commented 2 months ago

Describe the bug

I have recently enabled override rates in the integration, however it appears that rather than reporting in decimal pounds as the normal rates it reports in decimal pence (i.e. 100 times greater). A manual API call with curl retrieves both in decimal pence.

Reproduction steps

Retrieving my normal unit rates and agile rates via curl:

curl -u "<snip>" "https://api.octopus.energy/v1/products/VAR-22-11-01/electricity-tariffs/E-1R-VAR-22-11-01-H/standard-unit-rates/?period_from=2024-04-15T00:00Z&period_to=2024-04-16T00:00Z" | jq

  "results": [
    {
      "value_exc_vat": 23.482,
      "value_inc_vat": 24.6561,
      "valid_from": "2024-03-31T23:00:00Z",
      "valid_to": null,
      "payment_method": "DIRECT_DEBIT"
    },

curl -u "<snip>" "https://api.octopus.energy/v1/products/AGILE-24-04-03/electricity-tariffs/E-1R-AGILE-24-04-03-H/standard-unit-rates/?period_from=2024-04-15T00:00Z&period_to=2024-04-16T00:00Z" | jq

    {
      "value_exc_vat": 17.22,
      "value_inc_vat": 18.081,
      "valid_from": "2024-04-15T06:30:00Z",
      "valid_to": "2024-04-15T07:00:00Z",
      "payment_method": null
    },

Vs the values reported in HA from the integration...

previous_day_rates
tariff_code: E-1R-VAR-22-11-01-H
rates:
- start: '2024-04-15T06:30:00+00:00'
  end: '2024-04-15T07:00:00+00:00'
  value_inc_vat: 0.246561
  is_capped: false

previous_consumption_override_rates
tariff_code: E-1R-AGILE-24-04-03-H
rates: 
- value_inc_vat: 18.081
  start: '2024-04-15T06:30:00+00:00'
  end: '2024-04-15T07:00:00+00:00'
  tariff_code: E-1R-AGILE-24-04-03-H
  is_capped: false

Expected behaviour

Integration documentation states that both rates should return decimal pounds values, e.g. would expect:

previous_day_rates
tariff_code: E-1R-VAR-22-11-01-H
rates:
- start: '2024-04-15T06:30:00+00:00'
  end: '2024-04-15T07:00:00+00:00'
  value_inc_vat: 0.246561
  is_capped: false

previous_consumption_override_rates
tariff_code: E-1R-AGILE-24-04-03-H
rates: 
- value_inc_vat: 0.18081
  start: '2024-04-15T06:30:00+00:00'
  end: '2024-04-15T07:00:00+00:00'
  tariff_code: E-1R-AGILE-24-04-03-H
  is_capped: false

Tariff Code

As above

Integration Version

v10.2.1

Home Assistant Version

2024.4.3

Fresh Install?

Not specified

Home Assistant Logs

N/A

Confirmation

BottlecapDave commented 2 months ago

Hello and thank you for raising this inconsistency. This should be fixed in the next release, however as it'll include a few breaking changes (including this one), I'm not sure on the timeline at the moment.

BottlecapDave commented 1 month ago

This should now be fixed in v11.0.0.