Tesla Powerwall – Early Differences In Grid Consumption

It’s been just over 5 months since we had our Tesla Powerwall installed and I thought I’d give an early update on the difference it’s made to our grid consumption so far. It is still early days and I will provide another update once I have a few more readings – probably late next year.

Our electricity billing periods are:

  • Jan 16th
  • April 16th
  • July 16th
  • October 16th

Our Tesla Powerwall was installed on June 1st 2018, which means the July bill should have showed some difference in kWh grid consumption (especially given the lovely summer we had this year!) even though it was a partial month of having the Powerwall, whereas the October bill was a complete month of having the Powerwall in operation.

I think the graph says it all! Even on the July bill, we saved 266* kWh or a 37.5% drop and on the October bill we saved a massive 560* kWh or 70.3% drop!

I just wish we’d had the battery installed 6 weeks earlier to benefit even more from the fantastic summer weather we had this year! 🙂

* based on the average of units consumed 2013 to 2017

For those interested in the figures:

July October
2013 663 814
2014 694 778
2015 783 847
2016 724 792
2017 681 754
2018 443 237

Ubiquiti mFI mPower Project – Part 1

This year I upgraded the home monitoring suite in my house from a Wattson to a Splunk dashboard running on a tablet in the kitchen. The primary reason for doing this was that after getting the Tesla Powerwall, Wattson no longer was able to correctly state how much power was being imported/exported from the home until the battery was completely charged. The downside of getting rid of Wattson was that we relied on the Optiplugs to run the immersion and a radiator when there was excess power being sent to the grid. So I needed another solution to running the immersion on the rare days when the Powerwall will be completely charged and we’re exporting to the grid.

After a fair amount of time searching for a wireless plug with an API, I found the following plug https://wifiplug.co.uk/ that ticked all the boxes, but being the little bit paranoid I am, I didn’t really want a plug that could theorietically be controlled by anyone from the internet. Also, if that company went bust, how would I control the plug without their API gateway?

I then spent another handful of hours searching and came across the following blog https://blog.linitx.com/ubiquiti-mfi-mpower/ which happened to use a wifi plug that doesn’t rely on an internet connection and is from the same company that I use for my WiFi access points! The only problem is that unlike the wifiplug, this one doesn’t have an official API and there isn’t a UK plug version… But what the heck, at least it’d be an interesting project!

So I bought the European single socket version from wifi-stock.co.uk/. The next day I got a call from wifi-stock to check “I hand’t made a mistake and that I did realise it wasn’t a UK power socket” – that was nice and a good idea! 🙂

I also needed a UK to European adaptor and a European to UK adaptor to be able to use it in a UK socket and power a UK device. This makes the plug stick out quite far from the socket, but it is secure and doesn’t drop over time.

A couple of days later my plug arrived and I set about logging into the device as mentioned on the blog using ssh. That was suprisingly easy as it uses the default username and password that’s used on some of the other Ubiquiti devices – username:ubnt, password:ubnt. I spent a couple of hours poking around on the file system, making the lights blink on and off and tested out that it was possible to turn the plug on and off by echoing 1/0 to the relay

echo 1 > /proc/power/relay1
echo 0 > /proc/power/relay1

I also found the code for the web GUI on the plug /usr/www/mfi/power.cgi (the code behind this: http:///mfi/power.cgi). And that got me thinking…

I was originally going to control the plug from my server via the home monitoring application using ssh, but that means the Java app will have to invoke the ssh command and I’d prefer to have an API on the plug that I could call. I could write another cgi file like the power.cgi file, remove the session aspect and control the plug as Ubiquiti have done, but why bother! Ubiquiti has done all the leg work – I can just use their web app! 🙂

So I began playing with the power GUI and found that it was making POST and GET requests from the GUI to http:///sensors/1/ to fetch the current status and turn the plug on and off. Well that’s easy to control! After a bit of experimentation, these are the four curl commands I need.

Login

You will get an AIROS_SESSIONID back which needs to be put in as a cookie header in the following curl requests.

Get plug data

curl -v \
    http://<device ip>/sensors/1/ \
    -H "Cookie: AIROS_SESSIONID=015152b0143a0267f8f0ae30fcb42f6f"
{"sensors":[{"state":{"output":0,"power":0.0,"energy":0.0,"enabled":0,"current":0.0,"voltage":0.0,"powerfactor":0.0,"relay":0,"lock":0}}],"status":"success"}
{"sensors":[{"state":{"output":1,"power":0.0,"energy":0.0,"enabled":0,"current":0.0,"voltage":0.0,"powerfactor":0.0,"relay":1,"lock":0}}],"status":"success"}

Switch the plug off

curl -v \
    -X PUT \
    http://<device ip>/sensors/1/ \
    -H "Cookie: AIROS_SESSIONID=015152b0143a0267f8f0ae30fcb42f6f" \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -d "output=0"
{"status":"success"}

Switch the plug on

curl -v \
    -X PUT \
    http://<device ip>/sensors/1/ \
    -H "Cookie: AIROS_SESSIONID=015152b0143a0267f8f0ae30fcb42f6f" \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -d "output=1"
{"status":"success"}

Output and enabled on

The above is only controlling the output field but on the GUI you will notice there are two fields, output and enabled. Switching enabled on gives stats about the plugs energy usage but it’s not required to control the device.

To switch the plug on with output and enabled on, simply run

curl -v \
    -X PUT \
    http://<device ip>/sensors/1/ \
    -H "Cookie: AIROS_SESSIONID=015152b0143a0267f8f0ae30fcb42f6f" \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -d "output=1&enabled=1"
{"status":"success"}

If you then request the plug data, you would get something similar to the following response:

curl -v \
    http://<device ip>/sensors/1/ \
    -H "Cookie: AIROS_SESSIONID=015152b0143a0267f8f0ae30fcb42f6f"
{"sensors":[{"state":{"output":1,"power":958.341251254,"energy":44.0625,"enabled":1,"current":4.023638963,"voltage":238.905914783,"powerfactor":0.99695206,"relay":1,"lock":0}}],"status":"success"}

 

In the next part I’ll go through how I controled the plug from Java using the APIs above.

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 😉