Tesla Powerwall 2 Integration

Hi @Paul_Smedley Paul, I wanted to share with you what has happened to me in the past. After installing and maintaining the binding for PW2 and the installation of OH3 on Raspberry, I had a call from Tesla as this integration was going to overload the gateway with requests, up to send it in block, and then it was necessary to replace it !! ie Tesla saw from the gwateway log that there was something in my internal network (which was oh3) that completely clogged the device. I read in previous posts that this was happening and it was actually a problem. I’m not a programmer and I don’t even know English well … be patient … now this problem is solved? can I reinstall everything without fear of being contacted by Tesla? thank you

I am using the binding since over a year, Tesla didn’t contact me.
Could you check how often you check for new data? My interval (in the thing-part of the configuration) is 30 s.

I agree @chilobo, I’ve bene running the local binding for a couple of years, on two different gateways - with no issues. I’m using a 60 second refresh.

ok, now I’ll try its… but…sorry for this stupid question…
whee exactly I have to put the .jar file?
Whic version I have to use? cloud or lacal?
what is the last version of.jar file?? many many thanks !!!

.jar file location depends on what system you run openhab on - windows or linux. On linux it’s /usr/share/openhab/addons/

The latest local version is in the Openhab Marketplace; the latest cloud version is at https://smedley.id.au/tmp/org.openhab.binding.teslapowerwallcloud-3.3.0-SNAPSHOT.jar

In terms of which version to use, it’s up to you. The local binding is read-only - so you can’t modify any settings - BUT - it will work in situations where you have no internet - like during a power outage.

The cloud version allows you to modify settings - and is what I mostly use now.

Hi, thanks, and pls be patient … I’m not a developer and I’m trying to make do myself…
I found this page for the local version of the binding on marketplace :

is it correct?

I’m Using OH3.4.0M2 on Raspberry and I have this folder availables :
/openHAB-addons
/Volumes/openHAB-sys/addons
are they the same ??

I found also your page on Github :
https://github.com/psmedley/openhab-addons/tree/main/bundles/org.openhab.binding.teslapowerwall
but I dind’t found documentation abou how to create a thing and items…
wher can I found the example?
I’m doing all via text file configuration
thanks

Hi Tebraxin,

Just install the bundle via the Marketplace and don’t worry about the file location.

re: text configuration - I never got around to writing the docs for this, there may be some discussion of text based config somewhere in this thread, but I just use the GUI…

Cheers

was trying to use the cloud version but get an error

TeslaPowerwallCloudcontroller returned error while invoking https://owner-api.teslamotors.com/api/1/products

Is there any manual in setting the PW2 up?

Hi Paul,

Thanks for creating the Powerwall binding.
I’m using the local version from the marketplace (3.3.0). It works well for almost 30 minutes, then the powerwall starts reporting ‘API limit reached’ and needs a forced password reset to get it going again.
Having looked at the code, I think it may be because your aren’t reusing the token of every iteration of the poll… you seem to send the username/password and get a new token every query interval.

I thought I’d have a go at modifying the code myself, and struggled badly with understanding how to build the module.

My Powerwall2 software version is 22.26.3.

Is there any chance you could modify the code to cache the token for a few hours and only request a new token at expiry ? I think this may fix it.

Sorry to ask as my original plan was to do the modification myself (failed miserably), and if you need more info, happy to provide it.

Thank you in advance
AlanP

Apologies - I’ve been super busy with life - largely with porting Qt6 to the OS/2 operating system, and have completely missed this.

I’m not going to have time anytime soon to look at this - I will say though, that the powerwall binding has been running for years here with no issues. What update frequency are your running? Here I’m sticking with 60 seconds. Not saying this is a good solution, but it’s a workaround.

Also, I just found today that the powerwallcloud binding had stopped working for me - the site id numbers all changed at some point… People with only one powerwall may not have been affected, as they likely left the site id field blank.

Thanks Paul for the reply. As an ex OS/2 Warp user I’m glad to see it’s not dead yet.

The powerwall binding (and to be clear, I’m talking about the local one) - it does not matter what frequency I set the updates, the powerwall after 30 minutes locks out with ‘API Limit Reached’. Looking at the code, a new token is requested on every poll which I think is the problem (The Cloud one doesn’t do this, instead reusing the token).

The cloud binding works, but it’s frustrating to have to rely on it and annoying when Tesla do ‘Server Maintenance’.

Appreciate you may not have time to make the mod (which I think should be small, but getting the dev environment running not such a small task)… but if you would keep it in mind that would be great. In the meantime, I’ll keep trying to figure out how the heck to do the build myself.

Thanks for answering.

The issues with building as probably due to it being built off of the ‘main’ branch which is now 4.0-snapshot.

Let me at least rebase the code against the 3.4 branch so that it’s buildable.

What platform are you trying to build with?

Thanks Paul.

Debian 11.5 on x86_64

Alan

I rebased the code to the 3.4.x branch - GitHub - psmedley/openhab-addons at teslapowerwall-3.4.x

Alan did you get this complied and running?
I believe I am hitting the same issue with random periodic “Tesla Powerwall returned error while invoking https://powerwall/api/login/Basic and Tesla Powerwall returned error while invoking https://powerwall/api/operation” these appear randomly and as frequently as successful connections. Is this what you were referring to for your fix?
David

Hey all… as 4.0.0 is getting closer, I rebuilt the bindings against 3.4.0 and 4.0.0 - I haven’t (yet) tested these with 4.0.0 - but they still work with 3.4.x

https://smedley.id.au/tmp/org.openhab.binding.teslapowerwall-3.4.0-4.0.0-SNAPSHOT.jar
https://smedley.id.au/tmp/org.openhab.binding.teslapowerwallcloud-3.4.0-4.0.0-SNAPSHOT.jar

Aiming to upgrade one of my instances to the latest 4.0 milestone this weekend…

Cheers,

Paul

FWIW - the two links above are working for me on 4.0.0.M3

OK, the cloud binding works, but the battery percentage and reserver are shown as 0.05% instead of 5% - have to work out why…

Edit: OK took me a while to get around to working this out. This was due to a change in OH4 - I needed to edit the items and set the % type as Metadata.

Hey Paul! Hope you are doing well! I’m looking to move up to 4.0 so happy to help with those efforts. Looks like it doesn’t work as of now. I placed it into the add on folder and it doesn’t show as an option when adding a new thing.

One other question - I’d like to get the battery frequency channel added that I had added in myself on an older copy. Should I submit a pull request with that update? I also had added a grid status switch channel for simplicity on that front.

Thanks for all you do on this!

Hey Jared!

Interesting… both bindings are working for me on two different sites. In my case, it was an in-place upgrade, and other than the changes to units that were required for the ‘cloud’ binding, no other changes were needed.

Is there anything in openhab.log that might explain it?

Apologies I missed your previous changes - I kinda suck at git, so likely screwed up when I rebased. If I get time, I’ll try find those commits and see if I can cherry pick them. I should really try get these into the openhab repo to make things easier - biggest issue is I’m not that much of a programmer, so it gets hard to incorporate the changes that get requested (which I’m sure make the binding better, but are hard for folks like me to fix).

Cheers,

Paul