In saying that, I was looking at @muneeb1990 's powerpal_ble.h and I noticed it is referencing an internal ip address as possibly part of the cloud uploading, but I’m only a shade tree coder, so I might be of the mark totally. The powerpal_ble.h code below lines 145 - 150:-
@drew-t excellent work are you trying to do the Powerpal cloud upload ? I think the data representation in the Powerpal app is pretty good, just a design downfall that the unit relies on a flaky intermittent Bluetooth connection, I get missing chunks of data doing it the official way. I’ve just tried substituting in the “https://readings.powerpal.net/api/v1/meter_reading/”; into the powerpal_ble.h and cleaning / re-compile, will see if that helps.
@compacthack I’ve managed to get Powerpal integrated with Home Assistant via ESP 32 I used NRF Connect to find the BLE MAC address. Had to use my Android tablet for that as the NRF Connect iOS version was obfuscating the MAC address for some reason. How did you go with the cloud integration?
Hey guys, as I mentioned on Github, I’m not using @WeekendWarrior1’s code for cloud upload as I couldn’t get it to work. What I’m doing instead is uploading the values using a POST request through HA native REST command platform.
It’s been working flawlessly for me for the past month or so. Here’s a screenshot of my Powerpal app where you can see the data being uploaded while Bluetooth is disabled:
Thanks @muneeb1990 got your code up and running today on an M5 Atom Lite.
From what I can see in HA everything looks good, however the data being pushed to Powerpal by the automation\Rest is way off! See screenshot attached showing 15.4kW!! It should be like 700watts.
Is it possible it’s not reflecting the pulse_per_kwh ? Mine is set to 3200 as per my meter and configured in the yaml file of the ESP device.
Yeah, 3200 in the Powerpal app as well. I couldn’t see anywhere in the code where it was hard set. I’m getting some discrepancy between HA and Powerpal, so will compare with what the United energy platform says my meter is doing.
Powerpal cloud is now significantly lower than United energy and HA. Will hopefully get a bit of time this week to dig into it a bit more and roll my testing change back.
I think there might be an issue with update frequency associated with using timestamp as the trigger. Can you try changing the configuration.yaml to the following:
Went to try this today and discovered my Powerpal stopped sending data some time yesterday. Will do some digging into why and hopefully I can get it running again.
Just tried but unfortunately results appear to be the same in Powerpal app.
The timestamp is different between the two but the rest remains the same.
Example output pasting the payload line into templates:
Old:
[ {“cost”:0.00549223134,“is_peak”: false, “pulses”:93, “timestamp”: 1674627660, “watt_hours”: 298 } ]
Confirming I do have it set to 3200 in the PowerPal app and readings had been accurate with direct Bluetooth connection. That said I think I’ve got it pretty close now!
With the readings being far to high I first tried dividing the watt hours being sent to PowerPal by 3.2 thinking that would account for the flashes per second and that possibly by disconnecting the PowerPal from the app that it may default back to 1000 even though it was set to 3200.
That theory went out the window as results were still to high but I’ve got it pretty close by dividing by 5. I can’t say I understand why it’s by 5 but it does seem to get me within +/-0.1 kWh from what I see in HA (which is 100% accurate confirmed with power distributors web portal) so I’m happy enough with that.
Final config below for anyone else who may have similar issues.