Red Energy Australia

Red Energy has finally released a mobile app (android, ios) to help track usage on the account directly.

I have sent in an inquiry asking them to allow access to this data via an integration for HA. I am sure if there is enough people that request this they may work on it or someone can try get something working via a custom integration.

2 Likes

this would be amazing! i just learned about the app today and would be awsome to automate based on my electricity usage. so much info avaliable in the app.

Yea its been a great app for checking in periodically and I do plan to have a shelly 3EM installed at the meter for my unit when I finally find someone that has the key for access to give me a validation data set to make sure its all reading correctly anyways.

I’m able to dig down as far as hourly usage which is nice.

Unfortunately there is no pricing data in the app that I can see, nor is there any mention of an API on their website. Not sure if it would be possible to integrate this one at the moment. Did you ever hear back from them @TH3xR34P3R ?

The only thing is that they said thank you for the interest and its something they may look into in the future, just your bog standard response with these things.

2 Likes

This implies that there is a API available:

Nice find, hopefully someone is able to take advantage of it and make an integration that knows how to make one.

Any updates? Wish I knew how to program, might be a good test for copilot :grinning:

Ive started to decompile their mobile app and see if i can work it out, but cant find anything helpful yet.

I might borrow my wifes iphone over the xmas period and see if i can MITMproxy the required data.

The app doesnt seem to have pricing, but it does have consumption data in it.

If anyone here has an iOS device, knows how to use MITMproxy and wants to assist, DM me as I wont get to that bit for a week or 2.

Hey, I did a quick introspection of the iPhone app traffic. Here’s a short summary:

It uses OAuth 2.0 / OpenID Connect flow, with okta (when using a username and password).

POST to https://redenergy.okta.com/api/v1/authn
with request body:

{
  "password": "xxxx",
  "username": "[email protected]",
  "options": {
    "warnBeforePasswordExpired": false,
    "multiOptionalFactorEnroll": false
  }
}

returns a response with a session token.

Requests discovery document:
GET https://login.redenergy.com.au/oauth2/default/.well-known/openid-configuration

This returns the endpoints for login:

{
  "issuer": "https://login.redenergy.com.au/oauth2/default",
  "authorization_endpoint": "https://login.redenergy.com.au/oauth2/default/v1/authorize",
  "token_endpoint": "https://login.redenergy.com.au/oauth2/default/v1/token",
  "userinfo_endpoint": "https://login.redenergy.com.au/oauth2/default/v1/userinfo",
  "registration_endpoint": "https://login.redenergy.com.au/oauth2/v1/clients",
  "jwks_uri": "https://login.redenergy.com.au/oauth2/default/v1/keys",
  ...
}

Sends auth request with locally generated nonce, and session token to:
GET /oauth2/default/v1/authorize?nonce=6jl-XNAylmt...

Returns a short lived auth code in the response.

Client sends POST https://login.redenergy.com.au/oauth2/default/v1/token

and receives back a JSON response with access token, refresh token etc.

An Oauth python library should make most of the above straight forward

From here, you can do a GET to https://selfservice.services.retail.energy/v1/customers/current
(there are other endpoints, but this one seems to have the data we’re interested in)

Response
(personal details removed)

{
  "currentUsage": {
    "fromDate": "2027-12-18",
    "toDate": "2028-01-15",
    "consumptionMj": 0.000,
    "consumptionKwh": 213.974,
    "isConsumptionDollarGstInclusive": false,
    "consumptionDollar": 85.38,
    "generationKwh": 50.659,
    "generationDollar": -2.53,
    "demandCharges": [],
    "maxDemand": 0.000,
    "demandUom": null,
    "demandDollar": 0.00,
    "carbonEmissionTonne": 0.2469,
    "isPricingReliable": true,
    "pricingUnavailabilityReasons": [],
    "averageMinTemperatureC": 0.0,
    "averageMaxTemperatureC": 0.0,
    "serviceToPropertyDollar": 26.00,
    "potdDollar": 0.00,
    "gstDollar": 10.90,
    "totalChargesDollar": 117.14,
    "demandKw": 0.000
  },
  "estimatedUsage": {
    "fromDate": "2024-12-18",
    "toDate": "2025-03-17",
    "consumptionMj": 0.000,
    "consumptionKwh": 1200.333,
    "isConsumptionDollarGstInclusive": false,
    "consumptionDollar": 264.98,
    "generationKwh": 157.218,
    "generationDollar": -7.85,
    "demandCharges": [],
    "maxDemand": 0.000,
    "demandUom": null,
    "demandDollar": 0.00,
    "carbonEmissionTonne": 0.7662,
    "isPricingReliable": false,
    "pricingUnavailabilityReasons": [
      "PRICING_IS_ESTIMATED_ONLY"
    ],
    "averageMinTemperatureC": 0.0,
    "averageMaxTemperatureC": 0.0,
    "serviceToPropertyDollar": 80.69,
    "potdDollar": 0.00,
    "gstDollar": 33.83,
    "totalChargesDollar": 300.54,
    "demandKw": 0.000
  },
  "estimationStatus": "STANDARD_ESTIMATE",
  "latestBillPeriodUsageTrendPercent": -32.8,
  "billedUsageTrend": {
    "asOfDate": "2025-01-16",
    "latestBillPeriodUsageTrendPercent": -32.8,
    "priorBillSummary": {
      "billId": "742Evergreen|3",
      "invoiceNumber": 987654321,
      "fromDate": "2024-06-20",
      "toDate": "2024-09-18",
      "consumptionKwh": 1150.000,
      "consumptionMj": 0.000
    },
    "latestBillSummary": {
      "billId": "742Evergreen|4",
      "invoiceNumber": 123456789,
      "fromDate": "2024-09-19",
      "toDate": "2024-12-17",
      "consumptionKwh": 773.000,
      "consumptionMj": 0.000
    }
  },
  "latestUsageDate": "2025-01-15",
  "estimationType": "PRESENT",
  "asOfDate": "2025-01-16",
  "currentUsageExplanation": {
    "summary": "Usage is actual usage since consumer has an INTERVAL meter and GCMDS data is complete for the period",
    "detail": ""
  },
  "projectedUsageExplanation": {
    "summary": "Usage has been estimated by scaling 29 days actual usage to 90 days",
    "detail": "Multiplying factor = 3.1034"
  },
  "estimationAlgorithmVersion": "V3_0"
}

Hope this helps!