Tesla Powerwall 2 Integration

Hey Paul,

Thanks for the quick reply. I tried several options:

1.) no credentials
2.) My installer login details
3.) My customer user details.

None seemed to work… All had the same error. For what I am using this for I don’t need to set the reserve level or change settings. I just want to read the battery SOE and site power for hot water proportional heating control. I already have this implemented in my house with a Loxone home automation controller and a seperate stand alone meter. Loxone however refuses to work with the self signed SSL certificate so can’t talk directly to the powerwall gateway which would be ideal. I’m basically using openhab and a raspberry pi as a gateway. Plus its a great chance to learn another platform.

anyways, your help is greatly appreciated and it seems like if we can ignore that authentication in the binding that would be a good option to have to simplify things. Happy to help anyway I can. I’ve just ordered some python books so I can touch up on that side of things as my history is in embedded C and assembler languages.

Cheers, Shane

Hey Shane,

I’ll try fix the code tonight… I’m using the credentials I use for the Tesla app…

Cheers,

Paul

try http://smedley.id.au/tmp/org.openhab.binding.teslapowerwall-2.5.4-SNAPSHOT.jar

yup working sweet now. Thanks paul! Now to learn the rest of Openhab… and python… and linux… sigh. Definitely a lot to learn for a noob! I will get there… step by step.

hahah that’s how I started. As an example of what you can do with rules, here’s the rule I have to notify me if there’s a power outage:

rule "Grid down"
when
  Item TeslaPowerwall_GridStatus changed
then
   if(TeslaPowerwall_GridStatus.state == "SystemIslandedActive")
   {
       sendBroadcastNotification("Grid is not connected")
   }
   if(TeslaPowerwall_GridStatus.state == "SystemGridConnected")
   {
       sendBroadcastNotification("Grid power restored")
   }
end

I keep thinking of things when battery state is 100% a well, but never get around to it :slight_smile:

FWIW, between being stuck at home due to Corona virus restrictions, and the fact that our golden retriever had knee surgery on Thursday, I’m hoping to finally implement the code to change the battery reserve settings, and operating mode.

Next steps after that will be to create a README.md, clean up the code, and get it committed :slight_smile:

Cheers,

Paul

Hey Paul - What refresh rate are you using on your Thing configuration? I had mine set to 1 second however I am having memory dump issues after running for a couple of days and I am wondering if this is the cause… Anyone else having issues with this? It could be a different binding causing the issue however I am only running this binding, Loxone, Systeminfo, and NTP server.

Cheers, Shane

I think I was using 15 seconds - I’m currently running a binding based on the Tesla vehicle binding…

Hey Paul - your powerwall code is great - I can’t get to the 2.5.4 version above though. I’m running the 2.5.0 build. Has the URL changed? Many thanks again - it’s fantastic

Hi, looks the web server isn’t responding :frowning: I reset my router yesterday, I probably forgot to setup the port forwarding rules for the web server. The server is definitely still up, as it’s responding to an IPv6 request.

I should be able to fix this afternoon my time (7:20am my time currently)

I was able to VPN in and the web server should be back up

Many thanks Paul! The extra t in the http was a bit confusing as well! :slight_smile:

All working again. Great binding. Treasure trove of data! Now if only Tesla would give us an API to turn on drawing from the grid, it would be ideal!!! Thanks again

Probably more solar for you in Adelaide than London though :slight_smile:

Hi Paul - I just installed your binding today but I’m not able to connect to my powerwall. I set up my dns so powerwall resolves to the powerwall IP. I’m on Openhab 2.5.7 and in the US. I get this error message:

Tesla Powerwall returned error while invoking https://powerwall/api/login/Basic

Hi Jared,

Does that URL work from a browser? Are you using the 2.5.0 version of the binding or the 2.5.4 one?

Cheers,

Paul

Oops I edited the post and fixed the extra t

using 2.5.4. If I paste that url into a browser I just get ‘method not allowed’

It works! I was stupidly putting in my tesla.com password and not the gateway password. Sorry about that!

1 Like

By the way - is there still hope in controlling the mode/reserve with this api? I know it isn’t visible on the web interface but this would be incredibly useful for my electricity price structure. Thanks for all of the work!