Guide for CurrentCost ENVIR on Pi with PVOutput Intergration service


#1

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


Consumption, who's using what?