An open API service indexing awesome lists of open source software.

https://github.com/craigpeacock/aemo_parser

AEMO (Australian Energy Market Operator) Parser for Electricity Pool Price Data
https://github.com/craigpeacock/aemo_parser

aemo mqtt

Last synced: 14 days ago
JSON representation

AEMO (Australian Energy Market Operator) Parser for Electricity Pool Price Data

Awesome Lists containing this project

README

          

# AEMO <-> MQTT Parser/Connector
The Australian Energy Market Operator (AEMO) publishes 5 minute settlement data for the National Electricity Market (NEM) in a JSON file located at
https://visualisations.aemo.com.au/aemo/apps/api/report/ELEC_NEM_SUMMARY

This JSON file includes price and generation/demand data useful for making/scripting demand management decisions.

## Usage
```
./aemo -?
AEMO <-> MQTT Connector
Usage: aemo region [options]

Regions: NSW1, QLD1, SA1, TAS1, VIC1

Options:
-l Log to file
-m Log to MQTT Broker
-t MQTT topic
-u Username for MQTT Broker
-p Password for MQTT Broker
```

## Log File Format

The log will have the following format:

[local time],[number of tries],[settlement time],[price],[total demand],[net interchange],[scheduled generation],[semi scheduled generation]

e.g. 2022-02-21 17:20:22,1,2022-02-22 11:25:00,-38.47,604.96,59.80,80.00,580.52

Local Time: 2022-02-21 17:20:22

Number of Tries: 1

Settlement Time: 2022-02-22 11:25:00

Price: -38.47 (Dollars)

Total Demand: 604.96 (MW)

Net Interchange: 59.80 (MW) - Power being imported/exported from region via interconnector(s)

Scheduled Generation: 80.00 (MW) - Typically baseload fossil fuel

Semi Scheduled Generation: 580.52 (MW) - Typically variable renewable energy

## Dependencies
This code uses the following libraries
* cURL (https://curl.haxx.se/)
* Requires OpenSSL for https support (https://www.openssl.org/)
* cJSON (https://github.com/DaveGamble/cJSON)
* Eclipse paho MQTT library (https://www.eclipse.org/paho/)
* Requires OpenSSL

Install using package manager:
```
sudo apt-get install libpaho-mqtt-dev libcurlpp-dev libcjson-dev
```
Or build from code:

### Install OpenSSL
```sh
$ wget https://www.openssl.org/source/openssl-1.1.1m.tar.gz
$ tar -xzf openssl-1.1.1m.tar.gz
$ cd openssl-1.1.1m/
$ ./config
$ make
$ sudo make install
```

### Install cURL
```sh
$ wget https://curl.se/download/curl-7.81.0.tar.gz
$ tar -xzf curl-7.81.0.tar.gz
$ cd curl-7.81.0
$ ./configure --with-openssl
$ make
$ sudo make install
```
### Install cJSON
```sh
$ wget https://github.com/DaveGamble/cJSON/archive/refs/tags/v1.7.15.tar.gz
$ tar -xzf v1.7.15.tar.gz
$ cd cJSON-1.7.15
$ make
$ sudo make install
```

### Install paho libraries
```
$ wget https://github.com/eclipse/paho.mqtt.c/archive/refs/tags/v1.3.9.tar.gz
$ tar -xzf v1.3.9.tar.gz
$ cd paho.mqtt.c-1.3.9
$ make
$ sudo make install
```

## Potential errors
### Error loading shared libraries
If you get the following error message
```
error while loading shared libraries: libcjson.so.1: cannot open shared object file: No such file or directory
```
execute
```
$ sudo ldconfig -v
```
### Unsupported protocol
If you get this message
```
curl_easy_perform() failed: Unsupported protocol
```
It may be because curl hasn't been compiled with SSL. Run
```
$ curl -V
```
and check if https is listed as a protocol. If not, you may not have OpenSSL installed correctly.