Octopus Energy Agile Tariff

Here is mine so not much different than yours!

- sensor:
    - name: "Agile_actual_rate"
      unit_of_measurement: "GBP/kWh"
      state: >
        {{ (states.sensor.octopus_agile_current_rate.state|float) / 100 }}

I actually closed my issue on github. I misunderstood how states(sensor) works. It will return a string irrelevant of the real status of the sensor.
The correct way to test for a float is:

{% if float(‘name_sensor’) %}
it will return true or false…

Sorry for the confusion. But it still doesn’t explain why the sensor is not working in the energy tab :slight_smile:

Any luck with your sensor?

Nope. Did yours work?

still the same. the cost stays at 0

Check your error logs. I had an issue getting it to work and this thread helped. It was a slightly different underlying issue, but if you’ve played around with the stats then it seems to have a problem.

I have the same error as you mention in my log but that is for another sensor.

Will look into installing the phpmyadmin addon and see

Success!!! the day before I updated the database (it was showing EUR) as per @Dangermoose advice.

At first there was no changes but at the same I had not used the oven which I monitor.

This morning I used it and finally I can see the cost being updated

and it lines up the cost per kWh at the time was 35p/KwH

So in the end the problem was the database it seems.

1 Like

This solved the problem for me too :blush:

1 Like

So one improvement for your component would be to change the unit to GBP rather than using pennies.

I realise it will upset the existing configuration but it would save having to create a template to change the unit and divide by 100 to be inline with what HA is expecting

Hey all,
Just looking for some help please. I installed the custom components yesterday via HACS. Configured with my meter details in replacement to the core code (so I have dishwasher, washing machine etc etc all setup from the code). I am on Octopus Go tariff. Im finding details are very sporadic to come through. I have tried going into dev tools, services locating octopusagile: update_timers but when I call the service I get an error message at the bottom of the screen showing:

Failed to call service octopusagile.update_timers. Unknown error

Anyone else had this issue or knows a way to get the service call to work without it erroring? Im guessing because this is failing data is not pulling through for all the sensors etc. Im running HA containered and am on 2021.10.6

Also, looking at logs, I can see the following error message (this is just after a reboot so not sure if thats a red herring form what I have read higher in the thread):

Any help appreciated. I’ve just moved to Octopus Go. I’ve had a skim through some of the 500+ entries here and not even sure if this is what i’m looking for. Is there a way to see My Octopus GO spend (two rates) I have access to my API number, etc. Is there perhaps a “how to” somewhere? Thanks in advance.

1 Like

@davidtja by spend, do you mean up to previous day? Unfortunately the integration can only show consumption up to the previous day (due to Octopus API). If you want todays consumption as well, you need to install a few other components. Primarily, check out GitHub - HandyHat/ha-hildebrandglow-dcc: PRE-RELEASE. Home Assistant integration for UK SMETS (Smart) meters pulling data from the DCC via the Hildebrand Glow API - from that you can get your consumption up to the last half hour. It involves installing the Bright app on your phone, configure Bright (you dont need to be a Bright customer) and then installing the integration

1 Like

Thanks and really appreciate your response. I have just reinstalled the Hildebrand integration. I must have had the incorrect one installed. I will try that. Do you have to input the tarif rates, etc, or are they automatically picked up? Thanks

I believe they are automatically picked up if your energy supplier has set them on your meter correctly. My tariffs arent set correct by suppliers so cant give you 100% confirmation Im afraid

I appear to have fallen at the first hurdle.

I’ve added the integration via HACS, pasted the sensor code into configuration.yaml and added the automation, changing the URL to match my E-1R… bit.

Restarted and run the automation manually.

I can see the sensor but it’s not showing any data. It just shows this. Am I missing something?

Hi Mark,

I renamed the octopusagil.json file with a .bak then restarted my HA but the file did not get regenerated. any ideas? I Have the below errors on start up before I tried to regenerate the json file and was hoping that it would fix all of these…

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 313, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
AttributeError: module 'custom_components.OctopusAgile' has no attribute 'async_setup_entry'

2021-12-27 10:08:54 INFO (MainThread) [homeassistant.setup] Setup of domain octopusagile took 5.2 seconds

2021-12-27 10:08:55 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing octopusagile/recorder.py

oduleNotFoundError: No module named 'custom_components.OctopusAgile.recorder'

2021-12-27 10:08:55 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing octopusagile/significant_change.py

ModuleNotFoundError: No module named 'custom_components.OctopusAgile.significant_change'
2021-12-27 10:08:55 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing octopusagile/system_health.py

ModuleNotFoundError: No module named 'custom_components.OctopusAgile.system_health'
2021-12-27 10:08:55 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing octopusagile/media_source.py

ModuleNotFoundError: No module named 'custom_components.OctopusAgile.media_source'
2021-12-27 10:08:55 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing octopusagile/logbook.py
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 33, in _process
platform = integration.get_platform(platform_name)
File "/usr/src/homeassistant/homeassistant/loader.py", line 530, in get_platform
cache[full_name] = self._import_platform(platform_name)
File "/usr/src/homeassistant/homeassistant/loader.py", line 535, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'custom_components.OctopusAgile.logbook'
2021-12-27 10:08:55 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing octopusagile/group.py
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 33, in _process
platform = integration.get_platform(platform_name)
File "/usr/src/homeassistant/homeassistant/loader.py", line 530, in get_platform
cache[full_name] = self._import_platform(platform_name)
File "/usr/src/homeassistant/homeassistant/loader.py", line 535, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'custom_components.OctopusAgile.group'
2021-12-27 10:08:55 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.octopusagile

Any help or guidance would be great, thank you!
Chris

Hi Chris, It looks like something is up with either the installation or the config. Have you had it working in the past?

Thanx for the reply Mark,

I since deleted everything and the reinstalled and seems to be working again now!

But I always see this in the Integrations page, is it normal or still something not quite right with my set up?

image

@Markg

Did you ever look into the UTC/BST time issue?