Tesla Powerwall and Rolec Car Charger

Last Friday we have our Tesla Powerwall installed and at the same time the electricians installed my Rolec car charger.  I was most excited about the Powerwall as I’ll hardly use the car charger and the Powerwall has an API which means I can add extra data to my home monitoring 😀

The whole process from emailing Tesla with some questions to getting the Powerwall has taken a while, mostly because we had to get some electrics fitted in the house before asking for a quote from Tesla.

The sign-up process is quick – fill in a brief form and pay a deposit by card.  The quote process after signing up is a lot more involved… You walk around your house taking lots of pictures and writing descriptions of where you’d like the Powerwall installed.  I’d prefer they sent out someone and I think it would have taken just as long for them to walk around my house assessing the various locations and Solar equipment as it took me to fill in the form – 2 and a half hours!  If you’re in the same boat, take pictures with a phone and fill the form in later on a laptop – you’ll save yourself a lot of hassle.

Once the quote form is filled in it goes off to your local installer (mine was 50 odd miles away) who takes a look and tells Tesla how much for their part installing the Powerwall will be.  I found this bit a little odd as we’d given various locations in the house where the Powerwall could go, but we weren’t told where it would go, so ended up asking for our installers details to contact him directly.

After you’re happy with the quote (cost of Powerwall + Installation) your installer then sends a request to the DNO who decides whether you can output from the Powerwall at 3.68 or 5kW.  This bit is the slowest part in the whole process and took around 8 weeks…!  Luckily our DNO was happy for us to output at 5kW from the battery (apologies if this isn’t the correct technical speak!  I’m no good with electrickery).

Mark Cawood (of Cawoods Electricians) and his team arrived around 8:30am on Friday morning.  You don’t get a sense of the size or weight of the Powerwall until you see it in person being lifted out the back of a van!

By 1:30pm the Powerwall and charging point were installed and the Powerwall just needed configuring.  I was surprised the process of configuring the Powerwall was so complicated and problematic.  It took around 30 minutes of trying various connections (wifi, ethernet and 3G) and filling the same form in 5 times to get the Powerwall correctly configured and setup.

By 2:30pm Mark and the guys had cleared up, given us a full demo of how to use the car charger, including some useful tips on how to store the charge cable, made sure we had access on our mobiles to the Tesla app and our Powerwall data and said their goodbyes.

I’d highly recommend Mark and the team if you’re looking to get a Powerwall or solar panels installed.  They were very friendly, tidied up and did a neat job of all the cable runs, answered loads(!) of questions we had, made sure we were able to see our Powerwall on the various devices we own and made sure I knew how to use the car charger.

Since installing the Powerwall we’ve used a grand total of 23 units, far less than our normal 60 odd units.  We’ve even had two complete 100% self-powered days where the solar and Powerwall have provided 100% of our power requirements for the day.

As for the car charger – I haven’t used it yet – still reads 0.26kWh consumed!  I’m trying to spend as little as possible on fuel during the spring-summer months since charging at work is free 😉

Home Monitoring Upgrade (Part 2) – HSQLDB to MySQL

As mentioned in my previous post (see http://blog.v-s-f.co.uk/2017/04/home-monitoring-upgrade/), the first task I have is to migrate from HSQLDB to MySQL.

Because the system logs data every minute while I have power in the house and I want to minimise downtime when I actually have a fully working upgrade, I’ve experimented with a copy of the live HSQL database.

Once I’d copied it from my server to my laptop I then attempted to view the data in notepad++ – yeah, not a particularly smart move! NP++ cannot handle files over about 100M. It also turns out (having more’d the .data file) that the data is not in a readable state. I had a performance issue with a select query a long time back and changed the table to cached.

So, luckily at work a colleague had introduced us all to a great database tool called SQL Workbench. It can work with most databases and unlike SQuirreL, it doesn’t crash when looking at the work DB2 database.

Using SQL Workbench, I’ve then created a script file which creates the new consolidated table and loads data from the old tables in to the new + drops the old tables. The end result is a 122,398KB HSQLDB script file which is human readable.

Next step was to get MySQL running on my server. Instead of installing it directly though, there’s a Docker image available.

My first few attempts at inserting the data from the HSQLDB file in to the MySQL database were less than impressive! One of the attempts had the server running flat out (100% cpu) for over an hour when I finally decided that it was probably not going to complete the import this year and nuked it!

So having learnt a few lessons about not using single row inserts(!), but batching them in to multi-row inserts of 100,000 and a few MySQL deafult parameter increases (although I’m not sure if these are necessary as the batch inserts seemed to make most difference), I was finally able to import the data. It still took a few minutes from running the MySQL container to it being available – but that’s significantly better than running for hours importing the data!!

Now that I have the necessary scripts and knowledge to migrate the data, the next part is re-writing the application that receives the Arduino data, uploads to PVOutput and serves the hot water display Arduino.

Home Monitoring Upgrade

I’ve been monitoring stats from my meter, weather and hotwater tank for over two years now (see http://blog.v-s-f.co.uk/2015/04/home-monitoring-home-made-reborn/) and the application now needs an upgrade.

I now want to log more data from the weather station (temperature and humidity). This should be as simple as adding two new columns to the HSQLDB, changing the application to write in to the two new fields and adding two new fields to the service definition, but it’s not quite that straight forward…

The old app uses an out dated version of Mule on Tomcat in Docker and it’s far too heavy weight for what it needs to be. Therefore it’s time to give it a revamp.

It’s also occured to me recently that instead of storing the data in five separate tables (one for generation, upload info, hotwater, meter and weather data), why not store it in one table. This saves a significant amount of space as there are four less records per minute and it makes adding new columns for additional data sources relatively quick. The HSQLDB that I’ve been using for a while now is over 400M!

So the first task, which is possibly the biggest, is to migrate the data from the five tables in HSQLDB to a single table and then stop using HSQLDB and migrate to MySQL. Why MySQL – it’s actually quite a performant database, it’s free and easy to get running.