BottlecapDave / HomeAssistant-OctopusEnergy

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

Question / Bug Not sure #164

Closed thorrrr closed 1 year ago

thorrrr commented 1 year ago

HI Was so happy to find a Octopus integration as i was using a Hildebrand which was flaky as crap. But i have followed the docs and find it confusing on how to configure the Energy Dashboard correctly. I think an explanation in the Wiki Docs would help greatly IMHO as this is already a well documented app.

But my dashboard is throwing errors and what to add where is a nightmare as you cannot read what is being presented they look identical

PLease can you explain how to get it working correctly ? octoerrors octopuspickwhat

setupconfig

thorrrr commented 1 year ago

Also whatever i add in Gas it errors reporting not available???

thorrrr commented 1 year ago

octopus_energy-5a2cd2069f517dec84c48fa9a53fc721-Electricity Meter-cde00efadb607afaafaea84e816a6ca6.json.txt octopus_energy-5a2cd2069f517dec84c48fa9a53fc721-Gas Meter-6727fafb9e7e6474fa957913b897529f.json.txt

BottlecapDave commented 1 year ago

Morning. Sorry you're having issues. The fact HA is reporting the state of those sensors as unknown suggests you may be on a tariff that the Octopus APIs don't recognise (it happens unfortunately from time to time). Do you know what tariffs you're on? (if you could post the contents of those json files in the comment that would be most appreciated as it makes it easier to search)

thorrrr commented 1 year ago

Tariff Flexible Octopus Oct 2022 v1

thorrrr commented 1 year ago

{ "home_assistant": { "installation_type": "Home Assistant OS", "version": "2023.3.1", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.10.10", "docker": true, "arch": "x86_64", "timezone": "Europe/London", "os_name": "Linux", "os_version": "5.15.90", "supervisor": "2023.01.1", "host_os": "Home Assistant OS 9.5", "docker_version": "20.10.22", "chassis": "vm", "run_as_root": true }, "custom_components": { "sonoff": { "version": "3.4.0", "requirements": [ "pycryptodome>=3.6.6" ] }, "shopping_list": { "version": "0.5", "requirements": [] }, "alexa_media": { "version": "4.6.0", "requirements": [ "alexapy==1.26.4", "packaging>=20.3", "wrapt>=1.12.1" ] }, "remote_homeassistant": { "version": "3.6", "requirements": [] }, "hacs": { "version": "1.31.0", "requirements": [ "aiogithubapi>=22.10.1" ] }, "meross_lan": { "version": "3.0.2", "requirements": [] }, "hildebrandglow_dcc": { "version": "1.0.3", "requirements": [ "pyglowmarkt==0.5.5" ] }, "xiaomi_cloud_map_extractor": { "version": "v2.2.0", "requirements": [ "pillow", "pybase64", "python-miio", "requests", "pycryptodome" ] }, "watchman": { "version": "0.5.1", "requirements": [ "prettytable==3.0.0" ] }, "octopus_energy": { "version": "6.0.1", "requirements": [] }, "fontawesome": { "version": "2.1.5", "requirements": [] }, "garbage_collection": { "version": "4.10.2", "requirements": [ "python-dateutil>=2.8.2" ] } }, "integration_manifest": { "domain": "octopus_energy", "name": "Octopus Energy", "codeowners": [ "@bottlecapdave" ], "config_flow": true, "dependencies": [], "documentation": "https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/", "homekit": {}, "iot_class": "cloud_polling", "issue_tracker": "https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/issues", "ssdp": [], "version": "6.0.1", "zeroconf": [], "is_built_in": false }, "data": { "electricity_meter_points": [ { "mpan": "REDACTED", "meters": [ { "serial_number": "REDACTED", "is_export": false, "is_smart_meter": true, "device_id": "REDACTED" } ], "agreements": [ { "valid_from": "2023-01-13T00:00:00+00:00", "valid_to": null, "tariff_code": "E-1R-VAR-22-10-01-D" } ] } ], "gas_meter_points": [ { "mprn": "REDACTED", "meters": [ { "serial_number": "REDACTED", "consumption_units": "m\u00b3" } ], "agreements": [ { "valid_from": "2023-01-10T00:00:00+00:00", "valid_to": null, "tariff_code": "G-1R-VAR-22-10-01-D" } ] } ] } }

thorrrr commented 1 year ago

{ "home_assistant": { "installation_type": "Home Assistant OS", "version": "2023.3.1", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.10.10", "docker": true, "arch": "x86_64", "timezone": "Europe/London", "os_name": "Linux", "os_version": "5.15.90", "supervisor": "2023.01.1", "host_os": "Home Assistant OS 9.5", "docker_version": "20.10.22", "chassis": "vm", "run_as_root": true }, "custom_components": { "sonoff": { "version": "3.4.0", "requirements": [ "pycryptodome>=3.6.6" ] }, "shopping_list": { "version": "0.5", "requirements": [] }, "alexa_media": { "version": "4.6.0", "requirements": [ "alexapy==1.26.4", "packaging>=20.3", "wrapt>=1.12.1" ] }, "remote_homeassistant": { "version": "3.6", "requirements": [] }, "hacs": { "version": "1.31.0", "requirements": [ "aiogithubapi>=22.10.1" ] }, "meross_lan": { "version": "3.0.2", "requirements": [] }, "hildebrandglow_dcc": { "version": "1.0.3", "requirements": [ "pyglowmarkt==0.5.5" ] }, "xiaomi_cloud_map_extractor": { "version": "v2.2.0", "requirements": [ "pillow", "pybase64", "python-miio", "requests", "pycryptodome" ] }, "watchman": { "version": "0.5.1", "requirements": [ "prettytable==3.0.0" ] }, "octopus_energy": { "version": "6.0.1", "requirements": [] }, "fontawesome": { "version": "2.1.5", "requirements": [] }, "garbage_collection": { "version": "4.10.2", "requirements": [ "python-dateutil>=2.8.2" ] } }, "integration_manifest": { "domain": "octopus_energy", "name": "Octopus Energy", "codeowners": [ "@bottlecapdave" ], "config_flow": true, "dependencies": [], "documentation": "https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/", "homekit": {}, "iot_class": "cloud_polling", "issue_tracker": "https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/issues", "ssdp": [], "version": "6.0.1", "zeroconf": [], "is_built_in": false }, "data": { "electricity_meter_points": [ { "mpan": "REDACTED", "meters": [ { "serial_number": "REDACTED", "is_export": false, "is_smart_meter": true, "device_id": "REDACTED" } ], "agreements": [ { "valid_from": "2023-01-13T00:00:00+00:00", "valid_to": null, "tariff_code": "E-1R-VAR-22-10-01-D" } ] } ], "gas_meter_points": [ { "mprn": "REDACTED", "meters": [ { "serial_number": "REDACTED", "consumption_units": "m\u00b3" } ], "agreements": [ { "valid_from": "2023-01-10T00:00:00+00:00", "valid_to": null, "tariff_code": "G-1R-VAR-22-10-01-D" } ] } ] } }

BottlecapDave commented 1 year ago

That all looks like it should be coming through the API.

It looks like you're using the wrong entity for the price - you should be using the "current rate" sensor not the "standing charge" sensor. In regards to the consumption data, are you receiving any other errors in your HA logs? Are you seeing any data in the entity itself?

thorrrr commented 1 year ago

HI

I have the current rate set for each but Electectic default pick for meter is Octopus Energy Electricity 17P5604074 1300004118991 Previous Accumulative Consumption This is not dragging any data

thorrrr commented 1 year ago

image

BottlecapDave commented 1 year ago

The previous accumulative consumption sensor will take up to 24 hours to populate upon first setting up the integration. Are you seeing any data in your Octopus Energy dashboard for the same period (e.g. for today's previous accumulative consumption data, you'll want to look up 04/03/2023 on the Octopus Energy website, which usually populates between 4-6pm).

The attribues of the previous accumulative consumption sensor will have the list of charges it found.

thorrrr commented 1 year ago

The only option i get for Elect is Consumed Energy: Octopus Energy Electricity 17P5604074 1300004118991 Previous Accumulative Consumption Entity Current Price: Octopus Energy Electricity 17P5604074 1300004118991 Current Rate No Data showing

Gas Octopus Energy Gas G4P56045261700 1671692907 Previous Accumulative Consumption Octopus Energy Gas G4P56045261700 1671692907 Current Rate

NO Data No Logs

image

thorrrr commented 1 year ago

Do these settings look ok? Should i wait 24 hrs to see what is shown? In my Octopus App i see data for 3 March currently

How come the Bright/Hilbrand App shows data for today ?

thorrrr commented 1 year ago

Please could you help me understand the different unit prices? Entity sensor.octopus_energy_electricity_17p5604074_1300004118991_current_rate 0.3188 In Tariff Info in Octopus 35.98p/kWh Octopus Statement 66.11p/kWh

Very confusing ?

BottlecapDave commented 1 year ago

In my Octopus App i see data for 3 March currently

This is why you're not seeing anything for today because it's not available. Like mentioned this usually becomes available this evening.

How come the Bright/Hilbrand App shows data for today?

I believe this requires additional hardware which uploads the data to the hiibrand server more frequently. This is similar to the Octopus Home Mini which is currently in beta. If you don't have the hardware, then it might be they request the data from the electricity network more frequently than Octopus Energy.

Please could you help me understand the different unit prices?

I'm not sure why you're getting different rates when compared to your statement or Octopus. According to the API your current rate should equal ~0.3598287. If you follow the instructions in the readme to increase your logs, this might give a clearer picture on why you're not receiving anything or receiving incorrect rates.

BottlecapDave commented 1 year ago

Is there any update on your situation @thorrrr?

thorrrr commented 1 year ago

Octopus Electric HA v App

thorrrr commented 1 year ago

Octopus Gas HA v App

BottlecapDave commented 1 year ago

Ok, so I've looked up the data should be coming through based on the endpoints

Electricity standing charge

https://api.octopus.energy/v1/products/VAR-22-10-01/electricity-tariffs/E-1R-VAR-22-10-01-D/standing-charges?period_from=2023-03-12T00:00:00Z&period_to=2023-03-13T00:00:00Z

This is coming back as 46.95243, which HA appears to be rounding (0.47) as it's monetary.

Electricity rates

https://api.octopus.energy/v1/products/VAR-22-10-01/electricity-tariffs/E-1R-VAR-22-10-01-D/standard-unit-rates/?period_from=2023-03-12T00:00:00Z&period_to=2023-03-13T00:00:00Z

This should be coming back as 35.98287. Because you've set a price cap, it's capping the result to 31.84. I'm not sure how the app handles government price caps, but it might not be taking them into account as they use the API data as well.

Gas standing charge

https://api.octopus.energy/v1/products/VAR-22-10-01/gas-tariffs/G-1R-VAR-22-10-01-D/standing-charges?period_from=2023-03-12T00:00:00Z&period_to=2023-03-13T00:00:00Z

This is coming back as 26.84136, which HA appears to be rounding (0.27) as it's monetary.

Gas rates

https://api.octopus.energy/v1/products/VAR-22-10-01/gas-tariffs/G-1R-VAR-22-10-01-D/standard-unit-rates/?period_from=2023-03-12T00:00:00Z&period_to=2023-03-13T00:00:00Z

This should be coming back as 10.34355. Because you've set a price cap, it's capping the result to 6.42. I'm not sure how the app handles government price caps, but it might not be taking them into account as they use the API data as well.

So it looks like data is coming back as expected based on your price caps and your configured tariff.

It also looks like previous consumption data is coming back successfully too. Are you happy to close this issue?

thorrrr commented 1 year ago

Yes