Powerpal smart energy monitor

Takes out the fun to simply go out and spend a lot of money to buy something. Yes a home made solution may not match a commercial product but part of the home automation hobby is the journey not simply the destination - for me at least.

Do you have your code on Github or you built something on ESPHome?

NOTE: I think I’ve answered my own question. This page describes nicely how to build a pulse counter with ESPHome Pulse Counter Sensor — ESPHome

The only thing I didn’t see on that page is how the smart meter specs (i.e. 800 imp/kwH) but I only took a brief glance at this…

No I don’t but I think when I looked around I was able to find hips of similar projects, yet I decided to build my own.
The reason for that is that I wanted to make it more “universal” ?
The project you just mentioned is using kind of interrupts to count pulses.
My approach was to run as fast reading and possible and read instant value of the detected (in volts).
Then I tried to run my own algorithm to detect raising and failing edges and by measuring a time between them - calculate (almost) instant power consumption.
Downside of that approach - it is way more complicated than just counting pulses but in return my system should (in theory) adapt to changing light conditions when it is day or night.
I think it does not matter if an enclosure is good enough to block all external light but if it is not - I think my approach is better since it can adapt itself to changing in external light conditions (like day and night).

P.S. Don’t mind sharing it but since I am not a professional programmer I personally think it looks a bit ugly :slight_smile:
I also used kind of two devices this time - one was Arduino to actually read pulses and second one was ESP8266 to handle WiFi and send aggregated data back to my server.
It definitely could be done on just ESP but I kind of wondering - since ESP8266 is single core/single threaded - won’t a few pulses be missed while CPU is busy with sending data over the network?
Or may be I should just ignore that little error and make everything simpler.

Ok, I might try the ESPHome approach when I get around to try it and compare that with the data from the portal

When you export your data you get a from and to date with your token. Would it be possible to create a sensor that updates the date and downloads the csv hourly? Sure it wouldn’t be real time but you’d have pretty up to date power stats.

Something like Scrape CSV

Forget that, they are 24hr tokens only. I have emailed support asking for a long lived token

But it’s 90 days of readings right?

I think so… But if you store the values locally… It’s more moving forward

Here’s a link to mine, which has now been working flawlessly for over a year. In theory (if it catches every pulse) it will be 100% accurate over time, but with short-term noise levels depending on how many flashes per kWh you get from your meter (more the better).

Have you looked at this from PowerPal

We are also currently evaluating customer demand for an API (to allow for connecting to IFTTT, Home Assistant, etc) and have this on our development roadmap for review in 2021. One of the issues we have in developing an API for Powerpal is that the connectivity is Bluetooth Low Energy, so you have to have your phone in range to pick up the data - which isn’t a great fit for many home brew/home automation applications.

To resolve this we’re considering developing a stand alone BLE → WiFi gateway.

If you would be interested in becoming a beta tester for the gateway and API please complete this form with details of your use case to express your interest in joining our beta testing group.

2 Likes

Yeh i saw this and signed up a while ago. No word yet…

1 Like

Same here, about 2 months ago.
Haven’t heard back yet.

Had a PowerPal unit installed a few days back and have registered my interest in the PP API Beta program. Hoping something comes of that and they bake-in some HA compatibility - would be amazing to pull power usage data into HA, though I’m not quite sure what I’d do with it just yet!

Great, the more people asking for it the better.

Now that energy monitoring is in HA I thought I’d jump on the PowerPal to make it work. Unfortunately it seems there’s no easy way to get it integrated.
Then I came across this project: GitHub - klaasnicolaas/home-assistant-glow: ⚡ The power of energy measurements in your house Seems simple enough to rock your own Powerpal equivalent for about $15 in parts and not have to deal with their “maybe coming sometime” bridge product.

Sweet - have you implemented it? Best place to source parts?
Keen to see how this plays out.

Nah only ordered the parts this morning. There’s a parts list on the GitHub site. About the only thing that tinkerers might not have already is the Photodiode. Will update once I’ve built it.

That’s be great :slight_smile:

I have just completed a pulse meter using a Photo resistor detector and an ESP-01 board. All hooked up to Home assistant.
I used the platform: pulse_meter function in ESPHome
Only started testing it today but it looks good so far.
I have it reporting usage and also have solar output from the inverter. An automation checks if usage is 0kW and solar is over 1 kW and turns on a spa heater.

I used these parts from aliexpress Photo detector and ESP-01

The good bit to add to the esphome yaml config

sensor:
  - platform: pulse_meter
    pin: GPIO2
    unit_of_measurement: 'W'
    name: 'Metered Electricity Usage'
    accuracy_decimals: 0
    filters:
      - multiply: 75  # (60s/800 pulses per kWh)
    total:
      name: "Metered Electricity Total"
      unit_of_measurement: "kWh"
      accuracy_decimals: 3
      filters:
        - multiply: 0.00125

I managed to retrieve the data from the powerpal by ‘looking’ at the messages that are sent between the powerpal app and the server - easy to get this data with a curl request. The response from the server is a json string like this:

  {
    "timestamp": 1628989200,
    "pulses": 44,
    "watt_hours": 14,
    "cost": 0.0030199827,
    "is_peak": false,
    "samples": 1
  },
  {
    "timestamp": 1628989200,
    "pulses": 41,
    "watt_hours": 13,
    "cost": 0.002847929,
    "is_peak": false,
    "samples": 1
  },

Happy to work with someone to get this implemented in HA with a bit of backward engineering …

3 Likes

I just went through this myself and have published a utility to make the requests to the API. You still need to use a mitm to obtain your authorisation token, but my example tools can export to CSV or InfluxDB. Code here GitHub - forfuncsake/powerpal: A client package for the https://readings.powerpal.net API, written in, a little more detail in the blog post linked in the README.

1 Like

Sounds like a great solution to bridge the missing link to get away from the standalone solution.

Given the recent install of my Powerpal and the fact I have InfluxDB running on my Home Assistant instance I’d like to give this a try. Most of the setup looks alright but wouldn’t know where to start to get my authorisation token. For us non-developers :slight_smile: do you have any more guidance on how to use mitm to obtain that token?