Tesla Powerwall II

solar

(Robin Shipston) #1

Here’s a very basic device handler for the Tesla Powerwall II

It will show you charge level and the current power for grid, site, solar and Powerwall.
It requires a FQDN for your Powerwall, because SmartThings is a PITA about allowing direct access via IP addresses unless you also write a device handler app - and I lost the will to live trying to decipher the awful documentation on doing this. Someone that knows what they are doing could probably sort this out really quickly.

The SmartApp simply sends you a push notification when the charge level goes through configurable upper or lower limits, with the simple purpose of alerting you when the battery is full so that you can turn something on to make use of excess solar. The SmartApp could be easily modified to switch a load on and off for you in response to charge levels.

Hope someone finds it useful.


(Benji) #2

I figured this would happen sooner or later! Nice one! While I don’t have any Powerwalls I am definitely following this!


(Tony Orr) #3

This is great, thank you Robin. I’m still waiting for my PW to be installed so can’t make use of this quite yet however my plan is to pull the solar generation and PW % (Charging/discharging) to display on a LaMetric device. I’m assuming the DH will give me access to those parameters?


(Robin Shipston) #4

Everything you need you can get with calls to:

For charge level: http://pw_ip_address/api/system_status/soe

Everything else:http://pw_ip_address/api/meters/aggregates


(Tony Orr) #5

Ok. Thanks Robin, will have a play when it (finally) gets installed.


(Benji) #6

If you have multiple PW’s does the power output capacity add together or is it still 5kW/7kW peak total and just the storage capacity increases?


(Robin Shipston) #7

In the UK it will be limited to 3.5kW, unless you get a G59 approval from the local grid company.
Even then, you will not get over about 5.7 in real power.
If you have more than one PW they are all connected to the same gateway, and the storage capacity is increased. You’ll have to check with your installer if you can install to give a higher output. There are issues with interference and messing up the AC supply phase.


(Robin Shipston) #8

Interesting that Tesla have removed my post about this on their forum.


(Benji) #9

Whaaaaaat… Did you link your DTH or something?

I miss the luxury of 240V * everywhere * in the UK, if you even have a slight hobby for power tools or power amps for A/V, then it becomes a struggle on 120V with the majority of outlets limited to 15A…


(Robin Shipston) #10

And the kettle takes an age to boil :joy:


(Benji) #11

Kettle?! No one has kettles over here, I had to track one down and buy one when my parents came and visited :smiley:


(The Slot Machine) #12

Trying to add this DTH but when I update from repo to install, theres nothing there


(Robin Shipston) #13

I created custom device and app, used “From Code” option for both, and pasted the code in.


(Robin Shipston) #14

However, it stopped working after the most recent Powerwall update. So guessing they changed their API. Not had chance to investigate yet.


(The Slot Machine) #15

Oh ok. Which port does power wall use to communicate? Not sure which port to forward to


(Robin Shipston) #16

It was just http, they may have changed it to https now. However if your hub and the PW are on the same network then it’s only a local call, no port forwarding required. If you do need to open it up to external access at the very least put a remote IP address restriction on it, as you can turn a PW on and off and work out what the system password is without any authentication.


(Tony Orr) #17

Hi Robin, does this still work following the latest 1.22.1 PW firmware upgrade? I can pull stats using domain:port so know connectivity is ok but despite that the app is unable to display any data. Could they have altered the api calls?


(Robin Shipston) #18

Hi Tony

Tesla introduced a self-signed certificate to achieve a HTTPS connection. Unfortunately the Groovy language doesn’t support calls that use self signed certificates. I asked Tesla about doing it in a better way to allow continued access and they weren’t interested (putting it politely). So it will need a workaround using an app on another device (Raspberry Pi is a possibility) to fetch the data and pass it to SmartThings.


(Tony Orr) #19

Ah, ok, that’s a shame. I was so close to having the perfect setup. Thanks for the prompt response.