Tesla Powerwall 2 Integration

Hello @Paul_Smedley, Is the source for your plugin available on github? I would like to add support for /api/solar_powerwall
I’m not sure if this API exists in all Powerwall units, but it is in the “Powerwall+” units, providing information about the inverter and solar arrays.

Hi @JackBeQuick - source is at GitHub - psmedley/openhab-addons at teslapowerwall

Hi, I confirm that with 3.1.0 M3 is working but not with current snapshots.
I hope that soon or later this will be fix on the snapshot or binding.
Thanks
Lorenzo

OK - quick recompile - https://smedley.id.au/tmp/org.openhab.binding.teslapowerwall-3.1.0-SNAPSHOT.jar

Due to my incompetence in git, source is at Commits · psmedley/openhab-addons · GitHub

I tried this jar with 3.1.0 M4 and got the warning

2021-05-30 11:35:37.052 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.teslapowerwall-3.1.0-SNAPSHOT.jar

org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.teslapowerwall [43]

  Unresolved requirement: Import-Package: javax.measure; version="[2.1.0,3.0.0)"

	at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.16.200.jar:?]

	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:440) ~[org.eclipse.osgi-3.16.200.jar:?]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.6.8]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.6.8]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [bundleFile:3.6.8]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [bundleFile:3.6.8]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.6.8]

	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.6.8]

But the binding is working fine - thank you.

Thanks for testing - that error is similar to that reported in Unresolved requirement: Import-Package: javax.measure; version="[2.1.0,3.0.0)"

I rebuilt with the suggested fix from there - https://smedley.id.au/tmp/org.openhab.binding.teslapowerwall-3.1.0-SNAPSHOT.jar

Cheers,

Paul

1 Like

Just downloaded and it seems working fine
Thanks.
Lorenzo

Thank you - error is not popping up anymore.

is this newest code on github? I have some additions to your binding that i’ve been using and i’ve had difficulty trying to build your binding from the github code - github client is being weird to me though saying the date is 4 months old while the website is showing 5 days ago (i think this is just updates to the core openhab addons code tho no?)

Strike this - I see it is just a simple change to the pom file. I was just confused because I was expecting your updates to be committed on github already :slight_smile: hope you are doing well!

Hey Jared!

Branch is now teslapowerwall2 - I screwed up the teslapowerwall branch :frowning:

All good here, just busy!

OK - seems I hadn’t pushed the latest changes… should all be there now, including @jfrank1845 's change to add a grid status channel.

https://smedley.id.au/tmp/org.openhab.binding.teslapowerwall-3.1.0-SNAPSHOT.jar updated

@Paul_Smedley any plans to create a pull request that integrates your bundle into the upstream of openhab/openhab-addons?

1 Like

@lordyavin it’s definitely the plan, someone needs to finish the readme.md first - I hate writing those :frowning:

Okay, that is something I can help with :blush: In the meantime please use githubs release feature to provide snapshots. I was confused with the latest release on github and the snapshot provided here.

1 Like

I would like to have a look at the code too, perhaps I can help with the README.MD.
How do I go about retrieving it?
When I try to fetch it from
https://github.com/psmedley/openhab-addons/tree/teslapowerwall
github desktop copies all auf openhab, but there is no directory with powerwall or powerwall 2 in it.

Do I fork starting from
https://github.com/psmedley/openhab-addons/commits/teslapowerwall
or from
https://github.com/psmedley/openhab-addons/commits/teslapowerwall

When I changed the goecharger-binding the code was part of openhab already, so this seems to be different. Can you point me to some explanation what to do?

@chilobo I assume your are not familiar with git. Usually you clone/fork the whole repository. Clone if you have write access to the repo, fork if not. Fork means you create a copy on github (or somewhere else). Then clone that fork (your fork) on your computer and checkout the branch you want to work with/base on. Apply your changes commit and push them and create a pull request to @Paul_Smedley’s repo.

The powerwall code is in a branch called teslapowerwall2 - checkout GitHub - psmedley/openhab-addons: Add-ons for openHAB and switch to that branch.

hi @Paul_Smedley , could you pls link the last version of your .jar for Tesla Powerwall2?
thanks

Latest is still https://smedley.id.au/tmp/org.openhab.binding.teslapowerwall-3.1.0-SNAPSHOT.jar

Hi, I am occuring the famous autentification error on https://IP/api/login/Basic

{"code":401,"error":"bad credentials","message":"Login Error"}

In the Thing setting I put the local id (customer) and local pw correctly
If I invoke the https://api/meters/aggregates I get the data

In the log file after getting the getMeterAggregates I have the following warn

2021-10-17 18:39:39.469 [WARN ] [rwall.internal.TeslaPowerwallHandler] - Unexpected error connecting to Tesla Powerwall
	at org.openhab.binding.teslapowerwall.internal.api.MeterAggregates.parse(MeterAggregates.java:67) ~[?:?]
	at org.openhab.binding.teslapowerwall.internal.TeslaPowerwallWebTargets.getMeterAggregates(TeslaPowerwallWebTargets.java:127) ~[?:?]
	at org.openhab.binding.teslapowerwall.internal.TeslaPowerwallHandler.pollStatus(TeslaPowerwallHandler.java:129) ~[?:?]
	at org.openhab.binding.teslapowerwall.internal.TeslaPowerwallHandler.poll(TeslaPowerwallHandler.java:96) ~[?:?]

any advice to solve the issue? I’am on OH 3.2.0
Thanks
Lorenzo