Getting TED and Enphase into MariaDB

I want to get my TED and Envoy data into MariaDB. dont know how or what I am going to use it for yet, but I know I will use it. Just need to learn more.
I used PHPMyAdmin to create a database, I called it House, I then created 2 tables one called TED and one called ENPHASE and gave a new user call house full access to it.
I then created a shell script for TED to get data into it:
#!/bin/bash

#lets get in the right directory

cd /etc/ted/

#remove old csv

rm TED.csv

#Now we get the data we need and get it into a number

RAW=$(lynx -dump http://ted6000/stats.htm | grep '(W)' | sed -r 's/s+//g'| cut -d":" -f2)

#make it kW and put it in a file I can use for other things

/usr/bin/echo "scale=3; $RAW/1000" | bc -l >> TED.csv

#Import data the csv file name has to be the same name and case as the table you are importing to.

mysqlimport --local -u house --password=password House --columns=KW TED.csv

##And the one for the Envoy:
#!/bin/bash

cd /etc/enphase

#remove old stuff

rm ENPHASE.csv
rm kw2.txt
rm kw.txt

#Get the data ready for a csv for MariaDB

lynx -dump http://solar.hohenfels.com/production?locale=en | grep ly > kw.txt

# The Enphase Envoy uses Kilowatts (kW) and Watts (W). So a little creativity is required: If I find kW, clean it up, add the date and dump it in the CSV. If I dont find kW then clean it up and put it in a text file called kw2.txt. If it is not kW then it has to be W. when not producing it shows 0W

if grep -q 'kW' "kw.txt"; then
cat kw.txt | sed 's/[A-Za-z,]*//g' | sed -r 's/s+//g' >> ENPHASE.csv
else
cat kw.txt | sed 's/[A-Za-z,]*//g' | sed -r 's/s+//g' > kw2.txt
fi
# Make the kw2.txt file a variable
KW2=$(cat kw2.txt)

# Do some math and get our variable into kW and dump it in the CSV.

/usr/bin/echo "scale=3; $KW2/1000" | bc -l >> ENPHASE.csv

#Import data file name has to be the same name and case as the table you are importing to.

mysqlimport --local -u house --password=password House --columns=KW ENPHASE.csv

I now have my MariaDB populating with date from my TED and Enphase Envoy

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

TED, Meet Enphase..

Now that we are getting graphs from both TED and Envoy I wanted to combine them to get a graphical representation of production vs. Usage. The heavy lifting is done, just need to stuff it into a graph and cron it:
#!/bin/bash#Create the combined daily graph

rrdtool graph /var/www/html/solar/combine_day.png -s -1day DEF:ted_watts=/etc/ted/watts/ted_watts.rrd:temp:AVERAGE LINE1:ted_watts#FF9900 -h 400 -w 600 -y1:2 --color GRID#dddddd --color MGRID#aaaaaa DEF:enphase=/etc/enphase/enphase.rrd:temp:AVERAGE LINE1:enphase#FF0000 -h 400 -w 600 -y1:2 --color GRID#dddddd --color MGRID#aaaaaa

#Create the combined weekly graph

rrdtool graph /var/www/html/solar/combine_week.png -s -1week DEF:ted_watts=/etc/ted/watts/ted_watts.rrd:temp:AVERAGE LINE1:ted_watts#FF9900 -h 400 -w 600 -y1:2 --color GRID#dddddd --color MGRID#aaaaaa DEF:enphase=/etc/enphase/enphase.rrd:temp:AVERAGE LINE1:enphase#FF0000 -h 400 -w 600 -y1:2 --color GRID#dddddd --color MGRID#aaaaaa

#Create the combined monthly graph

rrdtool graph /var/www/html/solar/combine_month.png -s -1month DEF:ted_watts=/etc/ted/watts/ted_watts.rrd:temp:AVERAGE LINE1:ted_watts#FF9900 -h 400 -w 600 -y1:2 --color GRID#dddddd --color MGRID#aaaaaa DEF:enphase=/etc/enphase/enphase.rrd:temp:AVERAGE LINE1:enphase#FF0000 -h 400 -w 600 -y1:2 --color GRID#dddddd --color MGRID#aaaaaa

#Create the combined yearly graph

rrdtool graph /var/www/html/solar/combine_year.png -s -1year DEF:ted_watts=/etc/ted/watts/ted_watts.rrd:temp:AVERAGE LINE1:ted_watts#FF9900 -h 400 -w 600 -y1:2 --color GRID#dddddd --color MGRID#aaaaaa DEF:enphase=/etc/enphase/enphase.rrd:temp:AVERAGE LINE1:enphase#FF0000 -h 400 -w 600 -y1:2 --color GRID#dddddd --color MGRID#aaaaaa

# All the rrd sctipts we created need to go into roots crontab. I have everything run a 5 minute intervals

*/5 * * * * /usr/local/bin/ted_watts.sh > /dev/null 2>&1
*/5 * * * * /usr/local/bin/enphase.sh > /dev/null 2>&1; /usr/local/bin/combined_solar.sh > /dev/null 2>&1

##Here is the final daily product. TED is Orange, Enphase is Red.

Daily:

Weekly:

Month:

# Here it is with no mark-up
#!/bin/bash#Create the combined daily graph
rrdtool graph /var/www/html/solar/combine_day.png -s -1day DEF:ted_watts=/etc/ted/watts/ted_watts.rrd:temp:AVERAGE LINE1:ted_watts#FF9900 -h 400 -w 600 -y1:2 –color GRID#dddddd –color MGRID#aaaaaa DEF:enphase=/etc/enphase/enphase.rrd:temp:AVERAGE LINE1:enphase#FF0000 -h 400 -w 600 -y1:2 –color GRID#dddddd –color MGRID#aaaaaa

#Create the combined weekly graph
rrdtool graph /var/www/html/solar/combine_week.png -s -1week DEF:ted_watts=/etc/ted/watts/ted_watts.rrd:temp:AVERAGE LINE1:ted_watts#FF9900 -h 400 -w 600 -y1:2 –color GRID#dddddd –color MGRID#aaaaaa DEF:enphase=/etc/enphase/enphase.rrd:temp:AVERAGE LINE1:enphase#FF0000 -h 400 -w 600 -y1:2 –color GRID#dddddd –color MGRID#aaaaaa

#Create the combined monthly graph
rrdtool graph /var/www/html/solar/combine_month.png -s -1month DEF:ted_watts=/etc/ted/watts/ted_watts.rrd:temp:AVERAGE LINE1:ted_watts#FF9900 -h 400 -w 600 -y1:2 –color GRID#dddddd –color MGRID#aaaaaa DEF:enphase=/etc/enphase/enphase.rrd:temp:AVERAGE LINE1:enphase#FF0000 -h 400 -w 600 -y1:2 –color GRID#dddddd –color MGRID#aaaaaa

#Create the combined yearly graph
rrdtool graph /var/www/html/solar/combine_year.png -s -1year DEF:ted_watts=/etc/ted/watts/ted_watts.rrd:temp:AVERAGE LINE1:ted_watts#FF9900 -h 400 -w 600 -y1:2 –color GRID#dddddd –color MGRID#aaaaaa DEF:enphase=/etc/enphase/enphase.rrd:temp:AVERAGE LINE1:enphase#FF0000 -h 400 -w 600 -y1:2 –color GRID#dddddd –color MGRID#aaaaaa

Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

TED Install Part 2

Installed The Energy Detective (TED) Home Pro. After verifying with great folks at TED, I cut off and capped the blue and red wires from the MTU power cable:
I then went to the main breaker box and installed The Energy Detective (TED) MTU power cable. I hooked up the black, hot wire to the ‘A’ side of the 100 Amp circuit breaker feeding the shop and the white, neutral to the neutral bar.
I then attached the 2 Current Transformers (CT)s. Red dot facing the utility.
Then I powered it up.
I was able to keep it all with in the main circuit breaker box:
It is a very long MTU power cable but I made it fit. I verified that I could get to the Footprints software and see the MTU. Then I buttoned it up.
Now I need to setup and play with The Energy Detective Footprints software. I will post how it goes.
Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Power Line Communications Part 1

Started wiring up the electrical for the Enphase Envoy solar box and The Energy Detective (TED) devices. Both use Power Line Communication (PLC) . The Envoy uses it to communicate with the micro-inverters and TED uses it to communicate with the MTU that will be hooked up in the breaker box.
I put a 2 plug box straight off the breaker box in the shop, I have a shared neutral and gave each plug its own hot. One will be on the ‘A’ side and the other will be on the ‘B’ side. The Enphase micro inverters come in on both sides and I isolated the Envoy to the ‘B’ side, I will set TED up on the ‘A’ side. Here is a quick Phase explanation page 8
Here is a shot of the breaker box:

 

Worked for the Envoy, full bars!
Now to finish the rest of the outlets and lights.
Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

TED Install Part 1

I ordered The Energy Detective (TED) Pro Home for a couple of reasons. One is that I am not sure my electrical coop here in central Texas is calculating my usage correctly. If you don’t have anything to show your usage you have no choice but to trust them and their meters. When they put in the Net Meter for my solar install they they tried to stick me for around $500 extra because they said the old removed meter was running slow and out of calibration. They could not tell me how long, how slow, or how many owners had that meter so they dropped the charge. The other reason is to effectively break down my usage and find the energy pigs allowing me to reduce usage.
Here is what you get:
One Measuring Transmitting Unit (MTU) with Power Cable
2 Current Transformers (CTs) 40 inches long
One Energy Control Center (ECC) with power cable
One Ethernet cable
Instructions
I will have a non-standard install. I will be installing in my main breaker box located on a pole directly under my meter. I have 3 separate buildings and that is the only place they all come together. I am going to attach the CT’s to the cables going directly to the meter. The smallest circuit I have in that box is 100 amps and the Standard TED Pro Home will only allow you to hook up to a 40 amp or smaller circuit. I spoke with one of the engineers at The Energy Detective (TED) and he said I could do it but needed a fused MTU power cable. Luckily they can provide one.
I received the fused MTU cable as well, it is about 9 1/2 feet long and has fused red and blue wires in addition to the fused black and white wires. I pinned everything out with my multimeter and they are wired the same. I am just going to cut back and cap the red and blue wires.
  I hope to get the install started next week, I have to do some work over in the shopfirst.
Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather

Starting the Solar Saga

We have 27 Enphase M-215 240 Volt Micro-Inverters. They are supposed to put out 0.27kW each which would give us a peak of 7.29 kW
I will try to keep this blog to home and sustainment items. I will keep the shop related stuff on the shop blog HERE
We had the system installed by the folks at Air, Wind, and Solar I will write more about that later. Lets just say I am still waiting on everything to work as advertised. Everything was installed May 19th, 2014. I will edit this if it ever gets working.
Another headache I will be writing about is our Net Meter and electrical coop, we thought this was supposed to be easy and at least save us some money…
Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather