HomeAssistant-OctopusEnergy icon indicating copy to clipboard operation
HomeAssistant-OctopusEnergy copied to clipboard

Error: custom integration 'octopus_energy' doesn't specify mean_type when calling async_import_statistics

Open Tyne-Bridges opened this issue 1 month ago • 7 comments

Describe the bug

Errors logged are as follows. I'm on HAOS 2025.11.2 on an Intel X86 NUC and no data has come through to HA from my Octopus Home Mini since late October (that is, since before the latest HA update)

2025-11-21 13:27:17.569 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'octopus_energy' doesn't specify mean_type when calling async_import_statistics at custom_components/octopus_energy/statistics/consumption.py, line 63: async_add_external_statistics(. This will stop working in Home Assistant 2026.11, please create a bug report at https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/issues
2025-11-21 13:27:46.434 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'octopus_energy' doesn't specify mean_type when calling async_import_statistics at custom_components/octopus_energy/statistics/cost.py, line 62: async_add_external_statistics(. This will stop working in Home Assistant 2026.11, please create a bug report at https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/issues

Reproduction steps

Click on Energy integration and see no data for Gas or Electricity for the current day, or for any date later than 28 October. I discovered that I had been logged off from the Octopus Android app but logged in again successfully. I restarted the Octopus integration and then Home Assistant yesterday but this did not fix the issue - see errors above.

Edit 22/11/25: I've removed and reinstalled the Octopus Energy integration. On reinstalling, the original, non-working configuration appears, with no apparent option to reconfigure.

Expected behaviour

Energy readings to appear automatically at least once per hour.

Tariff Code

Sorry - can't locate any information tagged "tariff code".

Integration Version

17.1.1

Home Assistant Version

Core 2025.11.2, Supervisor 2025.11.4

Fresh Install?

Not specified

Home Assistant Logs

{ "version": "2025.11.2", "info": { "cost_sensors": {}, "solar_forecast_domains": [] }, "preferences": { "energy_sources": [ { "type": "gas", "stat_energy_from": "sensor.octopus_gas_current_consumption", "stat_cost": "sensor.octopus_gas_current_accumulative_cost", "entity_energy_price": null, "number_energy_price": null }, { "type": "grid", "flow_from": [ { "stat_energy_from": "sensor.octopus_elect_current_consumption", "stat_cost": "sensor.octopus_elec_current_accumulative_cost", "entity_energy_price": null, "number_energy_price": null } ], "flow_to": [], "cost_adjustment_day": 0 } ], "device_consumption": [] }, "metadata": { "sensor.octopus_elect_current_consumption": { "statistic_id": "sensor.octopus_elect_current_consumption", "display_unit_of_measurement": "kWh", "has_mean": false, "mean_type": 0, "has_sum": true, "name": null, "source": "recorder", "statistics_unit_of_measurement": "kWh", "unit_class": "energy" }, "sensor.octopus_elec_current_accumulative_cost": { "statistic_id": "sensor.octopus_elec_current_accumulative_cost", "display_unit_of_measurement": "GBP", "has_mean": false, "mean_type": 0, "has_sum": true, "name": null, "source": "recorder", "statistics_unit_of_measurement": "GBP", "unit_class": null }, "sensor.octopus_gas_current_accumulative_cost": { "statistic_id": "sensor.octopus_gas_current_accumulative_cost", "display_unit_of_measurement": "GBP", "has_mean": false, "mean_type": 0, "has_sum": true, "name": null, "source": "recorder", "statistics_unit_of_measurement": "GBP", "unit_class": null }, "sensor.octopus_gas_current_consumption": { "statistic_id": "sensor.octopus_gas_current_consumption", "display_unit_of_measurement": "kWh", "has_mean": false, "mean_type": 0, "has_sum": true, "name": null, "source": "recorder", "statistics_unit_of_measurement": "kWh", "unit_class": "energy" } }, "entities": { "sensor.octopus_elect_current_consumption": { "entity_id": "sensor.octopus_elect_current_consumption", "device_id": "c138bb25f32b2db340c70218ee24c4e4", "labels": [ "electricity_consumption" ], "platform": "octopus_energy", "name": "Current Consumption Electricity (22J0180533/1591050851052)", "display_precision": 2 }, "sensor.octopus_elec_current_accumulative_cost": { "entity_id": "sensor.octopus_elec_current_accumulative_cost", "device_id": "c138bb25f32b2db340c70218ee24c4e4", "labels": [], "platform": "octopus_energy", "name": "Current Accumulative Cost Electricity (22J0180533/1591050851052)" }, "sensor.octopus_gas_current_accumulative_cost": { "entity_id": "sensor.octopus_gas_current_accumulative_cost", "device_id": "e4336bb097e9cc07826dc9c3b267d4ac", "labels": [], "platform": "octopus_energy", "name": "Current Accumulative Cost Gas (E6E08726832223/1258425003)" }, "sensor.octopus_gas_current_consumption": { "entity_id": "sensor.octopus_gas_current_consumption", "device_id": "e4336bb097e9cc07826dc9c3b267d4ac", "labels": [], "platform": "octopus_energy", "name": "Current Consumption Gas (E6E08726832223/1258425003)", "display_precision": 2 } }, "states": { "sensor.octopus_elect_current_consumption": { "entity_id": "sensor.octopus_elect_current_consumption", "state": "0", "attributes": { "state_class": "total", "last_reset": "2025-11-21T13:27:46.721984+00:00", "unit_of_measurement": "kWh", "device_class": "energy", "icon": "mdi:lightning-bolt", "friendly_name": "Current Consumption Electricity (22J0180533/1591050851052)" }, "context": { "id": "01KAK9JXS226MBR3VVR4NX81C2", "parent_id": null, "user_id": null }, "last_changed": "2025-11-21T13:26:46.393Z", "last_updated": "2025-11-21T13:27:46.722Z" }, "sensor.octopus_elec_current_accumulative_cost": { "entity_id": "sensor.octopus_elec_current_accumulative_cost", "state": "1.51", "attributes": { "state_class": "total", "last_reset": "2025-10-28T00:00:00+00:00", "mpan": "1591050851052", "serial_number": "22J0180533", "is_export": false, "is_smart_meter": true, "tariff_code": "E-1R-OE-FIX-15M-24-09-06-F", "total": 1.5099999999999998, "charges": [ { "start": "2025-10-28T00:00:00+00:00", "end": "2025-10-28T00:30:00+00:00", "rate": 0.224441, "consumption": 0.043, "cost": 0.01 }, { "start": "2025-10-28T00:30:00+00:00", "end": "2025-10-28T01:00:00+00:00", "rate": 0.224441, "consumption": 0.069, "cost": 0.02 }, { "start": "2025-10-28T01:00:00+00:00", "end": "2025-10-28T01:30:00+00:00", "rate": 0.224441, "consumption": 0.062, "cost": 0.01 }, { "start": "2025-10-28T01:30:00+00:00", "end": "2025-10-28T02:00:00+00:00", "rate": 0.224441, "consumption": 0.04, "cost": 0.01 }, { "start": "2025-10-28T02:00:00+00:00", "end": "2025-10-28T02:30:00+00:00", "rate": 0.224441, "consumption": 0.041, "cost": 0.01 }, { "start": "2025-10-28T02:30:00+00:00", "end": "2025-10-28T03:00:00+00:00", "rate": 0.224441, "consumption": 0.083, "cost": 0.02 }, { "start": "2025-10-28T03:00:00+00:00", "end": "2025-10-28T03:30:00+00:00", "rate": 0.224441, "consumption": 0.049, "cost": 0.01 }, { "start": "2025-10-28T03:30:00+00:00", "end": "2025-10-28T04:00:00+00:00", "rate": 0.224441, "consumption": 0.039, "cost": 0.01 }, { "start": "2025-10-28T04:00:00+00:00", "end": "2025-10-28T04:30:00+00:00", "rate": 0.224441, "consumption": 0.052, "cost": 0.01 }, { "start": "2025-10-28T04:30:00+00:00", "end": "2025-10-28T05:00:00+00:00", "rate": 0.224441, "consumption": 0.08, "cost": 0.02 }, { "start": "2025-10-28T05:00:00+00:00", "end": "2025-10-28T05:30:00+00:00", "rate": 0.224441, "consumption": 0.04, "cost": 0.01 }, { "start": "2025-10-28T05:30:00+00:00", "end": "2025-10-28T06:00:00+00:00", "rate": 0.224441, "consumption": 0.04, "cost": 0.01 }, { "start": "2025-10-28T06:00:00+00:00", "end": "2025-10-28T06:30:00+00:00", "rate": 0.224441, "consumption": 0.056, "cost": 0.01 }, { "start": "2025-10-28T06:30:00+00:00", "end": "2025-10-28T07:00:00+00:00", "rate": 0.224441, "consumption": 0.077, "cost": 0.02 }, { "start": "2025-10-28T07:00:00+00:00", "end": "2025-10-28T07:30:00+00:00", "rate": 0.224441, "consumption": 0.078, "cost": 0.02 }, { "start": "2025-10-28T07:30:00+00:00", "end": "2025-10-28T08:00:00+00:00", "rate": 0.224441, "consumption": 0.291, "cost": 0.07 }, { "start": "2025-10-28T08:00:00+00:00", "end": "2025-10-28T08:30:00+00:00", "rate": 0.224441, "consumption": 0.4, "cost": 0.09 }, { "start": "2025-10-28T08:30:00+00:00", "end": "2025-10-28T09:00:00+00:00", "rate": 0.224441, "consumption": 0.21, "cost": 0.05 }, { "start": "2025-10-28T09:00:00+00:00", "end": "2025-10-28T09:30:00+00:00", "rate": 0.224441, "consumption": 0.058, "cost": 0.01 }, { "start": "2025-10-28T09:30:00+00:00", "end": "2025-10-28T10:00:00+00:00", "rate": 0.224441, "consumption": 0.077, "cost": 0.02 }, { "start": "2025-10-28T10:00:00+00:00", "end": "2025-10-28T10:30:00+00:00", "rate": 0.224441, "consumption": 0.057, "cost": 0.01 }, { "start": "2025-10-28T10:30:00+00:00", "end": "2025-10-28T11:00:00+00:00", "rate": 0.224441, "consumption": 0.046, "cost": 0.01 }, { "start": "2025-10-28T11:00:00+00:00", "end": "2025-10-28T11:30:00+00:00", "rate": 0.224441, "consumption": 0.131, "cost": 0.03 }, { "start": "2025-10-28T11:30:00+00:00", "end": "2025-10-28T12:00:00+00:00", "rate": 0.224441, "consumption": 0.278, "cost": 0.06 }, { "start": "2025-10-28T12:00:00+00:00", "end": "2025-10-28T12:30:00+00:00", "rate": 0.224441, "consumption": 0.317, "cost": 0.07 }, { "start": "2025-10-28T12:30:00+00:00", "end": "2025-10-28T13:00:00+00:00", "rate": 0.224441, "consumption": 0.401, "cost": 0.09 }, { "start": "2025-10-28T13:00:00+00:00", "end": "2025-10-28T13:30:00+00:00", "rate": 0.224441, "consumption": 0.15, "cost": 0.03 }, { "start": "2025-10-28T13:30:00+00:00", "end": "2025-10-28T14:00:00+00:00", "rate": 0.224441, "consumption": 0.121, "cost": 0.03 }, { "start": "2025-10-28T14:00:00+00:00", "end": "2025-10-28T14:30:00+00:00", "rate": 0.224441, "consumption": 0.132, "cost": 0.03 }, { "start": "2025-10-28T14:30:00+00:00", "end": "2025-10-28T15:00:00+00:00", "rate": 0.224441, "consumption": 0.087, "cost": 0.02 } ], "standing_charge": 0.69, "total_without_standing_charge": 0.82, "unit_of_measurement": "GBP", "device_class": "monetary", "icon": "mdi:currency-gbp", "friendly_name": "Current Accumulative Cost Electricity (22J0180533/1591050851052)" }, "context": { "id": "01KAK9H2VW7W0KBKHWZDN7MSH9", "parent_id": null, "user_id": null }, "last_changed": "2025-11-21T13:26:46.396Z", "last_updated": "2025-11-21T13:26:46.396Z" }, "sensor.octopus_gas_current_accumulative_cost": { "entity_id": "sensor.octopus_gas_current_accumulative_cost", "state": "1.32", "attributes": { "state_class": "total", "last_reset": "2025-10-28T00:00:00+00:00", "mprn": "1258425003", "serial_number": "E6E08726832223", "tariff_code": "G-1R-OE-FIX-15M-24-09-06-F", "standing_charge": 0.3, "total_without_standing_charge": 1.02, "total": 1.32, "charges": [ { "start": "2025-10-28T00:00:00+00:00", "end": "2025-10-28T00:30:00+00:00", "rate": 0.059452, "consumption": 0, "cost": 0 }, { "start": "2025-10-28T01:00:00+00:00", "end": "2025-10-28T01:30:00+00:00", "rate": 0.059452, "consumption": 0, "cost": 0 }, { "start": "2025-10-28T01:30:00+00:00", "end": "2025-10-28T02:00:00+00:00", "rate": 0.059452, "consumption": 0, "cost": 0 }, { "start": "2025-10-28T02:00:00+00:00", "end": "2025-10-28T02:30:00+00:00", "rate": 0.059452, "consumption": 0, "cost": 0 }, { "start": "2025-10-28T02:30:00+00:00", "end": "2025-10-28T03:00:00+00:00", "rate": 0.059452, "consumption": 0, "cost": 0 }, { "start": "2025-10-28T03:00:00+00:00", "end": "2025-10-28T03:30:00+00:00", "rate": 0.059452, "consumption": 0, "cost": 0 }, { "start": "2025-10-28T03:30:00+00:00", "end": "2025-10-28T04:00:00+00:00", "rate": 0.059452, "consumption": 0, "cost": 0 }, { "start": "2025-10-28T04:00:00+00:00", "end": "2025-10-28T04:30:00+00:00", "rate": 0.059452, "consumption": 0, "cost": 0 }, { "start": "2025-10-28T04:30:00+00:00", "end": "2025-10-28T05:00:00+00:00", "rate": 0.059452, "consumption": 0, "cost": 0 }, { "start": "2025-10-28T05:00:00+00:00", "end": "2025-10-28T05:30:00+00:00", "rate": 0.059452, "consumption": 0, "cost": 0 }, { "start": "2025-10-28T05:30:00+00:00", "end": "2025-10-28T06:00:00+00:00", "rate": 0.059452, "consumption": 0, "cost": 0 }, { "start": "2025-10-28T06:00:00+00:00", "end": "2025-10-28T06:30:00+00:00", "rate": 0.059452, "consumption": 0, "cost": 0 }, { "start": "2025-10-28T06:30:00+00:00", "end": "2025-10-28T07:00:00+00:00", "rate": 0.059452, "consumption": 0, "cost": 0 }, { "start": "2025-10-28T07:00:00+00:00", "end": "2025-10-28T07:30:00+00:00", "rate": 0.059452, "consumption": 0, "cost": 0 }, { "start": "2025-10-28T07:30:00+00:00", "end": "2025-10-28T08:00:00+00:00", "rate": 0.059452, "consumption": 9.32435, "cost": 0.55 }, { "start": "2025-10-28T08:00:00+00:00", "end": "2025-10-28T08:30:00+00:00", "rate": 0.059452, "consumption": 4.83609, "cost": 0.29 }, { "start": "2025-10-28T08:30:00+00:00", "end": "2025-10-28T09:00:00+00:00", "rate": 0.059452, "consumption": 0.10098, "cost": 0.01 }, { "start": "2025-10-28T09:00:00+00:00", "end": "2025-10-28T09:30:00+00:00", "rate": 0.059452, "consumption": 0, "cost": 0 }, { "start": "2025-10-28T09:30:00+00:00", "end": "2025-10-28T10:00:00+00:00", "rate": 0.059452, "consumption": 0.2693, "cost": 0.02 }, { "start": "2025-10-28T10:00:00+00:00", "end": "2025-10-28T10:30:00+00:00", "rate": 0.059452, "consumption": 0, "cost": 0 }, { "start": "2025-10-28T10:30:00+00:00", "end": "2025-10-28T11:00:00+00:00", "rate": 0.059452, "consumption": 0, "cost": 0 }, { "start": "2025-10-28T11:00:00+00:00", "end": "2025-10-28T11:30:00+00:00", "rate": 0.059452, "consumption": 0.57225, "cost": 0.03 }, { "start": "2025-10-28T11:30:00+00:00", "end": "2025-10-28T12:00:00+00:00", "rate": 0.059452, "consumption": 0.16831000000000002, "cost": 0.01 }, { "start": "2025-10-28T12:00:00+00:00", "end": "2025-10-28T12:30:00+00:00", "rate": 0.059452, "consumption": 0.22441, "cost": 0.01 }, { "start": "2025-10-28T12:30:00+00:00", "end": "2025-10-28T13:00:00+00:00", "rate": 0.059452, "consumption": 0.39273, "cost": 0.02 }, { "start": "2025-10-28T13:00:00+00:00", "end": "2025-10-28T13:30:00+00:00", "rate": 0.059452, "consumption": 0.3815, "cost": 0.02 }, { "start": "2025-10-28T13:30:00+00:00", "end": "2025-10-28T14:00:00+00:00", "rate": 0.059452, "consumption": 0.8864299999999999, "cost": 0.05 }, { "start": "2025-10-28T14:00:00+00:00", "end": "2025-10-28T14:30:00+00:00", "rate": 0.059452, "consumption": 0.14587, "cost": 0.01 }, { "start": "2025-10-28T14:30:00+00:00", "end": "2025-10-28T15:00:00+00:00", "rate": 0.059452, "consumption": 0, "cost": 0 } ], "calorific_value": 40, "unit_of_measurement": "GBP", "device_class": "monetary", "icon": "mdi:currency-gbp", "friendly_name": "Current Accumulative Cost Gas (E6E08726832223/1258425003)" }, "context": { "id": "01KAK9H2W371GX2H33YTK383Y0", "parent_id": null, "user_id": null }, "last_changed": "2025-11-21T13:26:46.403Z", "last_updated": "2025-11-21T13:26:46.403Z" }, "sensor.octopus_gas_current_consumption": { "entity_id": "sensor.octopus_gas_current_consumption", "state": "0", "attributes": { "state_class": "total", "last_reset": "2025-11-21T19:25:10.760393+00:00", "unit_of_measurement": "kWh", "device_class": "energy", "icon": "mdi:fire", "friendly_name": "Current Consumption Gas (E6E08726832223/1258425003)" }, "context": { "id": "01KAKY36MH5PXVV2R4CDKDZ6EK", "parent_id": null, "user_id": null }, "last_changed": "2025-11-21T13:26:46.401Z", "last_updated": "2025-11-21T19:26:11.601Z" } }, "issues": { "energy_sources": [ [], [] ], "device_consumption": [] } }

Confirmation

  • [x] I confirm that I cannot find my solution within the documentation
  • [x] I confirm that I cannot find my solution within the FAQ

Tyne-Bridges avatar Nov 21 '25 19:11 Tyne-Bridges