Powerpal smart energy monitor

The accumulation will only start once this new firmware is installed, so you would need to run it from start of day for the Daily Energy to be accurate.

I don’t actually track or calculate the price at the moment, nor send any data back to Powerpal. Do you?

Latest versions

  • Installation method Home Assistant OS
  • Core 2025.7.3
  • Supervisor 2025.07.1
  • Operating System16.0
  • Frontend 20250702.3

This is the YAML that is working for me now


esphome:
  name: powerpal-gateway
  friendly_name: Powerpal Gateway

          
esp32:
  board: esp32dev
  framework:
    type: esp-idf

external_components:
  - source:
      type: git
      url: https://github.com/gurrier/esphome-powerpal_ble.git
      ref: "1.1" 
    components: [ powerpal_ble ]

time:
  - platform: homeassistant
    id: homeassistant_time

ble_client:
  - mac_address: XX:XX:XX:XX:XX:XX #PUT YOUR MAC ADDRESS HERE - NO QUOTES IS IMPORTANT
    id: powerpal

button:
  - platform: restart
    name: "Restart"
    icon: "mdi:restart"

http_request:
  id: powerpal_cloud_uploader
  verify_ssl: false

sensor:
  - platform: powerpal_ble
    id: powerpal_ble_sensor
    ble_client_id: powerpal
    power:
      name: "Powerpal Power"
    daily_energy:
      name: "Powerpal Daily Energy"
    daily_pulses:
      name: "Powerpal Daily Pulses"
    energy:
      name: "Powerpal Total Energy"
    battery_level:
      name: "Powerpal Battery"
    watt_hours:
       name: "Powerpal Watt Hours_json"
    cost:
       name: "Powerpal Cost_json"
    timestamp:
       name: "Powerpal Timestamp_json"
    pulses:
       name: "Powerpal Pulses_json"
    pairing_code: 123456 #PUT THE PAIRING CODE FOUND WITH YOUR POWERPAL HERE
    notification_interval: 1 # seconds
    pulses_per_kwh: 1000
    time_id: homeassistant_time



# Enable logging
logger:
  level: DEBUG
  logs:
    powerpal_ble: DEBUG
    
# Enable Home Assistant API
api:
  encryption:
    key: !secret esphome_api_encryption_key

ota:
  platform: esphome
  password: "XXXXXXXXXX"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Powerpal Fallback Hotspot"
    password: "XXXXXXX"

web_server:
  port: 80
  auth:
    username: !secret esphome_web_username
    password: !secret esphome_web_password

1 Like

Sorry what I’m trying to say is that the Total Energy is reporting incorrectly. It’s only marginally higher than the Daily, whereas it should be many orders of magnitude greater. Total for me should be almost 10kWh but its reporting much less than that, as seen above.

The Total Energy will be EXACTLY the same as the Daily Energy on day 1. After midnight, once the Daily total resets to zero, you will see the Total Energy start to climb further as it will be the sum of Daily day 1 plus daily day 2 so far.

Total Energy is not an overall reading from the lifetime of the Powerpal. I have not tried to do that and am unsure if it actually is reported.

It reporting total lifetime usage was how it was previously working for me?

Edit: Ah ok so my HAOS energy ‘source’ for grid consumption was wrong. It was configured to use this “Powerpal Total Consumption” entity from the Powerpal Integration which is not being updated? Once I updated to the entity “ESPHome Web 959258 Powerpal Total Energy” my data updates correctly:

Given the entities as part of the Powerpal Integration do not seem to be updating, do I in fact need this integration at all?

I’ve put this in, looking good so far, will report any issues.

A Great easy fix Thank you

1 Like

Yes I do using REST, can you share the output of your powerpal_cost_json for a couple of logs so I can see if I can use it

Just so that I understand. This is done for a better UI/visualisation of your energy usage? (I like my HA integration and alerts, so haven’t looked at Powerpal at all)

And this is setup using an automation that uses a rest API to push data every min?

Yes correct I calculate the usage and the cost of the usage and also push this to Powerpal so I can still use there app and I visualise it in HA

1 Like

The value is dependent on the YAML containing the cost_per_kwh entry (I had commented it out). Once I re-enabled it, I get a value in

[sensor.powerpal_gateway_powerpal_cost_json]
Powerpal Gateway Powerpal Cost_json
0.00120000005699694

Another release (“1.2”), this one is reducing NVRAM wear from the restart persistence of Daily Energy and Total Energy. Highly advised to update to this one.

esp32:
  board: esp32dev
  framework:
    type: esp-idf

external_components:
  - source:
      type: git
      url: https://github.com/gurrier/esphome-powerpal_ble.git
      ref: "1.2" 
    components: [ powerpal_ble ]
5 Likes

Hi @tmugan . FYI I have been using this for 4 days now and can confirm all works great including upload to Powerpal via Restful command . Thanks so much for doing this.

1 Like

Could you share your approach for RESTful to Powerpal? It might help others get it working.

To get Rest sending working you need to add this to the Powerpal Yaml

# Enable logging
logger:
level: DEBUG
  logs:
    powerpal_ble: DEBUG

The logging can just be while you set this up then you can turn it off again if you like

You need to add this line also

cost_per_kwh: 0.30155 #dollars per kWh

This should be your Cost per KWH charge including GST

Note I have had to play around a little with the number to get it logging exactly to match the AGL website

If you dont have your Auth key and unit key you will need to do the following

You will then need to reboot your powerpal and quickly move to download logs in ESPhome Builder.

You are looking for the following 2 pieces of data (they are unique to each powerpal)

Recieved serial_number read event
Powerpal apikey: abcdef-xxxxxx-yyy-12345676-ababab
Recieved uuid read event
Powerpal device id: 00022211

I suggest run the unit for around 60 seconds and then download the logs to find them.

Once you have them the hard work is done

in the HA configuration Yaml put the following
(Ensure you have quotes on your API Key)

rest_command:
  my_request:
    url: https://readings.powerpal.net/api/v1/meter_reading/DEVICE-ID-FROM-ABOVE
    method: POST
    headers:
      authorization: "YOUR-API-KEY-FROM ABOVE"  
      accept: ""
    payload: >-
      [ {"cost":{{ states.sensor.powerpal_cost_json.state }},"is_peak": false, "pulses":{{ states.sensor.powerpal_pulses_json.state | int(0) }}, "timestamp": {{ as_timestamp(now(),0) | int(0) }} , "watt_hours": {{ states.sensor.powerpal_watt_hours_json.state}} } ]
    content_type: "application/json"
    verify_ssl: true

Save that

Then create an automation with the following config

alias: Powerpal Cloud Upload
description: Powerpal Cloud Upload
mode: single
triggers:
  - minutes: /1
    trigger: time_pattern
conditions: []
actions:
  - data: {}
    action: rest_command.my_request

Reboot HA and you should be receiving data in the Powerpal App

2 Likes

Thanks @rohanb1965, it worked for me.

Some observations

  1. I connected to the ESP32 board directly with a USB cable and watched the log files through web.esphome.io to confirm the apikey and deviceid. Connecting Wirelessly did not show this data as it usually missed the startup sequence.

  2. For me, the names of the sensors in the rest_command yaml code were prepended with “powerpal_gateway_”
    This can be confirmed with the Developer Tools menu option in Home Assistant

  3. The ESP32 does not fill in any missing data, only the current reading is uploaded. I noted that Powerpal app itself was able to retrieve last 2 months of data from the Powerpal Device and upload it when first reconnected.

  4. I altered your automation to avoid trying to send data if the sensor has not yet connected and returning valid values.

alias: Powerpal Cloud Upload
description: Powerpal Cloud Upload
trigger:
  - platform: time_pattern
    minutes: "/1"
condition:
  - condition: template
    value_template: >
      {{ states('sensor.powerpal_gateway_powerpal_watt_hours_json') not in ['unknown', 'unavailable'] }}
action:
  - service: rest_command.my_request
mode: single

Also worth mentioning, I also removed the bluetooth pairing on my phone for the Powerpal so that it does not take the connection and block my ESP32 anytime it is disconnected. And now the Powerpal app updates every minute as well as Home Assistant.

1 Like

Hi @tmugan
Glad to hear you got it working

1. I connected to the ESP32 board directly with a USB cable and watched the log files through [web.esphome.io](http://web.esphome.io/) to confirm the apikey and deviceid. Connecting Wirelessly did not show this data as it usually missed the startup sequence.

Strange as I can only connect wirelessly and can see the data about 200 lines down after the boot but great as long as it works.

2. For me, the names of the sensors in the rest_command yaml code were prepended with “powerpal_gateway_”
This can be confirmed with the Developer Tools menu option in Home Assistant

This will only occur if you have friendly name in ESP Yaml I believe from your yaml previously shared friendly_name: Powerpal Gateway and HA adds the underscores.

3. The ESP32 does not fill in any missing data, only the current reading is uploaded. I noted that Powerpal app itself was able to retrieve last 2 months of data from the Powerpal Device and upload it when first reconnected.

This would have been when the Powerpal app connected to the Powerpal at some stage when you were doing the reconfiguration and the ESP is offline

4. I altered your automation to avoid trying to send data if the sensor has not yet connected and returning valid values.

This is not really required as the Powerpal website will reject anything that is not good data .

Also worth mentioning, I also removed the bluetooth pairing on my phone for the Powerpal so that it does not take the connection and block my ESP32 anytime it is disconnected. And now the Powerpal app updates every minute as well as Home Assistant.

Sorry I assumed this would have already been done when you started using the ESP to get the data as the Bluetooth LE in the unit can only have 1 client and it was one of the early prerequisites of using this.

You should also go into the Powerpal app under settings>your powerpal hardware > manage and turn remote connection ON this will stop the app trying to poll the Bluetooth and also help with battery usage on the phone/tablet.

I will also mention that some versions of the app care about having tariff’s setup in settings>your electricity tariff >manage >your prices
This should be the exact GST inclusive rate from your provider.

If I can help anyone else out getting this working please give me a shout.

1 Like

Hi @tmugan the @gurrier repo on github fixed it for me too

1 Like

Thanks, working for me as well. Sorry, I just haven’t had enough time lately to keep this going but glad to see community support still keeping it alive. I will edit my post above to refer to @tmugan YAML.

4 Likes