jeffkowalski / sunpower

Unofficial tests of apparent Sunpower API
41 stars 9 forks source link

SunPower is retiring this API! #5

Open bradpirtle opened 2 years ago

bradpirtle commented 2 years ago

From the portal it seems this SunPower API is getting retired: "The existing SunPower customer portal will be retired at the end of 2021" This is from: https://monitor.us.sunpower.com/

It seems they have built a new App/API from here: http://login.mysunpower.com/ and are migrating users to the new API.

This seems a breaking API change. From what I can tell, they have "privatized" the API (using oAuth and app tokens/hard coded redirects) so that the general public cannot use it anymore (like we could using this older API).

Has anyone done any research on this new API and see if there is a way to use it (like this project uses the old API)? Have we been completely blocked getting SunPower data?? Any thoughts, ideas, or solutions would be excellent. HELP!

alexandreshah commented 12 months ago

@bradpirtle Did you discover and solution? I'm having the same issue. I got as far as logging in with the new endpoint: https://login.mysunpower.com/api/v1/, which returns a token, but I don't know how to get meter data using that token.

bradpirtle commented 11 months ago

I did not, unfortunately. I do still have a big need to get this working again. Would you be willing to share your code to get the token? I would be happy to see if I can figure anything out for data from there. Let me know, and thanks for replying to this post. Brad

n2ygk commented 11 months ago

@alexandreshah if the token is an OAuth Bearer token (likely) then add this header to your requests and it may work:

Authorization: Bearer <token>

My system installation starts tomorrow so I'm eager to see if this works!

bradpirtle commented 5 months ago

@alexandreshah (or anyone) - were you ever able to get the "new" api working (get a token then get production data)? If can you post some code?

TheGoblinPopper commented 1 month ago

I recommend people keep submitting requests for the API to be exposed or the community look into screen scrapping at this point.

Not sure if the API change impacted some older implementations, but I have seen people implement an API by plugging in a raspberry pi into the box in their house and read the information it broadcasts. It is used to help integrate it into HomeAssistant but it should be flexible.

n2ygk commented 1 month ago

Not sure if the API change impacted some older implementations, but I have seen people implement an API by plugging in a raspberry pi into the box in their house and read the information it broadcasts. It is used to help integrate it into HomeAssistant but it should be flexible.

@TheGoblinPopper Do you have a reference to technical docs on how this was accomplished? I would love to locally monitor my system rather than relying on their hosted service which breaks down from time to time.

TheGoblinPopper commented 1 month ago

@TheGoblinPopper Do you have a reference to technical docs on how this was accomplished? I would love to locally monitor my system rather than relying on their hosted service which breaks down from time to time.

It would make sense to include that, huh... Sorry about that.

https://github.com/krbaker/hass-sunpower

Good news is it was updated within the last 2 days, so it is active. Scroll down a bit to see the raspberry pi config section. It is a pretty detailed PDF with pictures on how to get it working.