Friday, May 15, 2026

Get real-time electricity consumption from Octopus Home Mini

I recently switched to an Octopus energy account as they provide a device to allow you to access your real-time electricity consumption from your smart meter. On request Octopus will provide a free Home Mini device which connects to your smart meter with ZigBee and to your home Wi-Fi to upload your electricity consumption every 10 seconds.

If you'd like to switch to Octopus you can use my referral code for a £50 discount https://share.octopus.energy/playful-engine-680

To access the real-time data you query the Octopus API using GraphQL format HTTPS Posts.

To start you need the following: your Octopus account number (A-AAAA1111 format) and your Octopus API Key which you can create here. The API key is like a password so don't reveal it to anyone. If necessary, you can regenerate the key using the same link.

There are 3 steps:

Step 1

Get a Kraken bearer token using the following query. The token lasts for 1 hour before a new, or refreshed, one is required.

URL

https://api.octopus.energy/v1/graphql/

Query

mutation ObtainKrakenToken {

    obtainKrakenToken(input: { APIKey: "sk_live_Your developer API key" }) {

        token

        payload

        refreshToken

        refreshExpiresIn

    }

}

Authentication

None

The result will be as shown below. You only need the text of the long token string.

{

    "data": {

        "obtainKrakenToken": {

            "token": "eyJhbGciOiJSUzI1NiIsImlzcyI6Imh0dHBzOi8vYXBpLm9jdG9wdXMuZW5lcmd5L3YxL2dyYXBocWwvIiwiamt1IjoiaHR0cHM6Ly9hdXRoLm9jdG9wdXMuZW5lcmd5Ly53ZWxsLWtub3duL2p3a3MuanNvbiIsImtpZCI6InFRb3hIbzhiTF91Wi1NdE9kQ2labDZacjFaMWsyM1l2Y0taZnU5QldHNkEiLCJ0eXAiOiJKV1QifQ.eyJzdWIiOiJrcmFrZW58YWNjb3VudC11c2VyOjEzMjMyODc3IiwiZ3R5IjoiQVBJLUtFWSIsImVtYWlsIjoiYW5kcmV3LmpvbmVzQGFscXVpc3QuY28udWsiLCJ0b2tlblVzZSI6ImFjY09090909sd09sd09s0d9pLm9jdG9wdXMuZW5lcmd5L3YxL2dyYXBocWwvIiwiaWF0IjoxNzc4ODczMjA1LCJleHAiOjE3Nzg4NzY4MDUsIm9yaWdJYXQiOjE3Nzg4NzMyMDV9.ABJbgP0gvh68SqNx-GGXGVq4_WSbZ6vqfWb9veWYV0mHojyMkW-EqMUMhVrtvIFYhyom4qbWodfnAGrNIh0akpauzCJG-6qFa8Noynuibqlu4RmoVThYbIOUGbqO6p-VQmKPACKuhimfCzntU2m_Gh2uNr8Tbsx5pqXPnGp6S10LQm1eJvrKmJ4ca1PDh53lx75zgDo-JjARKXm4M4JHbjN5D4TlfJ7fPGlrZktafYad9XwvN1DraAutB4Ur-8ogCpVo7IoBWnnN7gaJCFSEALfi03_wb6ydx-Kb0qnbpKyi-DkJYCn-8EFowQEfA2SKgHMz8nPAN0e58Cb385bS1Q",

            "payload": {

                "sub": "kraken|account-user:000000",

                "gty": "API-KEY",

                "email": "andrew@000000",

                "tokenUse": "access",

                "iss": "https://api.octopus.energy/v1/graphql/",

                "iat": 1778873205,

                "exp": 1778876805,

                "origIat": 1778873205

            },

            "refreshToken": "faff3b0d2700cc9cd6c2fc8d000000e31466dd0daea2149d4c2c68f1",

            "refreshExpiresIn": 1779478005

        }

    }

}

Step 2

You need to establish the deviceId for your electricity meter. Using your Account Number and the bearer token from step 1. I think you only need to do this once as I don't think the deviceId changes.

URL

https://api.octopus.energy/v1/graphql/

Query

query MyQuery {

    account(accountNumber"A-YourAccountNumber") {

        electricityAgreements(activetrue) {

            meterPoint {

                meters(includeInactivefalse) {

                    smartDevices {

                        deviceId

                    }

                }

            }

        }

    }

}

Authentication

The bearer token from the step 1 above


The result will be as below, you'll need your deviceId for step 3.
{
    "data": {
        "account": {
            "electricityAgreements": [
                {
                    "meterPoint": {
                        "meters": [
                            {
                                "smartDevices": [
                                    {
                                        "deviceId""00-00-00-00-00-00-00-00"
                                    }
                                ]
                            }
                        ]
                    }
                }
            ]
        }
    }
}

Step 3

To read the real-time electricity consumption you need the bearer token from step 1 and the 8 byte deviceID from step 2

URL

https://api.octopus.energy/v1/graphql/

Query

query SmartMeterTelemetry {

    smartMeterTelemetry(deviceId: "Your deviceId from step 2") {

        readAt

        consumption

        demand

    }

}

Authentication

The bearer token from step 1

Your current consumption, in Watts, is in the demand field shown below. I've been making this request every 30 seconds and the API seems happy with that.

{
    "data": {
        "smartMeterTelemetry": [
            {
                "readAt""2026-05-15T17:14:50+00:00",
                "consumption""55667150",
                "demand""700"
            }
        ]
    }
}

Sunday, February 22, 2026

PowerPoint - text wrapping in the middle of words not at the space between words

Today I had a strange PowerPoint document where the text was wrapping in the middle of words rather than at the spaces between the words. Example below


There seems to be no way to fix this within Microsoft® PowerPoint® for Microsoft 365 MSO (Version 2602 Build 16.0.19725.20058) 64-bit [the latest version].

It appears this problem is caused by the document being saved when running on a machine with Asian language support (which I don't have installed).

The solution is as follows :-

1) Save the .pptx file to a folder on your PC (C:\Temp\PPT1.pptx in my example)

2) Rename the .pptx file to .zip (PPT1.zip in my example)

3) Use "Extract All" to extract all the files from the .zip file into a set of folders (creating C:\Temp\PPT1 folder and sub-folders in my example)

4) Use Notepad++ to "Replace in Files" with "In all sub-folders" enabled and replace all latinLnBrk="1" with latinLnBrk="0"


5) Use "Compress to" to zip up the contents of the folder to a new .zip file (PPT2.zip in my example)

6) Rename the .zip file to .pptx (PPT2.zip to PPT2.pptx in my example)

7) When you open the PowerPoint file (PPT2.pptx in my example) the text will now be correctly wrapped at the spaces between the words.
That was a whole lot more complex than it should be for a Sunday afternoon!

If anyone runs into this problem frequently let me know and I'll write a small app to fix the files.


Alternative method :
  1. From PowerPoint use File>Save As and change the Save as type to "PowerPoint XML Presentation (*.xml)".
  2. Open the XML file in NotePad
  3. Choose Edit>Replace
  4. In the Find what field, type latinLnBrk="1"
  5. In the Replace with field, type latinLnBrk="0"
  6. Choose Replace All
  7. Save the file and close NotePad
  8. Open PowerPoint and use File>Open to find and reopen the XML version. Resave in the normal PowerPoint pptx format. All English text will now break normally.