Live Octopus Cosy price

Hi all,

I’m trying to get a live Octopus Cosy rate into emoncms using the octopus api, nodered and lots of nice examples from this community.

For anybody not familiar, this is not a fully agile tariff, but one that changes several times throughout the day for the benefit of heat pump owners (see image below).

However whatever i do i’m only able to return the offpeak rate (16.9p) vs. the current rate for that time of day. Am i doing something wrong here or is this a limitation in the API? I had expected it to behave in the same way as the Agile tarrif and replicate data available from energy-stats.uk below, but perhaps i’m mistaken…

Pasting a debug screen from Node Red below, is this where one would expect to see the live price?

Many thanks indeed

Which endpoint are you querying? It looks like the one for tariff info.

You’ll want to be query the Agile unit rates, but for a Cosy tariff to get the price for every half-hour:

BASE_URL="https://api.octopus.energy"
PRODUCT_CODE="COSY-22-12-08"
TARIFF_CODE="E-1R-$PRODUCT_CODE-J"
TARIFF_URL="$BASE_URL/v1/products/$PRODUCT_CODE/electricity-tariffs/$TARIFF_CODE/standard-unit-rates/"
1 Like

Thanks very much, i was obviously using the wrong approach previously as i was simply calling the tariff details rather than agile unit rates as you suggest. Are you calling Agile rates yourself, @Timbones? Very interested in how you’re achieving this if so e.g. nodered etc.

I’ve written a script to import the data into my own instance.

I don’t know how to do it with NodeRed. @borpin might.

thanks again, this was a great help - the new URL you provided is now getting me rates over time. my next task will be to twiddle with NR to get this down to a current rate from the wealth of info it retrieves.

I just discovered @borpin 's very nice existing Node contribution which works a treat. Now to see whether it’s possible to modify it’s Product Code to Cosy. I will ask on the related thread.

Just a warning, the tariff is hardcoded so is the original rate currently. Need to remember how to do the front end and provide the ability to select the rate required!

Do you use HA? If so the Octopus Component is very good.

1 Like