[PROJECT] Driver for Connecting to Your Tesla Powerwall

I'm blind! totally missed that... thx all. So the DarwinsDen version maybe.... I tried that first but keep getting an error installing the driver.... but I'll sort that out elsewhere.

So... wait... is everyone saying that this driver no longer works? I do not have one myself so I always have to rely on everybody's feedback here for whether things are working (or not) or if there are changes to improve it.

If it is broken, happy to try to get it fixed (if possible).

PW3's arent compatible, PW2's are fine.

1 Like

Ok... So I should look at adding PW3 support then I guess?

Will not work for PW3, PW2 is fine (until Tesla messes with it :frowning:)

I think it's a complete re-write. Take a look at the link I put above, I think there is a way to get to the PW 3 but it seems not as straightforward as PW2. There appears to be no internal web server (or at least one that is exposed)

1 Like

Lack of an internal web server WOULD be a show-stopper for the way it works now. Thanks Tesla. Typical big company "all your data belongs to us" method. Let me dig around at the link above and look for anything else online... but I REALLY do not want to do anything off-network for it.

1 Like

I've just installed a PW3 +solar and trying to get some version of intelligence (not me) controlling electric stuff based on excess production or lack there of... anything you need tested lmk. I'm useless at the programming but killer at breaking s*&t other people write. My hurdle with the other version is getting the token. If someone wrote up a how to install/use the phthon 'app' to get the token from something linux based (like a synology DSM 7.2 box, for instance, I'd be grateful. But regardless, lmk if you need some code tested with the pw3. happy to help in ways I can.

This seems useful... maybe... idonno. GitHub - jasonacox/pypowerwall: Python API for Tesla Powerwall and Solar Power Data

Yeah... lots of people do stuff in Python, which I only understand some basics from. Not a language I program in myself and of course the little nuances between languages can really burn you when you try to carry ideas over. Still working on it all though, so thanks for the link. Sometimes having multiple different takes on doing something can make for better understanding overall.

@snell and @bikesquid - i wonder if following the instructions on Jason Cox's pypowerall page and creating a route to the PW3 will allow the current driver to work?

I'm guessing the route will have to be created on the HE Hub and I'm not sure if that is possible.

I don't know enough to comment... and having just said that... I'll comment that it seems the official api for PW3 has changed so don't think it'd be as straightforward as the routing. The 'fleet' api seems to be the best jam for this crap sandwich according to comments I've read. but beyond that iMushroom.

I've found a few 'aftermarket' api's that claim to work for the pw3 and generating the token needed. But they're for people that know stuff,... not me.

Have you come across Teslemetry.com? They sort of "aggregate" the calls to Tesla's Fleet APIs. I use their service to grab a few data points that are not available in the PW2 local API (eg. storm watch status). There is a small monthly charge (about $3) for the service. Also, I use Node-RED to call their service, but they do have a direct integration to Home Assistant. A convoluted way to bring you PW3 into Hubitat (Teslemetry -> HA -> Hubitat), but that may be an option.

EDIT: Another option is using the Homebridge Plugin (GitHub - Teslemetry/homebridge: Homebridge integration for Teslemetry and Tessie)

Nope, that's a new one... I'll shroom around over there. Thx.
It may be helpful to list some of the info I've found, but I don't want to flak the thread with a bunch of junk. So I'll do it!:

https://pypi.org/project/tesla-powerwall/

I did try this windows 'app' to generate a token... but it just exits which didn't feel kosher, so I just uninstalled and ran away from it. Tesla Token Generator - Free download and install on Windows | Microsoft Store

It may be the token generation is my only stumbling block. I don't have iOS so I'm kinda stuck finding a token spitting app. I'm trying to use the integration here:Tesla Powerwall Manager app for SmartThings and Hubitat Hubs - DarwinsDen.com (Thx @dJOS for the link) But when the app wants a token, instead of getting a token itself it just provides a few options for other 3rd party bits of code to install and run to get the token. And then I'm stuck again. And as I understand it tokens expire rapidly, so easy regeneration feels important but idonno.

1 Like

So I'm finally getting to this and see that on that site there is a 'token' area... it seems like that may get me the token requested by that darwinsden.com app. Has anyone tried that yet or would I just need to start up a subscription to test it out?

PS best of the holiday season to all!

I don't think Teslemetry is going to help with the existing darwinsden Powerwall Manager. The Powerwall Manager uses a refresh token to access the Tesla owner's API. That is not the same as the Fleet API that Teslemetry connects to. The token that Teslemetry is referring to is a token to connect to the telemetry API.

I forked the darwinsden app on Github and modified it to work with the Tessie API since I already had a Tessie subscription for my car. GitHub - youzer-name/Tesla-Powerwall-Manager---Tessie: A universal Hubitat and SmartThings app to create advanced Tesla Powerwall schedules, control, monitor, and integrate your Powerwall with SmartThings and Hubitat home automation systems. Modified to use api.tessie.com access to Tesla Fleet API in place of Tesla Owner API

From a quick scan of the Teslemetry site, it looks like they're doing the same thing as Tessie and acting as a proxy to the Fleet API. It should be trivial to make my fork work with their service. All that should be needed is to replace one instance of "API.tessie.com" with "API.teslemetry.com" in the app code (and replace other instances of "Tessie" with "Teslemetry" if you want all the labels to be correct).

I could add a Tessie/Teslemetry switch to my version of the app to let users select one or the other if anyone is interested. Just send me a PM if you're planning to set up a Teslemetry account and want me to make that change.

1 Like

Might be better to post this as it's own project so that people can more easily find the Tessie/Teslemetry API drivers you are making.

3 Likes

apologies for hijacking (temporarily) your thread! @snell.

I'm set. @Alan_F 's suggestion to use his forked version with edits seems to get me what I need for the moment on the PW3. So tho it's early days for the pw3, there is a way. Convoluted and not exactly fill in the blanks, but it does get ya there in the end... had a girlfriend like that once. :rofl:

:v:

2 Likes

No worries. I think people will have an easier time finding it if they are looking for those terms and it comes up as a whole separate project, not just a few mentions in this one. :grinning:

Always good to give people all the options they can use. You never know when someone might not be able to use one method due to "reasons" so if there are others it might solve their need.

1 Like

Just as an FYI, in my struggles I did figure out that the Powerwall 3 has a few options for disconnects. In my case I have the 'backup switch' (not the gateway, so no web access directly), the other option is one of a couple versions of 'backup gateway', which I believe is where the web interface resides and it also functions as a "Protected Load Panel".

So rather the the PW3 and associated API(s) being the only distinguishing characteristic that makes it incompatible, it's further complicated by 'backup switch' vs 'gateway'.
Hope that helps for future development... and I'm willing and able to test if anyone's working to support the PW3. Shoot me a PM if I can be of help.

@snell I have some new data for you to add to your driver. PW2 failed and needs service....

api/system_status
"pinv_state": "PINV_DCStageFault",
"OpSeqState": "Faulted",

Those are the two lines I found for the powerwall that are diff from the working ones. Apparently it stopped working last night and I only noticed since i happened to check the app today.

I also see that the top of that page for full site did update to not include the faulted pw in calculated nominal full.
"nominal_full_pack_energy": 26496,

I have 3 pw's. This section may also be a count of working pw's but does not let you know there is an issue really.
"available_blocks": 2,