Uploading to PVOutput.org using HTTP Advanced

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
jm_araujo
New user
Posts: 3
Joined: 11 Feb 2020, 13:39

Uploading to PVOutput.org using HTTP Advanced

#1 Post by jm_araujo » 15 Mar 2020, 18:39

I've bought a PZEM 016 and wanted it to be used as a standalone device (other than a Wifi Connection), to be able to monitor the power consumption in different places, like diagnosing the power usage in family and friends houses and help them reduce the energy bill. With that in mind, I've added an ESP8266 to it, similar to the way it's done in here: Link , and wanted to to use ESPEasy for ease of configuration (nice web interface) and for it to be able to upload directly to PVOutput

In the software side I used HTTP Advanced controller for uploading, and the device module P251 available here: Link, to interface with the PZEM, which I've found on this forum in here: Link
After beeing able get the data from the PZEM device (minor compiler issues, only had to change the path to the include inside the module), I couldn't get HTTP Advanced to work with PVOutput.
I kept going at it for a couple of hours and finally managed to get it to work, and as someone else may need it in the future, decided to share my experience so they'll skip the troubles I've had.

First I've had to change the code in _C011.ino, in line 258, from

Code: Select all

parseControllerVariables(s, event, true);
to

Code: Select all

parseControllerVariables(s, event, false);
I don't really understand why it was that way (url encode the http requests, like changing spaces to %20). The servers I've tried when debugging (nginx and Apache) don't like it at all, and will throw a "400 - Bad Request" error!

After finding this problem, it was easier to get it to work, and here is my final configuration:
PZEM conf.PNG
PZEM conf.PNG (37.99 KiB) Viewed 10671 times
In my use case, %val4% is total accumulated Wh, %val1% is voltage.

The only changes in the device configuration are setting the values to 0 decimals, and send to the controller in 300s intervals (5 minutes),which is the maximum PVOutput rate.

I hope this helps someone!

TD-er
Core team member
Posts: 8747
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Uploading to PVOutput.org using HTTP Advanced

#2 Post by TD-er » 15 Mar 2020, 20:05

It sure helps and we should for sure document this.

I guess it would also be a good idea to have the URL encoding as a configuration parameter so people can chose whatever is needed for their purpose.

Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests