Powerpal smart energy monitor

In case you CBF you can download this patched apk I have already made: Powerpal_v1.16.1_apkpure.com-patched.apk - Google Drive

4 Likes

tried reinstalling it via HACS 3 times and no go.

instead, manually enter the data above that “markcs” supplied and that works perfectly.

this method worked perfectly for me also. thank for posting. just had to dig out one of my old android phones (keeps all my old ones) that ran an old enough version of android.

1 Like

Hi, I managed to obtain the key, installed the component using HACS, and succesfully added it in integrations with the details.

Problem is, no sensors show up and I get this in the logs:
Unable to prepare setup for platform powerpal.sensor: Platform not found (cannot import name ‘STATE_CLASS_TOTAL_INCREASING’ from ‘homeassistant.components.sensor’ (/usr/src/homeassistant/homeassistant/components/sensor/init.py)).

any ideas how to fix this?

Hey @Igor_Polshikov what version of home assistant core are you running? STATE_CLASS_TOTAL_INCREASING (which is needed for energy statistics) was introduced in 2021.9.0 - if you are running a later version let me know, and I can look into it further :slight_smile:

I found a way to replicate what powerpal does in Home Assistant using the production/consumption CT clamp data from my solar inverter instead. I have found this method to be better than what powerpal does because powerpal only measures energy being pulled from the grid. I appreciate this is not a good suggestion for anyone that doesn’t have solar.

See

Interesting tidbit, I was doing some maintenance on an ESP32 running ESPHome and my powerpal popped up in the logs.

Such a shame we cant latch onto the data! unless someone has also discovered this and is working on it??

[17:04:02][D][esp32_ble_tracker:719]: Found device F6:6B:E1:6F:AF:6B RSSI=-98
[17:04:02][D][esp32_ble_tracker:740]:   Address Type: RANDOM
[17:04:02][D][esp32_ble_tracker:742]:   Name: 'Powerpal 00014f41'
[17:04:34][D][esp32_ble_tracker:719]: Found device 7E:FD:59:9E:75:91 RSSI=-77
[17:04:34][D][esp32_ble_tracker:740]:   Address Type: RANDOM
[17:04:34][D][esp32_ble_tracker:744]:   TX Power: 2

Just had Powerpal installed at my place - on the install certificate I got via email, there is a checkbox fo r “Zigbee enabled” and the installed ticked “no”. There was a bunch of other Zigbee fields on the form to be filled in if “yes” had been ticked.

So there is some kind of Zigbee functionality here, maybe, I don’t know if it needs a different model hardware or not. Does this open the door to some kind of HA integration?

Hope this helps someone

I suspect that might be a generic installation form for power monitors provided under the government scheme.

Do you know why it’s not storing my energy from previous months? Does it only sync with Powerpal and not retain the information?

I’ve just built a Home Assistant Glow sensor to monitor power usage. As I was using a Powerpal already, I made sure to include a LED that relays the flash from the meter (ie. when the Glow sensor picks up a flash, the LED flashes too). By strapping the existing Powerpal sensor to the LED on the Glow, I can now track power use in HA and keep Powerpal reporting as usual. Happy to share more details if it would be of interest - it was pretty cheap and quite easy.

1 Like

Hi Simon,

I’d love to hear more about your implementation of the Glow & Powerpal. I’ve just got all the parts for the Glow and was wondering how I could do exactly what you’ve achieved. Not sure the best way for you to share, maybe some photos? Do you have a 3D Print STL of a enclousre you’ve designed? How did you attach the glow to the meter and the Powerpal to the Glow?

Thanks for any know-how you could share,

Sure - I’ve tried to make an Imgur post, hope this works (the links aren’t working, but I’ll try to fix them): Home Assistant Glow and PowerPal - Album on Imgur

I don’t have a 3D printer, so just used some off-the-shelf enclosures that I had from the local Jaycar. They aren’t a snug fit, but do the job with a liberal amount of hot glue and some drill holes, and look neat enough.

Let me know if anything is unclear here.

1 Like

Excellent write up Simon, thanks for taking the time for so much detail. I’m in the process of constructing my Glow/Powerpal solution. Hoping to adapt the exisiting 3D print case with the Powerpal bezel and thereby using the same concept with the add-on RGB LED to trigger the Powerpal. I tried integrating the Powerpal bezel into the 3D case but it proved to be difficult due to the small detail of the locking. I’ll take some photos and send an update when I get mine up and going.

1 Like

Great, good luck. I did look at trying to do something with the Powerpal locking part but, without a printer, when a rubber band did the job I went with that for now! It is helpful that the sensors poke out a bit and help make good connections.

Do let me know how you go, I’m looking at hackerspaces in the area, so might have the chance to print in the future.

@markcs I am using your solution to get data from the PowerPal meter_reading API endpoint. I noticed the data is only kept in windows of 15 minutes. I was able to get a reading every minute so far using the following

resource_template: https://readings.powerpal.net/api/v1/meter_reading/<device_id>?start={{ (as_timestamp(now()) - 960) | int }}&end={{ (as_timestamp(now()) - 900) | int }}&sample=1

This gives a single entry for the 1 minute window. The only problem is that it’s 15 minutes in the past. When using HA graphs it shows it 15 minutes in the future so I have used Grafana/mariadb to create the graph below using the timestamp from the powerpal data. Thank’s for the info btw.

I also added an extra sensor for Watts based on pulses, but I am not 100% sure it is correct.

  - platform: rest
    name: PowerPal History
    method: GET
    scan_interval: 60
    resource_template: https://readings.powerpal.net/api/v1/meter_reading/XXXXXXXX?start={{ (as_timestamp(now()) - 960) | int }}&end={{ (as_timestamp(now()) - 900) | int }}&sample=1
    headers:
      Authorization: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
      Host: readings.powerpal.net
      accept: application/json
      content-type: application/json
      user-agent: okhttp/3.12.1
    json_attributes:
      - timestamp
      - pulses
      - watt_hours
      - cost
      - is_peak
    value_template: "{% if value_json[0] is defined %}{{ value_json[0].timestamp | timestamp_custom('%Y-%m-%d %H:%M:%S') }}{% endif %}"

  - platform: template
    sensors:
      powerpal_timestamp:
        friendly_name: "PowerPal Timestamp"
        value_template: "{{ state_attr('sensor.powerpal_history', 'timestamp') | int }}"
      powerpal_pulses:
        friendly_name: "PowerPal Pulses"
        value_template: "{{ state_attr('sensor.powerpal_history', 'pulses') | int }}"
        unit_of_measurement: "Pulses"
      powerpal_watt_hours:
        friendly_name: "PowerPal Watt Hours"
        value_template: "{{ state_attr('sensor.powerpal_history', 'watt_hours') | int }}"
        unit_of_measurement: "Wh"
      powerpal_watts:
        friendly_name: "PowerPal Watts"
        value_template: "{{ ((state_attr('sensor.powerpal_history', 'pulses') | int * 1000) / 60) | round(1) }}"
        unit_of_measurement: "W"
      powerpal_cost:
        friendly_name: "PowerPal Cost"
        value_template: "${{ state_attr('sensor.powerpal_history', 'cost') | float }}"
        unit_of_measurement: ""

Here’s the SQL I used to push the graph data back 15 minutes using grafana/mariadb. The negative number I used (-39580) is more then 15 minutes in my query as he mariadb instance I am using has a different timezone to the powerpal timestamp.

SELECT
  FROM_UNIXTIME(JSON_EXTRACT(attributes,"$.timestamp")-39580) as "time",
  "PowerPal (1min)" AS "metric",
  CAST(JSON_EXTRACT(attributes,"$.watt_hours") AS FLOAT) * 60 as "value"
FROM states
WHERE JSON_EXTRACT(attributes,"$.watt_hours") != ""
AND JSON_EXTRACT(attributes,"$.timestamp") BETWEEN SUBSTR($__from,1,10) AND SUBSTR($__to,1,10)
1 Like

Not that that’s ever stopped me :wink:

IMPORTANT NOTICE
Connecting third party applications to Powerpal directly over BLE is not (and will never be) supported due to potential data security risks. Any attempt to connect to Powerpal directly over BLE and retrieve data may trigger anti-tamper measures which would render your Powerpal inoperable, as well as voiding the warranty.

Today I received an email from PowerPal regarding the beta testing program for their wifi based hub.
I’ve since registered, has anyone else received the same email?

1 Like

I did too, make sure you read the T&C’s of the program if you get accepted regarding posting to forums and social websites.

Cheers.

3 Likes

Yes and I have received the Pro and API access. Do we know if anyone is going to create an integration now that the API is available?