Because the powerpal mobile app is not open source, and does not provide a way to extract the API key and serial number from the device, this script was created to extract the API key and serial number from the device directly via Bluetooth Low Energy (BLE).
Once extracted, these credentials can be used to query your home's energy usage data straight from the official Powerpal API endpoints. Can be used with integrations like Home Assistant, Grafana, etc.
This script uses your computer's Bluetooth to connect to your Powerpal. It authenticates using your 6-digit pairing code, reads the specific GATT characteristics holding your Device Serial Number and API Key (UUID), and formats them for use.
- Python 3.7+
- A computer with Bluetooth enabled (Windows, macOS, or Linux)
- Your Powerpal's MAC Address (Format:
12:34:56:78:9A:BC) - Your Powerpal's 6-digit Pairing Code
Note: The MAC address and pairing code can typically be found printed on the device itself, on the original packaging card, or mostly within the settings of You can also find the MAC address within bluetooth settings on your phone or computer.
- Clone or download this repository.
- Install the required dependencies:
pip install -r requirements.txtDO NOT try to pair or connect to the Powerpal device through your computer's operating system Bluetooth menu.
The Powerpal device can only maintain one active Bluetooth connection at a time. In order for this script to work, you must ensure the Powerpal is completely disconnected from any other devices.
Before running the script:
- Ensure your computer's Bluetooth hardware is turned on.
- Disconnect your phone from the Powerpal device. The easiest way to do this is to fully close/kill the Powerpal mobile app on your smartphone, or temporarily turn off Bluetooth on your phone altogether.
- The Python script will handle the Bluetooth connection directly. make sure you are within range of the Powerpal device
You can run the script and manually enter the information when prompted:
python retrieve_api_key.pyOr you can provide your MAC address and Pairing code directly as command-line arguments:
python retrieve_api_key.py 12:34:56:78:9A:BC 123456- The script will pause and ask you to confirm that no other devices (like your phone) are currently connected to the Powerpal. Hit
Enterto proceed. - It attempts to connect to the Powerpal via BLE and authenticates with your pairing code.
- It grabs your Device Serial.
- It grabs your API Key (UUID).
- It will finally ask
(y/n)if you'd like to test the credentials againsthttps://readings.powerpal.net/api/v1/device/{serial}. - If the request succeeds, your Powerpal's configuration metadata will be printed to the console, and you now have the required keys to build your own integrations (like Home Assistant, Grafana, etc.).