Octopus Energy Agile Tariff

@Creatish It’s nowhere near as good as baz123’s dashboard look but if you’re good installing a custom component and install my custom OctopusAgile component, the rates are listed in the attributes of the octopusagile.rates entity. I’ve had a play with a custom card to display them in a better way. It’s just a basic table but might tie you over until you get going with node red and baz123’s dashboards.

You can download the card here

I have it displaying in 4 columns as mostly use a tablet for home assistant but you can configure that to whatever you like.

Rates are going negative tonight for the South West - Bonus!

6 Likes

Now that was easy to install, even late at night, after a glass of wine :smile: Some interesting features in there, moneymakers and so on.

It looks a bit cramped on my desktop box in Chrome, I can use only a maximum of 3 columns which stray beyond the HA card frame on screen. I suspect losing the :ss of hh:mm:ss would help, as with all those p/kWh. It’ll give me something to tinker with today.

Nice effort, thanks for sharing.

Hi Marc, this is great thankyou so much.

Don’t really like using hamburger menu to open node red on mobile to see chart, this is exactly what I need.

This is perfect, one app deleted :smiley:

@badguy @baz123 @Markg

Hi Guys

Thanks for the work on the Octopus components for HA, They are all great, but what would be awesome is if they could all be combined together either in a custom component, hacs or an actual home assistant integration - that last one would be massive :slight_smile:

I am sure this is not a full time thing for you but would really be helpfull and great for those of us who cant code for anything

So, as I am useless at coding I would be verry happy to do any testing I can as at the moment I am not on agaile as I cant get a smart meter installed at the moment but will be getting ASAP

My setup is I have Solar & Battery plus all electric heating so I will be able to test switching things on and off based times and plunge pricing etc

thanks again

Meh, fine to do seperatly, why does it matter?

I now have 4 different octopus agile components loaded and like bits from some

Also have lots of sensor even if not using takes ups resources in the dB/history and as a few are actually duplicates it would make sense to only have a single sensor rather than 3 and only use 1

Hi Marc,

been using your entity for cheapest blocks, love it
How would I go about changing them to times that make sense for me?
Think I need a 3 hour and 4 hour instead of .5

I tried changing the configuration yaml to have just this but it still displays the ones you made

Octupus Agile

OctopusAgile:
region_code: “J”
run_devices:

  • energy_time: 2.5
    entity_id: Three Hours
    run_before: ‘08:00:00’
    run_time: 3
  • energy_time: 3
    entity_id: one hour
    run_before: ‘08:00:00’
    run_time: 1
  • energy_time: 1
    entity_id: Two Hours
    run_before: ‘08:00:00’
    run_time: 2
  • energy_time: 2
    entity_id: 4 Hours
    run_before: ‘08:00:00’
    run_time: 4

sensor:

  • platform: “OctopusAgile”

I removed the compoment and re-added but still comes up with yours

I’ve updated the card to remove the seconds and have added an extra option in the config to allow you to remove the units.

Pull down the latest and add showunits: 'false' to the card config. Hopefully that is better for you, let me know if you have any other ideas!

I’ve just had a quick look and it’s throwing an error for me when I use your config, I’ll take a better look and see if I can work out why.

@matthewjporter, Your thoughts make sense… I’ve started looking at pulling octocost into my code as @badguy and I discussed earlier, I’m not precious about my code either though so happy for it to go wherever ends up being the best place.

1 Like

Ah, thanks for that. Unfortunately, it doesn’t seem to work :grimacing: Renaming the previous version and cloning the updated version, I get:

Invalid config
The following integrations and platforms could not be set up:

OctopusAgile
OctopusAgile.sensor
Please check your config.

That is with the same config for the updated version, as I was using with the previous version, no addition of the new options. The card disappears from the dashboard.

Swapping back (renaming old/new configs) resumes normal operation, no errors, although the database then appears outdated with the display of prices going back some hours. After the next 30 minute update, the hours display correctly.

Ah, my bad! I was looking at the octocost stuff so had added in the mpan, serial and auth into the config and didn’t put a check to ignore them if they weren’t there. If you add them into your config as below under octopusagile I think it should work.

OctopusAgile
  mpan: yourmpan
  serial: yourserial
  auth: yourauth 

Sorry about that! I will add a check in so it doesn’t break if you don’t have them set

Great card and custom component Mark, just what I’d been looking for. Ended up making a couple of modifications for rounding the prices to 2 decimal places and setting the -ve prices to blue.

1 Like

Sorry, I still can’t make it work, even with the additions.

Looking at @ianm 's remarks, a config option for n decimal places would be nice. Four decimal places is not particularly useful and it would be another item reducing screen space.

Also agree that another colour for negative prices would be good.

I forgot about the start date… just confirmed it failed to load without that. Sorry for breaking that, I shouldn’t have merged it in! If that doesn’t work I’ll revert the changes I did yesterday until I’ve made it a bit more robust.

OctopusAgile:
  region_code: "L"
  mpan: 00000000
  serial: 00000000
  auth: abc00000000
  startdate: "2020-05-08"

Sounds great! I had thought about the -ve prices but hadn’t worked out a good way to highlight them. Rounded decimals sounds sensible too. Did you want to put a pull request in or send the changes over to me to save me doing the same?

I have several entities created but not octopusagile.rates any idea why ?

I also saw this in the log…

Unable to find services.yaml for the octopusagile integration
and
2020-05-15 04:30:00 ERROR (SyncWorker_5) [custom_components.OctopusAgile] ‘run_devices’

I think you’ve hit the same bug as somebody else. If you call the octopusagile.update_timer service followed by the octopusagile.half_hour service manually it should kick in. Just make sure you don’t have any timers that have to run in a period that doesn’t have any rates released.
Once it’s been running for a day it should sort itself out. I’m having a think about the best way to fix the bug!
The error about services.yaml shouldn’t cause any issues, I do need to fix that though.

I added the start date, which lets the setup run and display the rates, but seconds still display and showunits has no effect (no change to display, no error).

Others are coming forward with ideas and fixes, so makes sense for you to have time for a re-think. Your efforts are appreciated.

Did you copy agile-rates-card.js into the www directory in your config directory? I also found that I had to clear the cache for changes to take affect. If you’re using the app there is an option in the app config menu, in a browser the usual clear cache worked.

Ah yes, flush cache did the deed. I had done a force page reload but that did nothing. Whew. Thanks.

1 Like

No problem, I’ve created a pull request in Github for the changes.

Trying to install just your stuff and getting errors as above, is there any changes needed to install since last week?

Not to fussed about adding the my octopus usage, bit pointless when its sometimes 4 days late :stuck_out_tongue:

Thanks for the work