Powerpal smart energy monitor

How hard was it to get a replacement. I am going to email the support at the below address
Limited Product Warranty – Powerpal Support

Was it easy, or did they want to ask you to do any fixes with it.

Very painless, I called them up and they will check your account to see what the last reported battery level was and if it’s anything that could indicate it’s low/dead they will offer to send out a new one without any hassle. As I had disconnected from the Powerpal app and linked direct to HA, they could see it had not reported anything to their server in almost a year and so they assumed it must be dead. Within a few days, I got a new unit in the mailbox

This setup has worked (almost) perfectly for me!

The biggest snag is that if the ESP reboots, there seems to be something wrong with the way it restores the pulse value in HA - it makes my daily consumption jump from 8kWh to like 65703kWh which is obviously (thankfully) not correct.

Any ideas what would be causing the restore to be so out of whack?

Thankyou so much for this, @andrewpc - I couldn’t get WeekendWarrior1’s original code to compile due to breaking changes with the newer versions of ESPHome (giving ‘ESPTime’ is not a member of ‘esphome::time’ errors) - your yaml works perfectly (except for the battery level, but that’s OK!).

Looking for some guidence. I’ve followed all the posts on here. Grabbed an Anroid BLE utility on my wife’s phone and am simply cutting and pasting the MAC of the Powerpal and triple checked the device code. flashed onto an ESP32dev board. Just getting nothing. Any pointers would be appreciated

substitutions:
  device_name: esphome-web-2a46e0 #THE NAME OF YOUR ESP Device
  friendly_name: Powerpal Gateway #THE FRIENDLY NAME OF YOUR ESP Device

esphome:
  name: ${device_name}
  platform: ESP32
  board: "esp32dev"
  on_boot:
    then:
      - lambda: |-
           powerpal_ble_powerpal->daily_pulses_ = id(powerpal_daily_pulses_backup) ;

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

logger:
 level: DEBUG

api:
  encryption:
    key: ""

ota:
  password: ""

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


time:
  - platform: homeassistant
    id: homeassistant_time

esp32_ble_tracker:

ble_client:
  - mac_address: CD:4F:E7:1F:F0:EA #PUT YOUR MAC ADDRESS HERE - NO QUOTES IS IMPORTANT
    id: powerpal

switch:
  - platform: restart
    name: "Powerpal Monitor Reboot"

globals:
  - id: powerpal_daily_pulses_backup
    type: int
    restore_value: true

sensor:
  - platform: powerpal_ble
    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: 121601 #PUT THE PAIRING CODE FOUND WITH YOUR POWERPAL HERE
    notification_interval: 1
    pulses_per_kwh: 1000
    #http_request_id: powerpal_cloud_uploader
    time_id: homeassistant_time # daily energy still works without a time_id, but recommended to include one to properly handle daylight savings, etc.
    cost_per_kwh: 0.235 #dollars per kWh

  - platform: homeassistant
    id: ha_daily_pulses
    entity_id: sensor.powerpal_daily_pulses
    on_value:
     then:
       - globals.set:
          id: powerpal_daily_pulses_backup
          value: !lambda 'return int(x);'

Getting absolute donuts

INFO ESPHome 2024.3.1
INFO Reading configuration /config/esphome/esphome-web-2a46e0.yaml...
INFO Detected timezone 'Australia/Sydney'
INFO Starting log output from 10.0.46.105 using esphome API
INFO Successfully connected to esphome-web-2a46e0 @ 10.0.46.105 in 0.012s
INFO Successful handshake with esphome-web-2a46e0 @ 10.0.46.105 in 0.178s
[21:33:10][I][app:102]: ESPHome version 2024.3.1 compiled on Mar 28 2024, 21:08:48
[21:33:10][C][wifi:580]: WiFi:
[21:33:10][C][wifi:408]:   Local MAC: E4:65:B8:82:D7:64
[21:33:10][C][wifi:413]:   SSID: 'cisco857w'[redacted]
[21:33:10][C][wifi:416]:   IP Address: 10.0.46.105
[21:33:10][C][wifi:420]:   BSSID: 78:8A:20:84:BD:BB[redacted]
[21:33:10][C][wifi:421]:   Hostname: 'esphome-web-2a46e0'
[21:33:10][C][wifi:423]:   Signal strength: -65 dB ▂▄▆█
[21:33:10][C][wifi:427]:   Channel: 11
[21:33:10][C][wifi:428]:   Subnet: 255.255.252.0
[21:33:10][C][wifi:429]:   Gateway: 10.0.45.10
[21:33:10][C][wifi:430]:   DNS1: 10.0.45.42
[21:33:10][C][wifi:431]:   DNS2: 10.0.45.5
[21:33:10][C][logger:166]: Logger:
[21:33:10][C][logger:167]:   Level: DEBUG
[21:33:10][C][logger:169]:   Log Baud Rate: 115200
[21:33:10][C][logger:170]:   Hardware UART: UART0
[21:33:10][C][homeassistant.time:010]: Home Assistant Time:
[21:33:10][C][homeassistant.time:011]:   Timezone: 'AEST-10AEDT,M10.1.0,M4.1.0/3'
[21:33:10][C][restart:068]: Restart Switch 'Powerpal Monitor Reboot'
[21:33:10][C][restart:070]:   Icon: 'mdi:restart'
[21:33:10][C][restart:091]:   Restore Mode: always OFF
[21:33:10][C][esp32_ble:374]: ESP32 BLE:
[21:33:10][C][esp32_ble:376]:   MAC address: E4:65:B8:82:D7:66
[21:33:10][C][esp32_ble:377]:   IO Capability: none
[21:33:10][C][esp32_ble_tracker:645]: BLE Tracker:
[21:33:10][C][esp32_ble_tracker:646]:   Scan Duration: 300 s
[21:33:10][C][esp32_ble_tracker:647]:   Scan Interval: 320.0 ms
[21:33:10][C][esp32_ble_tracker:648]:   Scan Window: 30.0 ms
[21:33:10][C][esp32_ble_tracker:649]:   Scan Type: ACTIVE
[21:33:10][C][esp32_ble_tracker:650]:   Continuous Scanning: True
[21:33:10][C][ble_client:027]: BLE Client:
[21:33:10][C][ble_client:028]:   Address: CD:4F:E7:1F:F0:EA
[21:33:10][C][ble_client:029]:   Auto-Connect: TRUE
[21:33:10][C][mdns:115]: mDNS:
[21:33:10][C][mdns:116]:   Hostname: esphome-web-2a46e0
[21:33:10][C][ota:096]: Over-The-Air Updates:
[21:33:10][C][ota:097]:   Address: esphome-web-2a46e0.local:3232
[21:33:10][C][ota:100]:   Using Password.
[21:33:10][C][ota:103]:   OTA version: 2.
[21:33:10][C][api:139]: API Server:
[21:33:11][C][api:140]:   Address: esphome-web-2a46e0.local:6053
[21:33:11][C][api:142]:   Using noise encryption: YES
[21:33:11][C][powerpal_ble:013]: POWERPAL
[21:33:11][C][powerpal_ble:014]:  Battery 'Powerpal Battery'
[21:33:11][C][powerpal_ble:014]:    Device Class: 'battery'
[21:33:11][C][powerpal_ble:014]:    State Class: ''
[21:33:11][C][powerpal_ble:014]:    Unit of Measurement: '%'
[21:33:11][C][powerpal_ble:014]:    Accuracy Decimals: 0
[21:33:11][C][powerpal_ble:015]:  Power 'Powerpal Power'
[21:33:11][C][powerpal_ble:015]:    Device Class: 'power'
[21:33:11][C][powerpal_ble:015]:    State Class: 'measurement'
[21:33:11][C][powerpal_ble:015]:    Unit of Measurement: 'W'
[21:33:11][C][powerpal_ble:015]:    Accuracy Decimals: 0
[21:33:11][C][powerpal_ble:016]:  Daily Energy 'Powerpal Daily Energy'
[21:33:11][C][powerpal_ble:016]:    Device Class: 'energy'
[21:33:11][C][powerpal_ble:016]:    State Class: 'total_increasing'
[21:33:11][C][powerpal_ble:016]:    Unit of Measurement: 'kWh'
[21:33:11][C][powerpal_ble:016]:    Accuracy Decimals: 3
[21:33:11][C][powerpal_ble:017]:  Total Energy 'Powerpal Total Energy'
[21:33:11][C][powerpal_ble:017]:    Device Class: 'energy'
[21:33:11][C][powerpal_ble:017]:    State Class: 'total_increasing'
[21:33:11][C][powerpal_ble:017]:    Unit of Measurement: 'kWh'
[21:33:11][C][powerpal_ble:017]:    Accuracy Decimals: 3
[21:33:11][C][homeassistant.sensor:030]: Homeassistant Sensor 'ha_daily_pulses'
[21:33:11][C][homeassistant.sensor:030]:   State Class: ''
[21:33:11][C][homeassistant.sensor:030]:   Unit of Measurement: ''
[21:33:11][C][homeassistant.sensor:030]:   Accuracy Decimals: 1
[21:33:11][C][homeassistant.sensor:031]:   Entity ID: 'sensor.powerpal_daily_pulses'
[21:34:18][D][esp32_ble_tracker:266]: Starting scan...

mine seems to reset to 0 too upon restart of ESP32 device. @TimmR21

Seems like you’re unable to connect to the Powerpal device. Have you tried connecting it at a different time during the day or night? The device goes to sleep if it doesn’t detect a pulse within a certain amount of time, which can be the case during the day if you have solar installed.

I just tried rebooting mine and it did retain the total energy value captured for the day. Do you have this part in your YAML:

- platform: homeassistant
    id: ha_daily_pulses
    entity_id: sensor.powerpal_daily_pulses
    on_value:
     then:
       - globals.set:
          id: powerpal_daily_pulses_backup
          value: !lambda 'return int(x);'

and

esphome:
  name: ${device_name}
  platform: ESP32
  board: "esp32dev"
  on_boot:
    then:
      - lambda: |-
           powerpal_ble_powerpal->daily_pulses_ = id(powerpal_daily_pulses_backup) ;

@muneeb1990
Hope you don’t mind the message…
I have added timestamp as a sensor in my yaml so I can check the timestamp in HA (want to create a sort of watchdog binary sensor so I know if powerpal stops scanning/publishing for any reason)
What I saw was the debug timestamp value which shows on the log was different to the HA sensor value. After some looking through the cpp, I came to the conclusion that the long int value for time is published … however sensor values are float. I am pretty certain that the unix time seconds value is too large for float - just going to do some checking today.
I have thought about how to fix and what I was going to test was converting the timestamp long int value into seconds since first timestamp and resetting on 1 Jan each year then converting to a float by expressing the float as whole minutes plus fractional minutes (seconds/60). I am happy to do PR on your esphome powerpal_ble branch, if you agree with my approach. Do you have any other thoughts ?

Thanks for your work on this component

Hi Brett,

Thanks for reaching out. I recall there were a few considerations regarding the timestamp and why it doesn’t match HA.

I tried a few different variations of the timestamp but the current setup is the only way to make this work with cloud upload. Powerpal API refuses to accept any other timestamp value. No issues with a PR but just make sure that it doesn’t break the cloud upload functionality. Thanks!

yes, i have those 2 configured. i also noticed upon rebooting HA the device doesn’t automatically start fetching data and pushing to cloud. i have to edit and install it again.

I’ve ended up getting solar installed with a consumption meter and never got around to setting up the replacement Powerpal I was sent a few weeks ago(my existing Powerpal still works too so I still have that plugged in and collecting pulses). If someone who is interested in continuing development of this add-on would like one(as a spare or to get started), I’d be happy to send it over to help keep the community going.

Hey mate! I could use one. Battery on my third warranty replacement is at 85% and not sure how much longer it’s going to last. Are you in Melbourne?

Perfect! Yep I’m in Melb so happy to meet up if you’re close by(I’m in Glen Waverley) or can post it to you.

Oh, I’m on the west side.

I head into the CBD on Mon and Tues each week usually so happy to meet up with you there if that’s convenient for you. Otherwise my offer to ship it still stands- It was your updated code that helped me fix my setup and been running well for the best part of the last 18 months so it’s a small gesture of thanks.

Shipping works as I usually go in once a week and that too on Thursdays. Will dm my address. Thanks!

FYI you can crack them open and swap the 2xAA inside yourself, too :slight_smile: see: https://forums.whirlpool.net.au/thread/3m01ljx6?p=3#r47

For what its worth, with ESPHome 2024.5.0, there’s a new method of internal ID generation that breaks the existing example YAML files.

Find below for a current working one:

esphome:
  name: powerpal-gateway
  friendly_name: Powerpal Gateway #THE FRIENDLY NAME OF YOUR ESP Device
  on_boot:
    then:
      - lambda: |-
           id(powerpal_ble_sensor)->daily_pulses_ = id(powerpal_daily_pulses_backup);

esp32:
  board: esp32dev
  framework:
    type: arduino

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

time:
  - platform: homeassistant
    id: homeassistant_time

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

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

globals:
  - id: powerpal_daily_pulses_backup
    type: int
    restore_value: true

http_request:
  id: powerpal_cloud_uploader

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: <blah> #PUT THE PAIRING CODE FOUND WITH YOUR POWERPAL HERE
    notification_interval: 1
    pulses_per_kwh: 1000
    time_id: homeassistant_time
    powerpal_apikey: <blah>
    powerpal_device_id: <blah>

  - platform: homeassistant
    id: ha_daily_pulses
    entity_id: sensor.powerpal_daily_pulses
    on_value:
     then:
       - globals.set:
          id: powerpal_daily_pulses_backup
          value: !lambda 'return int(x);'

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "<blah>"

ota:
  password: "<blah>"

wifi:
  ssid: !secret <blah>
  password: !secret <blah>

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Powerpal-Gateway"
    password: "<blah>"

preferences:
  flash_write_interval: 10min

Update the instances of <blah> with the correct details for your device.

Thanks to @jesserockz for the help on fixing the ID names…

3 Likes