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

Integration fails after removing a charger from Intelligent Go #845

Closed Arachnid closed 1 month ago

Arachnid commented 2 months ago

Describe the bug

I had a wallbox charger configured in Intelligent Octopus Go. Due to issues with the charger, I removed it, but the integration continues to try to fetch data from it, resulting in the following error:

Errors in request (https://api.octopus.energy/v1/graphql/): [{'message': 'Unable to find device for given account.', 'locations': [{'line': 2, 'column': 2}], 'path': ['plannedDispatches'], 'extensions': {'errorType': 'NOT_FOUND', 'errorCode': 'KT-CT-4301', 'errorDescription': 'We were unable to find a device for the given account. Please check that the account number (and property ID) is correct.'}}, {'message': 'Unable to find device for given account.', 'locations': [{'line': 11, 'column': 2}], 'path': ['completedDispatches'], 'extensions': {'errorType': 'NOT_FOUND', 'errorCode': 'KT-CT-4301', 'errorDescription': 'We were unable to find a device for the given account. Please check that the account number (and property ID) is correct.'}}]

I also see this error:

Source: custom_components/octopus_energy/intelligent/__init__.py:256
Unexpected intelligent provider 'None'

Even after removing and readding the integration, the Charger device still shows up, and this error continues to recur.

Disabling the charger causes the first error to stop occurring, and it's able to fetch the data once, but the second error continues to occur, and the rates do not update (eg, when they should transition to night rates, etc).

Reproduction steps

  1. Sign up to Intelligent Octopus Go
  2. Add a charger
  3. Remove it

Expected behaviour

No error

Tariff Code

E-1R-INTELLI-VAR-22-10-14-H

Integration Version

v10.3.0

Home Assistant Version

2024.3.3

Fresh Install?

Fresh install

Home Assistant Logs

Errors in request (https://api.octopus.energy/v1/graphql/): [{'message': 'Unable to find device for given account.', 'locations': [{'line': 2, 'column': 2}], 'path': ['plannedDispatches'], 'extensions': {'errorType': 'NOT_FOUND', 'errorCode': 'KT-CT-4301', 'errorDescription': 'We were unable to find a device for the given account. Please check that the account number (and property ID) is correct.'}}, {'message': 'Unable to find device for given account.', 'locations': [{'line': 11, 'column': 2}], 'path': ['completedDispatches'], 'extensions': {'errorType': 'NOT_FOUND', 'errorCode': 'KT-CT-4301', 'errorDescription': 'We were unable to find a device for the given account. Please check that the account number (and property ID) is correct.'}}]

I also see this error:

Source: custom_components/octopus_energy/intelligent/__init__.py:256
Unexpected intelligent provider 'None'

Confirmation

BottlecapDave commented 2 months ago

Hello and sorry that you're receiving this issue. The integration pulls the information from your account provided by OE, which means that OE is telling me that the charger is still registered. This is configured when the integration is loaded or on HA restarts, so no need to reinstall the integration.

The integration also assumes that if you're on the intelligent tariff that you should have a charger or car setup, as to my knowledge you can't be on the tariff overwise? The rate information is reliant on this information if you're on an intelligent tariff so it can accurately adjust the rates for any periods that have planned dispatches outside of the normal off peak times. Otherwise the costs can go a bit weird when reloading the integration.

There looks like there's a status field on the device, but I'm not sure what this value is as I'm not on intelligent. If you're comfortable performing graphql queries, I'll need the results from the following query

query q($accountNumber: String!) {
    registeredKrakenflexDevice(accountNumber: $accountNumber) {
        krakenflexDeviceId
    provider
        vehicleMake
        vehicleModel
    vehicleBatterySizeInKwh
        chargePointMake
        chargePointModel
    chargePointPowerInKw
        status
    }
}

Instructions on performing graphql queries can be found here

Arachnid commented 2 months ago

I did register with a charger, but have had a warranty issue with it, so I deregistered it. Although a charger or car is required for setup, Octopus seems to allow you to stay on the tarriff even after you remove them.

I get all null results for the query at the moment:

{
  "data": {
    "registeredKrakenflexDevice": {
      "krakenflexDeviceId": null,
      "provider": null,
      "vehicleMake": null,
      "vehicleModel": null,
      "vehicleBatterySizeInKwh": null,
      "chargePointMake": null,
      "chargePointModel": null,
      "chargePointPowerInKw": null,
      "status": null
    }
  }
}
BottlecapDave commented 2 months ago

Thanks for providing the information. I'll try and accomodate this in the next update.

BottlecapDave commented 1 month ago

This should now be fixed in v11.0.0.