Skip to content
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

[SolarEdge] Private API not working #15867

Open
m0qui opened this issue Nov 8, 2023 · 7 comments
Open

[SolarEdge] Private API not working #15867

m0qui opened this issue Nov 8, 2023 · 7 comments
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@m0qui
Copy link

m0qui commented Nov 8, 2023

Regarding org.openhab.binding.solaredge: Public API works as expected using the API key. Configuring the private API results in a CONFIGURATION_ERROR stating You will have to use a token and not an api key when using private API., even thou I used a fresh token grabbed via Firefox storage inspector, not an API key.

SolarEdge_2023-11-08_17-31-50

solaredge:generic:test1 [ tokenOrApiKey="L***S", solarId="3***1", meterInstalled=true, usePrivateApi=false ] // working

solaredge:generic:test2 [ tokenOrApiKey="d***M", solarId="3***1", meterInstalled=true, usePrivateApi=true ] // not working

cc: @alexf2015

currently on Ubuntu 22.04 with openHAB 4.0.3, thou there haven't been any code changes since then to this binding.

@m0qui m0qui added the bug An unexpected problem or unintended behavior of an add-on label Nov 8, 2023
@riegelbrau
Copy link

riegelbrau commented Nov 12, 2023

Same here for the private API with OH 4.0.3 on openhabian 6.1.21-v8+.
But for now the public API does not work either.

@lsiepel
Copy link
Contributor

lsiepel commented Sep 15, 2024

@m0qui When the token is set, it is tested to have < 80 characters. If this test fails you get the error you mentioned. So can you double check the token length and or if it is no mistake?

@riegelbrau You seem to have a different issue. Could you 1. also check the token length? and 2. elaborate on the issue you have with the cloud, preferrable in a seperate issue?

@m0qui
Copy link
Author

m0qui commented Sep 16, 2024

@lsiepel Thank you for looking into this. My token is exactly 79 characters in length.

@riegelbrau Public API working fine for me for month.

@lsiepel
Copy link
Contributor

lsiepel commented Sep 16, 2024

@lsiepel Thank you for looking into this. My token is exactly 79 characters in length.

@riegelbrau Public API working fine for me for month.

Hmm sure you did not accidentally add whitespaces. I could add a trim to prevent that. But first need to make sure why you get this error as with a 79 char token this is unexpected

@m0qui
Copy link
Author

m0qui commented Sep 17, 2024

@lsiepel yes, I just reconfigured again from scratch using a .things file and via the web ui. No addition white spaces.

solaredge:generic:wrt [ tokenOrApiKey="d*****************************************************************************A", solarId="3*****1", meterInstalled=true, usePrivateApi=true ]

(Used Ins to override my data, string is same length as in my actual .things file)

@lsiepel
Copy link
Contributor

lsiepel commented Sep 17, 2024

I copied your configuration and the Thing goes to Unknown => waiting for api to login as expected.
When i add 1 character to the apikey, i get the same warning as you mention.

Also when looking at the code i can see a very straight forward check that leads to this error message.

So the question is why you get this and i'm not able to reproduce. Just to be sure, are you experiencing this issue on openHAB 4.2.1 + ?

@m0qui
Copy link
Author

m0qui commented Sep 17, 2024

Yes, I'm on 4.2.1. I also tried adding and removing a single char, to check if I can trigger a different error.
With the SPRING_SECURITY_REMEMBER_ME_COOKIE token I also get Unknown => Waiting for web api login at first, but after about 10 to 15 seconds it changes to OFFLINE=>CONFIGURATION_ERROR=>You will have to use a token and not an api key when using private API.

Happy to provide more logs, just tell me what you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

No branches or pull requests

3 participants