-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pypowerwall fails to get data #568
Comments
Verify.sh output: Checking pypowerwall
Checking telegraf
Checking influxdb
Checking grafana
Checking weather411
All tests succeeded. |
I have enabled the debug flag in PyPowerwall and logged this via docker:01/13/2025 05:13:38 PM [proxy] [INFO] pyPowerwall [0.12.0] Proxy Server [t66] - HTTP Port 8675 |
So, I actually found the issue and fixed it : no idea what caused it though! @jasonacox : I noticed that the error given by the above parser log : json.decoder.JSONDecodeError: Extra data: line 1 column 2736 (char 2735) corresponded to a closed curly bracket in .pypowerwall.auth. I removed that curly bracket, restarted pypowerwall from docker, and it all runs fine now! No idea what caused it (maybe a bugged update.sh? ) Happy to help you trace back the root cause of this issue. |
Same exact issue with my setup, lost data around 5am and can't connect again. Logs reporting "01/13/2025 05:34:20 PM [pypowerwall] [ERROR] Failed to get /api/system_status/grid_status" after initial errors in locating the Gateway IP but then switching to "Solar Mode" only. Everything else was green with verify.sh Gonna try what you did and see if that works! |
Well, doesn't seem to be the same issue, my log files don't call out a decoder error, just mostly fails to get api data after connecting: 01/13/2025 05:48:11 PM [proxy] [INFO] pyPowerwall [0.12.0] Proxy Server [t66] - HTTP Port 8675 |
Checking pypowerwall
Checking telegraf
Checking influxdb
Checking grafana
Checking weather411
|
Well... and just as strangely as it started it has resolved itself! Tried to verify the Gateway was accessible in my LAN by going to its IP and logging into it's web-portal. It was, and afterwards the dashboard started working again... |
@matteoandreozzi - Just so I am clear, your setup is Solar Only (or cloud mode)? I see that it some of the config data, along with a missing IP address. In any case, the corruption of the auth file is the cause and worth investigating. In cloud mode, the token will expire and renegotiate with a new token. The corruption could happen then. We are using the teslapy library for that. The error is also happening in that library. I'll take a look to see what we can do to mitigate or decoupling from that library. |
@wiltocking Your issue seems to be:
This means pypowerwall was unable to connect to that gateway. The host running pypowerwall was unable to connect to 192.168.91.1 - which could be a lot of different networking reasons. One common one is when the Gateway is upgrading firmware, but that may not be your reason. Check your dashboard to see if there were any patterns or alerts that may give a clue as to why it stopped. |
Hi @jasonacox my setup is Powerwall plus solar, with auth token authentication (not the new fleet one, to be exact). I can confirm the installation is back to fully functional now after removing that spurious extra '}' . Let me know how can I help with debugging the issue. Things I have done which might have caused it:
|
Well, it’s updating again but I’ve lost the Powerwall temps and local data that we had established before. Verify.sh when back to stating Not Connected so I’ll have to dig into it a bit to see if I can restore the local “Hybrid” connection we had. Didn’t see any unusual alerts on the dashboard and PW seems to still be on the same firmware from last year. Very weird. |
@matteoandreozzi - That makes sense. The cloud connection method was designed for solar-only install and has limited metrics (but also works fine with Powerwall systems as you know). Have you looked at using one of the local methods instead? Not required, just more curious as to why you chose cloud. In any case, the issue would not be any of the triggers you mention, but likely the way the external library handles connection to the Tesla cloud. I have used this for quite some time and haven't seen the issue you have so it is likely an outlier, but I'm still going to investigate to see if we can add some better error handling. @wiltocking It seems you are losing the route to the 192.168.91.1 endpoint from the host running the dashboard. Try to ping 192.168.91.1 directly from that host to see if it responds. |
I also ran into this issue randomly across two Powerwall 2 gateways in two sites (my home and my parents home). Based on my debugging, I noticed that from the Docker
However at the same time, I can successfully get a response from another device (my laptop) on the network so it's not like the gateway is actually unresponsive, but it seems to soft-block/rate limit requests from that IP. It takes maybe a minute of no requests for this block/limit to reset and then connections can be made again. I've had the TEDAPI method set up for months without issues so this seems like a new issue. Both Powerwall 2 gateways are running I've since just disabled the TEDAPI method by commenting out the P.S. The ony thing I've changed recently at both sites is upgrading my UniFi UDM OS but I don't expect that to have any overlap with over this issue. |
@longzheng if you lose the ability to ping the 192.168.91.1 from the host, that indeed seems like a network issue. Are you setting the route locally or are you using your network router to create the route? I have seen issues with hosts losing the ability to reach the endpoint but it is usually an arp issues (unable to get the right mac address for the LAN host so the route fails). As an alternative, I would try rebooting your system running the dashboard to see if it was in a bad state. For troubleshooting you can try |
It's set as a static route in my Unifi router.
I've ruled out the host since |
Understood. thanks. |
Still able to ping from the host and get a response directly, it can locate the GW but not connect to it. |
Small update but not sure if this is what resolved it... Noticed I had the Gateway set to a static IP in its internal configuration BUT also had my router allocating a static IP to the same MAC Address (no idea if this is a conflict or not). Set the static IP in the internal configuration to an IP address outside the router's DHCP table. Ran add_route.sh again with the new IP and Ran setup.sh again for Powerwall Dashboard. For now, Hybrid local data has been restored. |
Problem
No data is shown in Graphana. Pypowerwall reports a type error
To Reproduce
docker logs -f pypowerwall
Host System
Additional context
Issue started on Dec 9th, with no apparent cause (no OS upgrades on the NAS).
Exception occurred during processing of request from ('172.19.0.1', 56634)
Traceback (most recent call last):
File "/usr/local/lib/python3.10/socketserver.py", line 683, in process_request_thread
self.finish_request(request, client_address)
File "/usr/local/lib/python3.10/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/local/lib/python3.10/socketserver.py", line 747, in init
self.handle()
File "/usr/local/lib/python3.10/http/server.py", line 433, in handle
self.handle_one_request()
File "/usr/local/lib/python3.10/http/server.py", line 421, in handle_one_request
method()
File "/app/server.py", line 683, in do_GET
self.send_header("Set-Cookie", f"AuthCookie={pw.client.auth['AuthCookie']};{cookiesuffix}")
TypeError: 'NoneType' object is not subscriptable
The text was updated successfully, but these errors were encountered: