Octopus Tracker

Not so much a question as posting a solution for anyone looking to extract daily Tracker energy prices for electricity and gas from the Octopus Energy API. It follows on from my solution to get the Octopus half-hourly rates for the Agile tariff.

I have 8 items to represent the unit rates and standing charge for electricity and gas for today and tomorrow. The standing charges only vary when the rules of the tariff change so you might not want to retrieve those regularly.

Items

// Octopus Tracker Rates

Number GasUnit0 "Gas Unit Rate Today [%.4fp]"
Number GasStanding0 "Gas Standing Charge Today [%.4fp]"
Number ElecUnit0 "Elec Unit Rate Today [%.4fp]"
Number ElecStanding0 "Elec Standing Charge Today [%.4fp]"
Number GasUnit1 "Gas Unit Rate Tomorrow [%.4fp]"
Number GasStanding1 "Gas Standing Charge Tomorrow [%.4fp]"
Number ElecUnit1 "Elec Unit Rate Tomorrow [%.4fp]"
Number ElecStanding1 "Elec Standing Charge Tomorrow [%.4fp]"

Rule

rule TrackerGetRates
when
        System started or               //run the rule at startup
        Time cron "0 15 16-20/1 1/1 * ? *" or   //and hourly from 4:15pm to 8:15pm when the rates for the next day should be updated
        Time cron "0 0 0 1/1 * ? *"             // at midnight to move the rates to the right day
then
        // Get today's rates
        val LocalDateTime today =  LocalDateTime.now();     //Today
        var String dateString = today.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))      //get today's date as a string to insert into the JsonPath transformation
        // Get Gas Rate Today
        val String TrackerJSONgas = sendHttpGetRequest("https://octopus.energy/api/v1/tracker/G-1R-SILVER-2017-1-B/daily/current/0/1/")
//      logWarn ("rules.TrackerGetRates", "Gas Response: "+TrackerJSONgas)
        val Number GasUnitToday = (Double::parseDouble(transform("JSONPATH", "$.periods[?(@.date == '"+dateString+"')].unit_rate", TrackerJSONgas)))    //extract the rate and convert to a number
        logWarn ("rules.TrackerGetRates", "Gas unit rate today: "+GasUnitToday.toString)
        val GasStandingToday = (Double::parseDouble(transform("JSONPATH", "$.periods[?(@.date == '"+dateString+"')].standing_charge", TrackerJSONgas))) //extract the standing charge and convert to a number
        logWarn ("rules.TrackerGetRates", "Gas Standing Charge today: "+GasStandingToday.toString)
        // Get Electricity Rate Today
        val String TrackerJSONelec = sendHttpGetRequest("https://octopus.energy/api/v1/tracker/E-1R-SILVER-2017-1-B/daily/current/0/1/")
//      logWarn ("rules.TrackerGetRates", "Elec Response: "+TrackerJSONelec)
        val ElecUnitToday = (Double::parseDouble(transform("JSONPATH", "$.periods[?(@.date == '"+dateString+"')].unit_rate", TrackerJSONelec)))        //extract the rate and convert to a number
        logWarn ("rules.TrackerGetRates", "Elec unit rate today: "+ElecUnitToday.toString)
        val ElecStandingToday = (Double::parseDouble(transform("JSONPATH", "$.periods[?(@.date == '"+dateString+"')].standing_charge", TrackerJSONelec)))       //extract the standing charge and convert to a number
        logWarn ("rules.TrackerGetRates", "Elec Standing Charge today: "+ElecStandingToday.toString)

        // Get tomorrow's rates
        val LocalDateTime tomorrow = today.plusDays(1);     //Plus 1 day
        dateString = tomorrow.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))      //get Tomorrow's date as a string to insert into the JsonPath transformation
        // Get Gas Rate Tomorrow
        val GasUnitTomorrow = (Double::parseDouble(transform("JSONPATH", "$.periods[?(@.date == '"+dateString+"')].unit_rate", TrackerJSONgas)))    //extract the rate and convert to a number
        logWarn ("rules.TrackerGetRates", "Gas unit rate Tomorrow: "+GasUnitTomorrow.toString)
        val GasStandingTomorrow = (Double::parseDouble(transform("JSONPATH", "$.periods[?(@.date == '"+dateString+"')].standing_charge", TrackerJSONgas)))  //extract the standing charge and convert to a number
        logWarn ("rules.TrackerGetRates", "Gas Standing Charge tomorrow: "+GasStandingTomorrow.toString)
        // Get Electricity Rate Tomorrow
        val ElecUnitTomorrow = (Double::parseDouble(transform("JSONPATH", "$.periods[?(@.date == '"+dateString+"')].unit_rate", TrackerJSONelec)))        //extract the rate and convert to a number
        logWarn ("rules.TrackerGetRates", "Elec unit rate tomorrow: "+ElecUnitTomorrow.toString)
        val ElecStandingTomorrow = (Double::parseDouble(transform("JSONPATH", "$.periods[?(@.date == '"+dateString+"')].standing_charge", TrackerJSONelec)))       //extract the standing charge and convert to a number
        logWarn ("rules.TrackerGetRates", "Elec Standing Charge tomorrow: "+ElecStandingTomorrow.toString)

        // Update the items
        GasUnit0.postUpdate(GasUnitToday)
        GasStanding0.postUpdate(GasStandingToday)
        ElecUnit0.postUpdate(ElecUnitToday)
        ElecStanding0.postUpdate(ElecStandingToday)
        GasUnit1.postUpdate(GasUnitTomorrow)
        GasStanding1.postUpdate(GasStandingTomorrow)
        ElecUnit1.postUpdate(ElecUnitTomorrow)
        ElecStanding1.postUpdate(ElecStandingTomorrow)
end

As with extracting anything from the Octopus API, you need to use the right product code. The codes seem to be the same across the country except that you need to amend them for your region. You’re looking for the letter that precedes the /daily in the URL. In my case it’s B.

The easiest way to find the correct letter is using the API to find the grid supply point for your postcode e.g.

https://api.octopus.energy/v1/industry/grid-supply-points/?postcode=SE1
1 Like

With PodPoint updating the beta app to include scheduled charging this is very good if we can use both together

Especially if you can work out how the app communicates with the server. You could get OpenHAB to pretend to be the app and set the charging schedule.

Hi All,

I’m getting a error in the rule code

dateString = tomorrow.format(DateTimeFormatter.ofPattern(“yyyy-MM-dd”))

Log:
2022-05-04 18:07:45.393 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID ‘Power-1’ failed: The name ‘DateTimeFormatter’ cannot be resolved to an item or type; line 9, column 46, length 17 in Power

Any help will be much appriciated.

From memory there are different implementations of the datetime in OH2 and OH3.

It’s working for me in v3.

@barneyd - May I please ask if you can send me your rule as is?

I don’t think it’s changed but just in case:

when
        System started or               //run the rule at startup
        Time cron "0 15 16-20/1 1/1 * ? *" or   //and hourly from 4:15pm to 8:15pm when the rates for the next day should be updated
        Time cron "0 0 0 1/1 * ? *"             // at midnight to move the rates to the right day
then
        // Get today's rates
        val LocalDateTime today =  LocalDateTime.now();     //Today
        var String dateString = today.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))      //get today's date as a string to insert into the JsonPath transformation
        // Get Gas Rate Today
        val String TrackerJSONgas = sendHttpGetRequest("https://octopus.energy/api/v1/tracker/G-1R-SILVER-2017-1-B/daily/current/0/1/")
//      logWarn ("rules.TrackerGetRates", "Gas Response: "+TrackerJSONgas)
        val Number GasUnitToday = (Double::parseDouble(transform("JSONPATH", "$.periods[?(@.date == '"+dateString+"')].unit_rate", TrackerJSONgas)))    //extract the rate and convert to a number
        logWarn ("rules.TrackerGetRates", "Gas unit rate today: "+GasUnitToday.toString)
        val GasStandingToday = (Double::parseDouble(transform("JSONPATH", "$.periods[?(@.date == '"+dateString+"')].standing_charge", TrackerJSONgas))) //extract the standing charge and convert to a number
        logWarn ("rules.TrackerGetRates", "Gas Standing Charge today: "+GasStandingToday.toString)
        // Get Electricity Rate Today
        val String TrackerJSONelec = sendHttpGetRequest("https://octopus.energy/api/v1/tracker/E-1R-SILVER-2017-1-B/daily/current/0/1/")
//      logWarn ("rules.TrackerGetRates", "Elec Response: "+TrackerJSONelec)
        val ElecUnitToday = (Double::parseDouble(transform("JSONPATH", "$.periods[?(@.date == '"+dateString+"')].unit_rate", TrackerJSONelec)))        //extract the rate and convert to a number
        logWarn ("rules.TrackerGetRates", "Elec unit rate today: "+ElecUnitToday.toString)
        val ElecStandingToday = (Double::parseDouble(transform("JSONPATH", "$.periods[?(@.date == '"+dateString+"')].standing_charge", TrackerJSONelec)))       //extract the standing charge and convert to a number
        logWarn ("rules.TrackerGetRates", "Elec Standing Charge today: "+ElecStandingToday.toString)

        // Get tomorrow's rates
        val LocalDateTime tomorrow = today.plusDays(1);     //Plus 1 day
        dateString = tomorrow.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))      //get Tomorrow's date as a string to insert into the JsonPath transformation
        // Get Gas Rate Tomorrow
        val GasUnitTomorrow = (Double::parseDouble(transform("JSONPATH", "$.periods[?(@.date == '"+dateString+"')].unit_rate", TrackerJSONgas)))    //extract the rate and convert to a number
        logWarn ("rules.TrackerGetRates", "Gas unit rate Tomorrow: "+GasUnitTomorrow.toString)
        val GasStandingTomorrow = (Double::parseDouble(transform("JSONPATH", "$.periods[?(@.date == '"+dateString+"')].standing_charge", TrackerJSONgas)))  //extract the standing charge and convert to a number
        logWarn ("rules.TrackerGetRates", "Gas Standing Charge tomorrow: "+GasStandingTomorrow.toString)
        // Get Electricity Rate Tomorrow
        val ElecUnitTomorrow = (Double::parseDouble(transform("JSONPATH", "$.periods[?(@.date == '"+dateString+"')].unit_rate", TrackerJSONelec)))        //extract the rate and convert to a number
        logWarn ("rules.TrackerGetRates", "Elec unit rate tomorrow: "+ElecUnitTomorrow.toString)
        val ElecStandingTomorrow = (Double::parseDouble(transform("JSONPATH", "$.periods[?(@.date == '"+dateString+"')].standing_charge", TrackerJSONelec)))       //extract the standing charge and convert to a number
        logWarn ("rules.TrackerGetRates", "Elec Standing Charge tomorrow: "+ElecStandingTomorrow.toString)

        // Update the items
        GasUnit0.postUpdate(GasUnitToday)
        GasStanding0.postUpdate(GasStandingToday)
        ElecUnit0.postUpdate(ElecUnitToday)
        ElecStanding0.postUpdate(ElecStandingToday)
        GasUnit1.postUpdate(GasUnitTomorrow)
        GasStanding1.postUpdate(GasStandingTomorrow)
        ElecUnit1.postUpdate(ElecUnitTomorrow)
        ElecStanding1.postUpdate(ElecStandingTomorrow)
end

I’m on v3.2.0

Thank you very much.

Cool. So I’m making some progress but still not there yet.

2022-05-12 14:12:22.891 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'power-2' failed: For input string: "{"count":44,"next":null,"previous":null,"results":[{"value_exc_vat":10.0,"value_inc_vat":10.5,"valid_from":"2022-05-12T21:30:00Z","valid_to":"2022-05-12T22:00:00Z"},{"value_exc_vat":14.4,"value_inc_vat":15.12,"valid_from":"2022-05-12T21:00:00Z","valid_to":"2022-05-12T21:30:00Z"},{"value_exc_vat":14.0,"value_inc_vat":14.7,"valid_from":"2022-05-12T20:30:00Z","valid_to":"2022-05-12T21:00:00Z"},{"value_exc_vat":16.96,"value_inc_vat":17.808,"valid_from":"2022-05-12T20:00:00Z","valid_to":"2022-05-12T20:30:00Z"},{"value_exc_vat":16.24,"value_inc_vat":17.052,"valid_from":"2022-05-12T19:30:00Z","valid_to":"2022-05-12T20:00:00Z"},{"value_exc_vat":17.1,"value_inc_vat":17.955,"valid_from":"2022-05-12T19:00:00Z","valid_to":"2022-05-12T19:30:00Z"},{"value_exc_vat":18.0,"value_inc_vat":18.9,"valid_from":"2022-05-12T18:30:00Z","valid_to":"2022-05-12T19:00:00Z"},{"value_exc_vat":20.0,"value_inc_vat":21.0,"valid_from":"2022-05-12T18:00:00Z","valid_to":"2022-05-12T18:30:00Z"},{"value_exc_vat":32.6,"value_inc_vat":34.23,"valid_from":"2022-05-12T17:30:00Z","valid_to":"2022-05-12T18:00:00Z"},{"value_exc_vat":30.96,"value_inc_vat":32.508,"valid_from":"2022-05-12T17:00:00Z","valid_to":"2022-05-12T17:30:00Z"},{"value_exc_vat":32.56,"value_inc_vat":34.188,"valid_from":"2022-05-12T16:30:00Z","valid_to":"2022-05-12T17:00:00Z"},{"value_exc_vat":28.74,"value_inc_vat":30.177,"valid_from":"2022-05-12T16:00:00Z","valid_to":"2022-05-12T16:30:00Z"},{"value_exc_vat":31.0,"value_inc_vat":32.55,"valid_from":"2022-05-12T15:30:00Z","valid_to":"2022-05-12T16:00:00Z"},{"value_exc_vat":25.4,"value_inc_vat":26.67,"valid_from":"2022-05-12T15:00:00Z","valid_to":"2022-05-12T15:30:00Z"},{"value_exc_vat":11.72,"value_inc_vat":12.306,"valid_from":"2022-05-12T14:30:00Z","valid_to":"2022-05-12T15:00:00Z"},{"value_exc_vat":11.0,"value_inc_vat":11.55,"valid_from":"2022-05-12T14:00:00Z","valid_to":"2022-05-12T14:30:00Z"},{"value_exc_vat":11.16,"value_inc_vat":11.718,"valid_from":"2022-05-12T13:30:00Z","valid_to":"2022-05-12T14:00:00Z"},{"value_exc_vat":11.4,"value_inc_vat":11.97,"valid_from":"2022-05-12T13:00:00Z","valid_to":"2022-05-12T13:30:00Z"},{"value_exc_vat":11.4,"value_inc_vat":11.97,"valid_from":"2022-05-12T12:30:00Z","valid_to":"2022-05-12T13:00:00Z"},{"value_exc_vat":13.0,"value_inc_vat":13.65,"valid_from":"2022-05-12T12:00:00Z","valid_to":"2022-05-12T12:30:00Z"},{"value_exc_vat":11.76,"value_inc_vat":12.348,"valid_from":"2022-05-12T11:30:00Z","valid_to":"2022-05-12T12:00:00Z"},{"value_exc_vat":12.1,"value_inc_vat":12.705,"valid_from":"2022-05-12T11:00:00Z","valid_to":"2022-05-12T11:30:00Z"},{"value_exc_vat":13.33,"value_inc_vat":13.9965,"valid_from":"2022-05-12T10:30:00Z","valid_to":"2022-05-12T11:00:00Z"},{"value_exc_vat":12.64,"value_inc_vat":13.272,"valid_from":"2022-05-12T10:00:00Z","valid_to":"2022-05-12T10:30:00Z"},{"value_exc_vat":14.4,"value_inc_vat":15.12,"valid_from":"2022-05-12T09:30:00Z","valid_to":"2022-05-12T10:00:00Z"},{"value_exc_vat":15.0,"value_inc_vat":15.75,"valid_from":"2022-05-12T09:00:00Z","valid_to":"2022-05-12T09:30:00Z"},{"value_exc_vat":18.56,"value_inc_vat":19.488,"valid_from":"2022-05-12T08:30:00Z","valid_to":"2022-05-12T09:00:00Z"},{"value_exc_vat":18.98,"value_inc_vat":19.929,"valid_from":"2022-05-12T08:00:00Z","valid_to":"2022-05-12T08:30:00Z"},{"value_exc_vat":20.94,"value_inc_vat":21.987,"valid_from":"2022-05-12T07:30:00Z","valid_to":"2022-05-12T08:00:00Z"},{"value_exc_vat":20.94,"value_inc_vat":21.987,"valid_from":"2022-05-12T07:00:00Z","valid_to":"2022-05-12T07:30:00Z"},{"value_exc_vat":22.8,"value_inc_vat":23.94,"valid_from":"2022-05-12T06:30:00Z","valid_to":"2022-05-12T07:00:00Z"},{"value_exc_vat":22.8,"value_inc_vat":23.94,"valid_from":"2022-05-12T06:00:00Z","valid_to":"2022-05-12T06:30:00Z"},{"value_exc_vat":16.94,"value_inc_vat":17.787,"valid_from":"2022-05-12T05:30:00Z","valid_to":"2022-05-12T06:00:00Z"},{"value_exc_vat":14.74,"value_inc_vat":15.477,"valid_from":"2022-05-12T05:00:00Z","valid_to":"2022-05-12T05:30:00Z"},{"value_exc_vat":12.0,"value_inc_vat":12.6,"valid_from":"2022-05-12T04:30:00Z","valid_to":"2022-05-12T05:00:00Z"},{"value_exc_vat":12.0,"value_inc_vat":12.6,"valid_from":"2022-05-12T04:00:00Z","valid_to":"2022-05-12T04:30:00Z"},{"value_exc_vat":14.0,"value_inc_vat":14.7,"valid_from":"2022-05-12T03:30:00Z","valid_to":"2022-05-12T04:00:00Z"},{"value_exc_vat":14.3,"value_inc_vat":15.015,"valid_from":"2022-05-12T03:00:00Z","valid_to":"2022-05-12T03:30:00Z"},{"value_exc_vat":14.2,"value_inc_vat":14.91,"valid_from":"2022-05-12T02:30:00Z","valid_to":"2022-05-12T03:00:00Z"},{"value_exc_vat":14.3,"value_inc_vat":15.015,"valid_from":"2022-05-12T02:00:00Z","valid_to":"2022-05-12T02:30:00Z"},{"value_exc_vat":14.15,"value_inc_vat":14.8575,"valid_from":"2022-05-12T01:30:00Z","valid_to":"2022-05-12T02:00:00Z"},{"value_exc_vat":14.3,"value_inc_vat":15.015,"valid_from":"2022-05-12T01:00:00Z","valid_to":"2022-05-12T01:30:00Z"},{"value_exc_vat":14.3,"value_inc_vat":15.015,"valid_from":"2022-05-12T00:30:00Z","valid_to":"2022-05-12T01:00:00Z"},{"value_exc_vat":14.06,"value_inc_vat":14.763,"valid_from":"2022-05-12T00:00:00Z","valid_to":"2022-05-12T00:30:00Z"}]}" in power

The error message just says the rule didn’t work. Looking at it, it was for electricity portion of the rule. Did the gas one work ok?

The json result looks odd because the price seems different for each half hour and the field name is “value_exc_vat” not “unit_rate” so the rule can’t find what it is searching for.

I get a completely different (and working) json array from the url in the example rule. Have you changed anything?

Hi there. Other the time modivication, no other changes.
RulePreformatrule TrackerGetRates
when
System started or //run the rule at startup
Time cron “0 15 16-20/1 1/1 * ? *” or //and hourly from 4:15pm to 8:15pm when the rates for the next day should be updated
Time cron “0 0 0 1/1 * ? *” // at midnight to move the rates to the right day
then
// Get today’s rates
var LocalDateTime today = LocalDateTime.now(); //Today
//var String dateString = today.format(DateTimeFormatter.ofPattern(“yyyy-MM-dd”)) //get today’s date as a string to insert into the JsonPath transformation - old
val String dateString = String::format( “%1$tY-%1$tm-%1$td”, new java.util.Date ) //get today’s date as a string to insert into the url- new
// Get Gas Rate Today
val String TrackerJSONgas = sendHttpGetRequest(“https://octopus.energy/api/v1/tracker/G-1R-SILVER-2017-1-B/daily/current/0/1/”)
// logWarn (“rules.TrackerGetRates”, “Gas Response: “+TrackerJSONgas)
val Number GasUnitToday = (Double::parseDouble(transform(“JSONPATH”, “$.periods[?(@.date == '”+dateString+”’)].unit_rate”, TrackerJSONgas))) //extract the rate and convert to a number
logWarn (“rules.TrackerGetRates”, “Gas unit rate today: “+GasUnitToday.toString)
val GasStandingToday = (Double::parseDouble(transform(“JSONPATH”, “$.periods[?(@.date == '”+dateString+”’)].standing_charge”, TrackerJSONgas))) //extract the standing charge and convert to a number
logWarn (“rules.TrackerGetRates”, "Gas Standing Charge today: "+GasStandingToday.toString)
// Get Electricity Rate Today
val String TrackerJSONelec = sendHttpGetRequest(“https://octopus.energy/api/v1/tracker/E-1R-SILVER-2017-1-B/daily/current/0/1/”)
// logWarn (“rules.TrackerGetRates”, “Elec Response: “+TrackerJSONelec)
val ElecUnitToday = (Double::parseDouble(transform(“JSONPATH”, “$.periods[?(@.date == '”+dateString+”’)].unit_rate”, TrackerJSONelec))) //extract the rate and convert to a number
logWarn (“rules.TrackerGetRates”, “Elec unit rate today: “+ElecUnitToday.toString)
val ElecStandingToday = (Double::parseDouble(transform(“JSONPATH”, “$.periods[?(@.date == '”+dateString+”’)].standing_charge”, TrackerJSONelec))) //extract the standing charge and convert to a number
logWarn (“rules.TrackerGetRates”, "Elec Standing Charge today: "+ElecStandingToday.toString)

    // Get tomorrow's rates
    val LocalDateTime tomorrow = today.plusDays(1);     //Plus 1 day
    dateString = tomorrow.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))      //get Tomorrow's date as a string to insert into the JsonPath transformation
    // Get Gas Rate Tomorrow
    val GasUnitTomorrow = (Double::parseDouble(transform("JSONPATH", "$.periods[?(@.date == '"+dateString+"')].unit_rate", TrackerJSONgas)))    //extract the rate and convert to a number
    logWarn ("rules.TrackerGetRates", "Gas unit rate Tomorrow: "+GasUnitTomorrow.toString)
    val GasStandingTomorrow = (Double::parseDouble(transform("JSONPATH", "$.periods[?(@.date == '"+dateString+"')].standing_charge", TrackerJSONgas)))  //extract the standing charge and convert to a number
    logWarn ("rules.TrackerGetRates", "Gas Standing Charge tomorrow: "+GasStandingTomorrow.toString)
    // Get Electricity Rate Tomorrow
    val ElecUnitTomorrow = (Double::parseDouble(transform("JSONPATH", "$.periods[?(@.date == '"+dateString+"')].unit_rate", TrackerJSONelec)))        //extract the rate and convert to a number
    logWarn ("rules.TrackerGetRates", "Elec unit rate tomorrow: "+ElecUnitTomorrow.toString)
    val ElecStandingTomorrow = (Double::parseDouble(transform("JSONPATH", "$.periods[?(@.date == '"+dateString+"')].standing_charge", TrackerJSONelec)))       //extract the standing charge and convert to a number
    logWarn ("rules.TrackerGetRates", "Elec Standing Charge tomorrow: "+ElecStandingTomorrow.toString)

    // Update the items
    GasUnit0.postUpdate(GasUnitToday)
    GasStanding0.postUpdate(GasStandingToday)
    ElecUnit0.postUpdate(ElecUnitToday)
    ElecStanding0.postUpdate(ElecStandingToday)
    GasUnit1.postUpdate(GasUnitTomorrow)
    GasStanding1.postUpdate(GasStandingTomorrow)
    ElecUnit1.postUpdate(ElecUnitTomorrow)
    ElecStanding1.postUpdate(ElecStandingTomorrow)

end
ted text

ThingAgile.url=https://api.octopus.energy/v1/products/AGILE-18-02-21/electricity-tariffs/E-1R-AGILE-18-02-21-B/standard-unit-rates/?page_size=48 Agile.updateInterval=14400000

items

// Octopus Tracker Rates

Number GasUnit0 "Gas Unit Rate Today [%.4fp]"
Number GasStanding0 "Gas Standing Charge Today [%.4fp]"
Number ElecUnit0 "Elec Unit Rate Today [%.4fp]"
Number ElecStanding0 "Elec Standing Charge Today [%.4fp]"
Number GasUnit1 "Gas Unit Rate Tomorrow [%.4fp]"
Number GasStanding1 "Gas Standing Charge Tomorrow [%.4fp]"
Number ElecUnit1 "Elec Unit Rate Tomorrow [%.4fp]"
Number ElecStanding1 "Elec Standing Charge Tomorrow [%.4fp]"



Thanks for your help with this!

Hi All,

I don’t suppose anyone has done similar to produce items to pull values of their consumption via the Octopus API?
I am about to start this by adapting your work @barneyd pulling from
https://api.octopus.energy/v1/electricity-meter-points/mynumber/meters/mynumber/consumption/
and
https://api.octopus.energy/v1/gas-meter-points/mynumber/meters/mynumber/consumption/
I’m looking for pointers really but I don’t think I’m wrong in thinking I can just modify the above method to do this?

{"count":5712,"next":"https://api.octopus.energy/v1/gas-meter-points/555197800/meters/E6S10595681961/consumption/?page=2","previous":null,"results":[{"consumption":0.0,"interval_start":"2023-06-30T00:30:00+01:00","interval_end":"2023-06-30T01:00:00+01:00"},{"consumption":0.0,"interval_start":"2023-06-30T00:00:00+01:00","interval_end":"2023-06-30T00:30:00+01:00"},{"consumption":0.0,"interval_start":"2023-06-29T23:30:00+01:00","interval_end":"2023-06-30T00:00:00+01:00"},{"consumption":0.0,"interval_start":"2023-06-29T23:00:00+01:00","interval_end":"2023-06-29T23:30:00+01:00"},{"consumption":0.0,"interval_start":"2023-06-29T22:30:00+01:00","interval_end":"2023-06-29T23:00:00+01:00"},{"consumption":0.0,"interval_start":"2023-06-29T22:00:00+01:00","interval_end":"2023-06-29T22:30:00+01:00"},{"consumption":0.005,"interval_start":"2023-06-29T21:30:00+01:00","interval_end":"2023-06-29T22:00:00+01:00"},{"consumption":0.0,"interval_start":"2023-06-29T21:00:00+01:00","interval_end":"2023-06-29T21:30:00+01:00"},{"consumption":0.06,"interval_start":"2023-06-29T20:30:00+01:00","interval_end":"2023-06-29T21:00:00+01:00"},

Thanks in advance