core icon indicating copy to clipboard operation
core copied to clipboard

Cannot integrate Powerwall 3 with Tesla integration

Open miguelvelezmj25 opened this issue 1 year ago • 23 comments

The problem

I cannot add the Tesla integration with Powerwall 3. When I enter the IP address of my Powerwall 3 and last 5 characters of the password I get this error:

Screen Shot 2024-04-12 at 11 42 21 PM

What version of Home Assistant Core has the issue?

core-2024.4.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Tesla

Link to integration documentation on our website

https://www.home-assistant.io/integrations/powerwall

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

I have a Powerwall 3

miguelvelezmj25 avatar Apr 13 '24 05:04 miguelvelezmj25

Hey there @bdraco, @jrester, @daniel-simpson, mind taking a look at this issue as it has been labeled with an integration (powerwall) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of powerwall can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign powerwall Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


powerwall documentation powerwall source (message by IssueLinks)

home-assistant[bot] avatar Apr 13 '24 05:04 home-assistant[bot]

Hey @miguelvelezmj25, as discussed in this issue, it seems like the powerwall 3 does not support the same web APIs as the powerwall 2. There is some work going on to figure out this new API and make it usable, but nothing final. Therefore, the powerwall 3 is probably currently unusable with home-assistant.

jrester avatar Apr 14 '24 10:04 jrester

I am having the same issue with Powerwall 3 and HA as described by @miguelvelezmj25 above. Any timeline on addressing compatibility with PW3 would be very helpful. Thank you.

devangapatel avatar Apr 17 '24 19:04 devangapatel

Same issue as above.... error 404

Micahgbr avatar Apr 21 '24 22:04 Micahgbr

Same Issue Pwall

lvoaks avatar May 07 '24 22:05 lvoaks

Please add me to the list of having the same issue!!

lvoaks avatar May 14 '24 22:05 lvoaks

Looks like some progress after adding a static route based on https://github.com/jasonacox/Powerwall-Dashboard/discussions/392

Wondering if this is the breakthrough for PW3 support being added to HA?

pavandave avatar Jun 07 '24 12:06 pavandave

Hello, are there any updates that can be shared on this known issue?

LeoBuzz1171 avatar Jun 19 '24 17:06 LeoBuzz1171

I was following the Powerwall-Dashboard thread and with the new update about the static route being required, I was able to get some info from Powerwall-Dashboard using their local login method with just the full password. That project uses a different library pypowerwall https://github.com/jasonacox/pypowerwall/

I was looking at trying to get the library this project uses working with my PW3, tesla_powerwall but in my test environment I'm unable to run the script and get the same/similar error. Ideally we should still be able to use local credentials with the full password and that should work.

@jrester I glanced over how each library handing the password and login and maybe I am missing something but that may be an interesting place to look. I would expect using the IP of 192.168.91.1 with the full password should work. Let me know if I should open another thread or directly the main tesla_powerwall library for this.

Snippet of code:

from tesla_powerwall import Powerwall
import asyncio

async def main():
    ip = "192.168.91.1"
    print(ip)
    password = "<FULL PW>"
    print(password)
    power_wall = Powerwall(ip)

    await power_wall.login(password)

Trace back where I'm hitting this:

Traceback (most recent call last):
  File "/mnt/c/Users/Agent/Documents/tesla_powerwall/pw2.py", line 54, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/mnt/c/Users/Agent/Documents/tesla_powerwall/pw2.py", line 12, in main
    await power_wall.login(password)
  File "/home/agent/.local/lib/python3.10/site-packages/tesla_powerwall/powerwall.py", line 67, in login
    return self.login_as(User.CUSTOMER, password, email, force_sm_off)
  File "/home/agent/.local/lib/python3.10/site-packages/tesla_powerwall/powerwall.py", line 60, in login_as
    response = self._api.login(user, email, password, force_sm_off)
  File "/home/agent/.local/lib/python3.10/site-packages/tesla_powerwall/api.py", line 154, in login
    return self.post(
  File "/home/agent/.local/lib/python3.10/site-packages/tesla_powerwall/api.py", line 144, in post
    return self._process_response(response)
  File "/home/agent/.local/lib/python3.10/site-packages/tesla_powerwall/api.py", line 88, in _process_response
    self._handle_error(response)
  File "/home/agent/.local/lib/python3.10/site-packages/tesla_powerwall/api.py", line 64, in _handle_error
    raise AccessDeniedError(
tesla_powerwall.error.AccessDeniedError: Access denied for resource /api/login/Basic: bad credentials: Login Error

I am investigating a few options for integrating my PW3 into HA outside of this library getting resolved and trying to help authors of both libraries use my PW3 with some tests.:

  • Getting HA to pull data directly from Powerwall-Dashboard's influxDB
  • Manually installing pypowerwall library on HA and doing local polling (removing need for InfluxDB)
  • Trying to update existing integration (tesla_powerwall)) with the new library (pypowerwall) and sharing on HACS if/when I get there.

pavandave avatar Jun 24 '24 13:06 pavandave

For your tests, were you using the tedapi interface? pypowerwall has a thread of PW3 integration here: https://github.com/jasonacox/pypowerwall/issues/97. You will need to supply the gw_pw. Snippit that I pulled from the pw3 thread here:

import pypowerwall

PW_GW_PWD="GWPASSWD" pw = pypowerwall.Powerwall("192.168.91.1", gw_pwd=PW_GW_PWD)

pw.power() pw.level() pw.battery_blocks()

I have managed to get pypowerwall and powerwall dashboard running on a separate system without home assistant os. If you would like to work together I'm interested in getting pypowerwall enabled in HA.

fatherchaos avatar Jun 29 '24 14:06 fatherchaos

@fatherchaos - pypowerwall works for me, I got the dashboard working too and would love to contribute to pypowerwall with Home assistant.

Some sample output:

powerwall$ python3 pypower.py
Site Name and Timezone {'site_name': 'My Home', 'timezone': 'America/Chicago'}
Batter Percentage {'percentage': 23.29545454545455}
Power {'site': 3235, 'solar': 0, 'battery': 0, 'load': 3227.5000000000005}
Current mode self_consumption

pavandave avatar Jul 01 '24 01:07 pavandave

I would very much like to see a resolution to this. Just had a PW3 installed this week. Let me know if there's anything I can do to contribute or help move it along. I've never contributed here but I'm a pretty experienced python programmer.

lweighall avatar Jul 18 '24 02:07 lweighall

Has there been any movement here? I'd love to add my PW3 to HA

jarednm avatar Aug 26 '24 16:08 jarednm

I used Teslemetry to make it work. I'm not a fan of the (inexpensive) subscription, but it works.

Sent with Outlook for iOShttps://aka.ms/o0ukef


From: jarednm @.> Sent: Monday, August 26, 2024 12:58:03 PM To: home-assistant/core @.> Cc: LeoBuzz1171 @.>; Comment @.> Subject: Re: [home-assistant/core] Cannot integrate Powerwall 3 with Tesla integration (Issue #115513)

Has there been any movement here? I'd love to add my PW3 to HA

— Reply to this email directly, view it on GitHubhttps://github.com/home-assistant/core/issues/115513#issuecomment-2310652967, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BI3PWVCCYX2ZPVAKMKDPXB3ZTNNBXAVCNFSM6AAAAABGFGBGLCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJQGY2TEOJWG4. You are receiving this because you commented.Message ID: @.***>

LeoBuzz1171 avatar Aug 26 '24 17:08 LeoBuzz1171

Has there been any movement here? I'd love to add my PW3 to HA

I noticed Tesla Fleet was added in the Home Assistant 2024.8 update (https://www.home-assistant.io/integrations/tesla_fleet) and it's free.

It at least gives kW and gaps for battery, grid, load, and solar power. There's also a binary Grid Services Active and Grid Services Enabled.

eddy-r avatar Aug 26 '24 18:08 eddy-r

Has there been any movement here? I'd love to add my PW3 to HA

I noticed Tesla Fleet was added in the Home Assistant 2024.8 update (https://www.home-assistant.io/integrations/tesla_fleet) and it's free.

It at least gives kW and gaps for battery, grid, load, and solar power. There's also a binary Grid Services Active and Grid Services Enabled.

This is promising. It looks like the binary signals are not working and are either Unknown or Unavailable. There are currently also no actions available through the fleet api (e.g start/stop charging).

jarednm avatar Aug 27 '24 01:08 jarednm

This is promising. It looks like the binary signals are not working and are either Unknown or Unavailable. There are currently also no actions available through the fleet api (e.g start/stop charging).

Yeah I'm still working on adding the remaining features like commands.

If the binary sensors aren't working raise an issue with a Diag. I don't have a Powerwall (yet) so it's hard to test.

Bre77 avatar Aug 27 '24 03:08 Bre77

Probably my final update on this thread but I wanted to follow up on something I was working earlier. I started working on pulling apart the existing Tesla integration and building a custom component to get some raw data using pypowerwall library but even though I could run the commands from that package via CLI, when I went to add them to a custom component, I hit some errors due to it using urllib3 under the hood.

2024-09-01 15:22:42.019 ERROR (MainThread) [pypowerwall.tedapi] Error Details: Caught blocking call to putrequest with args (<urllib3.connection.HTTPSConnection object at 0x7f5d22a4e420>, 'GET', '/') inside the event loop by custom integration 'custom_powerwall' at custom_components/custom_powerwall/__init__.py, line 28: pw = pypowerwall.Powerwall(PW_GW_IP, gw_pwd=PW_GW_PWD). (offender: /usr/local/lib/python3.12/site-packages/urllib3/connection.py, line 219: return _HTTPConnection.putrequest(self, method, url, *args, **kwargs)), please create a bug report at <private github repo>.
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#putrequest

The good news is that PW3 data is pretty much validated and you can use the TEDAPI to grab all this data and pypowerwall repo has pretty good documentation on how to get it all. Full thread with today's updates and link to beta with the fix to get PW3 working - https://github.com/jasonacox/Powerwall-Dashboard/discussions/392

I'm probably done trying to build the local polling integration or update the existing repo for a bit. Going to revert to possibly using the fleet APIs for now or creating influxDB sensors on HA to poll my Powerwall Dashboard influxDB. I hope this does get fixed though because the big advantage for HA is local control, and even if it is limited to monitoring, that is pretty powerful.

pavandave avatar Sep 02 '24 01:09 pavandave

Honestly I was hoping for a more HA integrated option because it's easy for end users :) I've looked at the Powerwall-Dashboard project and while it looks amazing, I've failed 3 times to figure out how to get it running on my Synology :(

jwvanderbeck avatar Sep 20 '24 15:09 jwvanderbeck

If you're looking for Powerwall integration that works within Home Assistant, I got Tesla Fleet to work with the Energy dashboard. After getting Tesla Fllet going, I've put together my method to get the Energy dashboard and Tesla Fleet talking to each other herehttps://docs.google.com/document/d/15yREpCgAmLnLrfSl11WUsUsDJvxq8RdonRP0JsWMAxQ/pub.


From: jwvanderbeck @.> Sent: Friday, September 20, 2024 11:43:05 AM To: home-assistant/core @.> Cc: Eddy Redondo @.>; Manual @.> Subject: Re: [home-assistant/core] Cannot integrate Powerwall 3 with Tesla integration (Issue #115513)

Honestly I was hoping for a more HA integrated option because it's easy for end users :) I've looked at the Powerwall-Dashboard project and while it looks amazing, I've failed 3 times to figure out how to get it running on my Synology :(

— Reply to this email directly, view it on GitHubhttps://github.com/home-assistant/core/issues/115513#issuecomment-2364018171, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABPXJ22KFXOY6FMLF5KOVQTZXQ7ATAVCNFSM6AAAAABGFGBGLCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRUGAYTQMJXGE. You are receiving this because you are subscribed to this thread.Message ID: @.***>

eddy-r avatar Sep 20 '24 16:09 eddy-r

If you're looking for Powerwall integration that works within Home Assistant, I got Tesla Fleet to work with the Energy dashboard. After getting Tesla Fllet going, I've put together my method to get the Energy dashboard and Tesla Fleet talking to each other herehttps://docs.google.com/document/d/15yREpCgAmLnLrfSl11WUsUsDJvxq8RdonRP0JsWMAxQ/pub. ________________________________ From: jwvanderbeck @.> Sent: Friday, September 20, 2024 11:43:05 AM To: home-assistant/core @.> Cc: Eddy Redondo @.>; Manual @.> Subject: Re: [home-assistant/core] Cannot integrate Powerwall 3 with Tesla integration (Issue #115513) Honestly I was hoping for a more HA integrated option because it's easy for end users :) I've looked at the Powerwall-Dashboard project and while it looks amazing, I've failed 3 times to figure out how to get it running on my Synology :( — Reply to this email directly, view it on GitHub<#115513 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABPXJ22KFXOY6FMLF5KOVQTZXQ7ATAVCNFSM6AAAAABGFGBGLCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRUGAYTQMJXGE. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Thank you I will take a look at this. I tried integrating Teslemetry but while it gives me a ton of sensors, none of them seem to work with the energy dashboard, so maybe your document will help me sort that out.

jwvanderbeck avatar Sep 20 '24 17:09 jwvanderbeck

Hi, I have PW Fleet working now, and have looked in to the dashboard project (although for some reason it's not working with the local access, again, just fleet). That all works well for energy monitoring. But ideally I need the integration to be able to control the PW3 as I want to be able to do things like stop draw from the battery when charging the car etc... is there any likelihood of this being possible via fleet? Or is there any light at the end of the tunnel for the core integration (or any other that can get more detailed info and control) working in HA? Thanks

ajroads avatar Sep 21 '24 11:09 ajroads

Hi, I have PW Fleet working now, and have looked in to the dashboard project (although for some reason it's not working with the local access, again, just fleet). That all works well for energy monitoring. But ideally I need the integration to be able to control the PW3 as I want to be able to do things like stop draw from the battery when charging the car etc... is there any likelihood of this being possible via fleet? Or is there any light at the end of the tunnel for the core integration (or any other that can get more detailed info and control) working in HA? Thanks

I'm currently hooked up through the Teslemetry addon and while I haven't actually tested any changes, it does expose some settings that suggest the ability to control the PWs

image

jwvanderbeck avatar Sep 21 '24 14:09 jwvanderbeck

If you're looking for Powerwall integration that works within Home Assistant, I got Tesla Fleet to work with the Energy dashboard. After getting Tesla Fllet going, I've put together my method to get the Energy dashboard and Tesla Fleet talking to each other herehttps://docs.google.com/document/d/15yREpCgAmLnLrfSl11WUsUsDJvxq8RdonRP0JsWMAxQ/pub. ________________________________ From: jwvanderbeck @.> Sent: Friday, September 20, 2024 11:43:05 AM To: home-assistant/core @.> Cc: Eddy Redondo @.>; Manual @.> Subject: Re: [home-assistant/core] Cannot integrate Powerwall 3 with Tesla integration (Issue #115513) Honestly I was hoping for a more HA integrated option because it's easy for end users :) I've looked at the Powerwall-Dashboard project and while it looks amazing, I've failed 3 times to figure out how to get it running on my Synology :( — Reply to this email directly, view it on GitHub<#115513 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABPXJ22KFXOY6FMLF5KOVQTZXQ7ATAVCNFSM6AAAAABGFGBGLCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRUGAYTQMJXGE. You are receiving this because you are subscribed to this thread.Message ID: @.***>

I cannot THANK YOU enough for documenting this process! I was able to get the energy component of Home Assistant working with the process you explained. I can see the solar production, the powerwall charge/discharge and the import and exports from/to the grid! This is fantastic! Thank you once again.

devangapatel avatar Sep 26 '24 13:09 devangapatel

Native energy dashboard sensors (using the history API) are coming to Teslemetry in 2024.10 and should come to Tessie and Tesla Fleet in 2024.11

Bre77 avatar Sep 27 '24 03:09 Bre77

Teslemetry has a couple of interesting controls exposed that could give you control over PW behaviour and allow things like stopping an ev charger pulling from the battery (e.g when using intelligent octopus). Hopefully these get pulled in to core functionality soon.
IMG_3072

ajroads avatar Sep 29 '24 17:09 ajroads

If you're looking for Powerwall integration that works within Home Assistant, I got Tesla Fleet to work with the Energy dashboard. After getting Tesla Fllet going, I've put together my method to get the Energy dashboard and Tesla Fleet talking to each other herehttps://docs.google.com/document/d/15yREpCgAmLnLrfSl11WUsUsDJvxq8RdonRP0JsWMAxQ/pub. ________________________________ From: jwvanderbeck @.> Sent: Friday, September 20, 2024 11:43:05 AM To: home-assistant/core @.> Cc: Eddy Redondo @.>; Manual @.> Subject: Re: [home-assistant/core] Cannot integrate Powerwall 3 with Tesla integration (Issue #115513) Honestly I was hoping for a more HA integrated option because it's easy for end users :) I've looked at the Powerwall-Dashboard project and while it looks amazing, I've failed 3 times to figure out how to get it running on my Synology :( — Reply to this email directly, view it on GitHub<#115513 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABPXJ22KFXOY6FMLF5KOVQTZXQ7ATAVCNFSM6AAAAABGFGBGLCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRUGAYTQMJXGE. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Thanks for this, very well laid out and works a treat.

Colster69 avatar Nov 05 '24 12:11 Colster69

Native energy dashboard sensors (using the history API) are coming to Teslemetry in 2024.10 and should come to Tessie and Tesla Fleet in 2024.11

@Bre77 did the native sensors make it to 2024.11? will this replace the need for creating template senors to split out positive and negative?

eshagh avatar Nov 07 '24 02:11 eshagh

Native energy dashboard sensors (using the history API) are coming to Teslemetry in 2024.10 and should come to Tessie and Tesla Fleet in 2024.11

@Bre77 did the native sensors make it to 2024.11? will this replace the need for creating template senors to split out positive and negative?

It did to Teslemetry, it did not to Tesla Fleet (but will hopefully in 2024.12).

Bre77 avatar Nov 07 '24 02:11 Bre77

If you're looking for Powerwall integration that works within Home Assistant, I got Tesla Fleet to work with the Energy dashboard. After getting Tesla Fllet going, I've put together my method to get the Energy dashboard and Tesla Fleet talking to each other herehttps://docs.google.com/document/d/15yREpCgAmLnLrfSl11WUsUsDJvxq8RdonRP0JsWMAxQ/pub.

@eddy-r - thanks very, very much for this! It's working like a charm for me with my Powerwall 3s and I can trigger on sensor.[home]_powerwall_grid_status for any off-grid actions I want to take.

Cheers!

muddman avatar Nov 08 '24 19:11 muddman