ElexonPCLIfrom SopherApps
  • Name ElexonPCLI
  • Summary A commandline app getting realtime data from Elexon, processing it and availing it to other apps in realtime via Server-side events
  • Price (Monthly) 5,000,000 UGX
  • Free Trial 7 days
  • Category ETL
  • Tags queue elexon bmrs extract
  • Download

What ElexonPCLI is:

ElexonPCLI should not be confused with ElexonRCLI. The former is for the Data Push realtime service while the latter is for the REST API of Elexon's BMRS service.

ElexonPCLI is a commandline application built with love by SopherApps, by the grace of God. Its main purpose is to process in realtime the data Elexon, a UK National Grid Monitoring Agency provides in realtime via its BMRS Data Push Service.

ElexonPCLI then makes the processed data available to any other applications, as well as simultaneously saving it to a postgreSQL database chosen by the user.

Applications that need to connect to a running instance of ElexonPCLI just need to connect via an HTTP URL with a unique subscriberId passed in as a query parameter.

As soon as any of those applications connect, processed data is pushed to them by that ElexonPCLI as soon as it comes.

Even when those applications disconnect, they have a time frame chosen by the user in which they can connect again to ElexonPCLI and receive any data they would have missed. ElexonPCLI immediately recognises them by the subscriberId they passed.

These applications need not be server apps. Even a browser can receive that data. In fact, it is the browser that was used intensively for testing the app. The subscribing applications can be written in any language. They can be hosted on any server including the very server where ElexonPCLI is running.

ElexonPCLI can even run on your local PC (Personal Computer) as long as it has any of Linux, Windows or MacOS operating systems.

ElexonPCLI comes with its own set of commands including a 'help' section and even an ability to update itself when a new version is released.

ElexonPCLI help in action

What Elexon is:

Just for those of us who may not know; United Kingdom has a decentralized way of balancing their electricity grid. That mechanism allows a number of players to buy and sell electricity, even when they don't have physical generation plants. Elexon provides the data that helps such players make the best buying or selling decisions they can make.

This decentralized way of balancing the electricity grid is normal in Europe.

You can get more information about Elexon from their official website.

  • CLI: A fully-fledged CLI app with a help section
  • PostgreSQL persistent: ElexonPCLI saves the realtime data to a PostgreSQL database as soon as it is received.
  • Durable Connection: Even when ElexonPCLI is stopped for less than 2 days, on restart, it processes all messages missed.
  • Pub/Sub Ability: ElexonPCLI Disperses processed data to an unlimited number of other subscriber apps via Server-side events and a simple HTTP URL. These can go on and do extra processing.
  • Automatic Updates: At start up, it checks for new updated versions automatically and advises the user to download if there are new versions. It continues to do these checks even when running and alerts the user when new versions are released.
  • Pub/Sub persistence: Even when a subscribing app goes off for a time lower than the 'ttl' flag setting (default 1.5 days), on reconnection, all data it missed would be passed to it.
  • Configurable: Almost everything about ElexonPCLI can be reconfigured. However, it comes with sensible defaults to get you running quickly.
  • Available for Major OS: Binaries for Linux, Windows and MacOS (Darwin) have been provided.
Quick Start

The application has been built for particular operating systems and architecture. The operating systems include: Linux, Windows or MacOs. The most common architecture is amd64. Start with that. If it fails then try other architecture.

  • Download the executable file. To download, go to the downloads section below and choose the version, the operating system and the architecture you want. In this section, we are assuming a UNIX system. For windows the file will be 'elexonpcli.exe'.
  • Open your terminal (command line) and change your directory to the place where you downloaded the app. For example for Ubuntu, it might be:

cd ~/Downloads

  • In case you just wish to run the application on local PC, you can skip the next three steps.
  • To push the executable file to your Linux debian/ubuntu server if you wish to run the app on a server, you can use the scp command. For example for a server with user 'soppy' and IP address '' with a folder 'apps', you can do:

scp elexonpcli soppy@

  • Log into your Linux debian/ubuntu server's terminal

ssh soppy@

  • Enter your the directory where you pushed the file. For our example, it was 'apps'

cd apps

  • Ensure you have already registered with Elexon and you have an Elexon Scripting key. You can register or login with Elexon via the elexon portal. More instructions can be found in their bmrs api data push user guide.
  • Run the application using the run command. For example if my Elexon scripting key is 'sopherflous' and my postgreSQL db is hosted on a server of IP address '' running on port '5432' and the database name is 'elly_db' and the db user is 'posty' then

./elexonpcli run --key sopherflous --dbhost --dbport 5432 --dbname elly_db --dbuser posty

  • Don't worry about having to remember all these flags. They can all be seen by running the help command.

./elexonpcli help

  • That command will also show you that you can use abbreviated flags. For example for the command we ran earlier, it could have easily been run as:

./elexonpcli run -k sopherflous -H -P 5432 -N elly_db -U posty

  • You can even go further and reduce the command to only have your scripting key and the database name if your database is on the same machine (localhost) and the database user 'postgres' still exists and has enough privileges. The command we had earlier thus becomes:

./elexonpcli run -k sopherflous -N elly_db

  • When the above command runs, you will be asked to feed in the password of the database user you have opted to use and then the processing will start. The terminal will print a short description of every Elexon message received.
  • For a quick connection to the running ElexonPCLI, you can visit the link http://IP_ADDRESS>:8080?subscriberId=hottestSuperFly . For our example, it would be while for a local PC, it would be http://localhost:8080?subscriberId=hottestSuperFly
  • Other applications can connect to it using their HTTP packages or modules that allow connecting to servers with Server-side events enabled.
  • You can stop it by hitting 'Ctrl-C'
  • When your trial license expires, your application will stop and ask you to pay for the license. Please do pay for the license so that we can keep improving ElexonPCLI (and SopherApps itself).