Guide for CurrentCost ENVIR on Pi with PVOutput Intergration service

After all the trouble i had dealing with this i thought i would write a guide thats

  1. easy to find and
  2. should have all the information
  3. a little bit of measureit advice if you want to go either way.

To start with you need a Raspberry Pi, i had one laying around and had previously upgraded a few so the Pi v1 B was well suited.

Any Pi with Ethernet and USB will work as this uses the Genuine USB to RJ45 cable that you can get with the device

DOWNLOAD AND INSTALL
First you need to download and install raspbian Install OS on Pi

I had already installed v118 of measureit as a pre compiled image it’s as easy as copying the image across using Win32DiskImager i basically followed that guide above to install Measureit. so i figured i would just use that.

Once you have your Pi up and running and if you need to follow a guide your probably windows based and don’t know much about Linux (like me) you will need to get 2 programs.
Putty and Winscp i grabbed the portable versions so i didn’t have to install it. This is used to access the Pi headless and make it easier to do things.

While in the downloading mood download PVOutput integration services i Just got the latest v1.5.3.1.zip

ROOT
i setup root so i could use winscp to edit everything, it makes it a hell of alot easier

First you need to find out the IP address your Pi is. i logged into my router and found the IP address it assigned the Pi.

open putty.exe Put the IP address in and make sure its set to port 22 and SSH the click open
*you can save the details to make it easier when you want to login.

username pi and password raspberry

*i also set my timezone while in putty by typing dpkg-reconfigure tzdata
* There is more selections that what is shown on the screen so press the arrow up or down keys to find the value you want

then follow this guide on how to setup root i used username root and made up a password
* note you can copy the commands (without the #) and just right click to paste in putty

you now have root

Installing PVOutput service
now you have root, open WINSCP and in new site create a login for the Pi, you want SFTP, put IP address in the “Hostname area” port 22 i also filled out the username (root) and put my password in.
save it then login.

now it basically turns in into windows explorer.
IF you used a measureit install and dont want to use measureit rename the /web directory to web.x
IF you want to use Measureit or try it out just put the Ip address into your web browser. its quite easy to navigate. just add sensor and make sure you put your key and systemID in each sensor settings menu and restart grabber after you have finished doing your changes.

now to install the Pvoutput service extract the zip file into a folder called pvoutput and delete everything other than Bin, Conf, Data,Lib and logs

then copy that folder to the /home/pi/ folder so its now /home/pi/pvoutput

Navigate to “/home/pi/pvoutput” and press CTRL + T then type chmod 755 bin/pvoutput.sh and press execute

now close the window. i use putty for most of the terminal stuff as winscp seems to have issues.

Open putty and login again to Patch librxtx library
Type apt-get install librxtx-java

Now open winscp again
Copy the file librxtxSerial.so from /usr/lib/jni/ to /home/pi/pvoutput/lib/Linux/i686/librxtxSerial.so
*i copied the file to my computer by dragging it to the left window then navigation to to correct location and dragging it back across

go to /home/pi/pvoutput/conf and you need to edit the pvoutput.ini and currentcost.ini

pvoutput.ini
double click pvoutput.ini
Replace the xxx’s with your PVOutput key - Request an API key from the pvoutput.org ‘Settings’ menu option

key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

and Your System Id is shown in the pvoutput.org ‘Settings’ menu option type it in place of the 0

sid=0

set the logs to dir=/home/pi/pvoutput/logs

make sure format=currentcost
and i set my timezone=GMT+9:30
*uncomment means remove the # infront of it.

save and close the editor

CurrentCost Configuration
Open currentcost.ini and replace the port, rate and channels properties with your current cost device settings. (these were OK as i had the ENVIR)
i did have some trouble with the port so i set it to port=/dev/ttyUSB0 but in saying that its probably as i had other issues with measureit. so leave on auto and see if it works first.

I have 2 transmitters (sensors) one does the main consumption and the other one measures my hot water

i set mine up as below
*use your current cost device to tell you what sensor to type in. On the Device the main screen that displays the temp is sensor 0 and up or down to next sensor shows the appliance number which is the sensor number.

mine is setup like this as i didnt want sensor 9 (my hot water) to be added to the main consumption column

sensors=0
direction=in
v7.sensor=9

if you had generation or 2 clamps measuring consumption then you may set it up like
*in is consumption out is generation

both sensors recording consumption

sensors=0,9
direction=in,in

or

sensor 0 consumption and sensor 9 generation

sensors=0,9
direction=in,out

Run on startup
now navigate to /etc/ and double click on rc.local
i pasted this just above the exit 0 line

cd /home/pi/pvoutput/bin
./pvoutput.sh &

now its time for a reboot and see whats happening
press CTRL + T and type reboot

it should reboot and disconnect the session. now close winscp and after about 30 seconds open putty,
login and type tail -f /home/pi/pvoutput/logs/pvoutput.log and checkout your log file.

check for any errors and give it 5 or so minutes and check your system for live data. if its not working or has an error post it up and someone will know what to do

a big thanks to
@mspohr as i followed some of his guide and converted into winscp instructions
@bankstownbloke for sorting most of my issues and actually creating the Intergration service and PVOutput. I figure I would save him some headaches by writing up this guide so everyone has a good starting point to follow

3 Likes

Hi, followed your guide to the letter but keep getting the following when try to run pvoutput.sh …

/home/pi/pvoutput/bin/pvoutput.sh: line 5: java: command not found

Any ideas what could be wrong ?

Its missing Java -

Thanks for that. :+1:
I’ve actually taken another route and written a Python script which does the same job.

Hi @Scobo any chance that you could share your Python script?

Thanks for putting the guide together, it was a great help in getting this working on my Pi Zero.
If it’s possible to update the original, I suggest that adding JRE as a pre-req. There are some Java JDK links above too, so it’s not a total loss. On the subject of JRE for the Zero, this may be of use:
https://forums.raspberrypi.com/viewtopic.php?t=264037
I’m not sure if things have changed with the the librxtx library, but the version I installed from the link in the guide contained linked files to the library which did not work for me when copied to the pvoutput/lib/xx directory. In the end I copied the target files & renamed them.
It took me a while to realise that “extract the zip” means the PVoutput Integration Services, probably just me not reading properly!

yeah its not a complete follow through and your done guide.
it was messy from the start being that I reused my measureit Pi image so I already had programs that were needed and or other problems to deal with.
Also unable to edit the first post. I agree when I follow a guide I get stuck if its not telling me exactly what to do, I’m following the guide as I don’t know what the hell im doing.

I ended up writing it because I had so much trouble so if anyone else was in my position they could work their way through it too. it was written after I had done it not during so its not 100% but gives you a good starting point.
Also helps if I needed to redo it for some reason.
I have moved on from this device now only due to the fact I cant get it doing a net reading with the way everything was setup in the house.
I’m sure if anyone’s following along they can read the whole thread and work it out. I wouldn’t know what to edit or where to put it plus I don’t think these devices (ENVIR) are even available anymore.