hultenvp / solis-sensor

HomeAssistant integration for the SolisCloud PV Monitoring portal via SolisCloud API
Apache License 2.0
208 stars 42 forks source link

Report SolisCloud connectivity issues here #232

Closed hultenvp closed 1 month ago

hultenvp commented 1 year ago

Describe the bug People report various issues with SolisCloud connectivity. Varying from not being able to configure the integration to connection errors with server.

A lot of fixes and hardening have already been introduced, but issues may remain.

Please add your issues in the comments of this issue. Before you do, make sure:

Note The "abnormal data bug" is not fixed, see #229

petegallagher commented 1 year ago

I have a new installation of this integration and only got API access today. However when trying to configure the integration in Home Assistant I was presented with the error Cannot login with provided url and credentials (similar to #183 and #197).

It appears that neither my SolisCloud username or email address were accepted values for Portal login. Instead I had to provide the User ID number from the url bar of the inverter detail page. After using this value I was able to setup the integration correctly and after a few minutes I started getting stats through.

For anyone experiencing a similar issue the User ID can be retrieved by logging into SolisCloud and clicking:

Overview > Device Overview > [Your Inverter SN]

This will launch a new window with a URL like https://www.soliscloud.com/#/station/inverter/inverterdetail?id=xxxx. Your User ID is the value of the id parameter.

iwearoddsockz commented 1 year ago

I have a new installation of this integration and only got API access today. However when trying to configure the integration in Home Assistant I was presented with the error Cannot login with provided url and credentials (similar to #183 and #197).

It appears that neither my SolisCloud username or email address were accepted values for Portal login. Instead I had to provide the User ID number from the url bar of the inverter detail page. After using this value I was able to setup the integration correctly and after a few minutes I started getting stats through.

For anyone experiencing a similar issue the User ID can be retrieved by logging into SolisCloud and clicking:

Overview > Device Overview > [Your Inverter SN]

This will launch a new window with a URL like https://www.soliscloud.com/#/station/inverter/inverterdetail?id=xxxx. Your User ID is the value of the id parameter.

Thank you!!! I couldn't log in and it was doing my head in, this worked for me!

fixl commented 1 year ago

I just started with HA and I also get Cannot login with provided URL and credentials, but I get INFO (MainThread) [custom_components.solis.soliscloud_api] Failed to acquire plant name, login failed regardless of whether I try to log in with @petegallagher 's solution or the email I registered with.

I've had a look at the response from Solis Cloud, and I couldn't find plantName in the response payload. I'm not sure if I'm looking at the right API Documentation (linked here), but plantName isn't mentioned as part of /v1/api/userStationList's response.

hultenvp commented 1 year ago

I have a new installation of this integration and only got API access today. However when trying to configure the integration in Home Assistant I was presented with the error Cannot login with provided url and credentials (similar to #183 and #197).

It appears that neither my SolisCloud username or email address were accepted values for Portal login. Instead I had to provide the User ID number from the url bar of the inverter detail page. After using this value I was able to setup the integration correctly and after a few minutes I started getting stats through.

For anyone experiencing a similar issue the User ID can be retrieved by logging into SolisCloud and clicking:

Overview > Device Overview > [Your Inverter SN]

This will launch a new window with a URL like https://www.soliscloud.com/#/station/inverter/inverterdetail?id=xxxx. Your User ID is the value of the id parameter.

I'm happy it works for you, but for SolisCloud username is actually not used in the configuration and login process. Only url, key, secret and plant/station ID are used. So not sure what's causing the issues you saw.

hultenvp commented 1 year ago

I just started with HA and I also get Cannot login with provided URL and credentials, but I get INFO (MainThread) [custom_components.solis.soliscloud_api] Failed to acquire plant name, login failed regardless of whether I try to log in with @petegallagher 's solution or the email I registered with.

I've had a look at the response from Solis Cloud, and I couldn't find plantName in the response payload. I'm not sure if I'm looking at the right API Documentation (linked here), but plantName isn't mentioned as part of /v1/api/userStationList's response.

Before the 2022 API shutdown (mentioning GDPR reasons) the API still supported stationName (Solis uses plant and station interchangeably). When back enabled they published v1.2 and plantName was dropped. I now return the field sno from userStationList as plantName. I need a plantName(substitute) to for identification of the inverter in HA's settings.

If you are experiencing this issue then please enable debug and post your log here. Looks like your userStationList call is giving the wrong response.

DebugDevil1 commented 1 year ago

this is the response i got from Solis" Kindly confirm first which app they are using to integrate the API? If they are using the Home assistant App then tell them to use POSTMAN App

hultenvp commented 1 year ago

this is the response i got from Solis" Kindly confirm first which app they are using to integrate the API? If they are using the Home assistant App then tell them to use POSTMAN App

@DebugDevil1: I'm not sure what issue above you are referring to. I do see why they want you to show the issue on POSTMAN; they want to be able to reproduce themselves.

matthewbyrne commented 1 year ago

I just updated to the latest HA version, and the Solis integration isn't loading. Same error as reported back in December here https://github.com/hultenvp/solis-sensor/issues/230

Any thoughts on a fix?

Blokkert commented 1 year ago

Having troubles to use soliscloud acces, using version 3.3.2.

I have API acces and all the required settings, but it wil not work. Or wrong credentials or no inverter(s) found. Cannot get it fixed, any ideas? tried different options noted here by others.

"Cannot login with provided URL and credentials".

Another instance running ginlong (stil) works..

dfr commented 1 year ago

I'm also stuck on this with a new soliscloud installation and API key. How can I enable debug logging for the integration? Also, where can I find the test script mentioned in this thread?

dfr commented 1 year ago

Figured out how to run the test script - I get errors like this:

station_detail(station_id= <redacted> ): Failed with: API returned an error: 0, message='Attempt to decode JSON with unexpected mimetype: text/html', url=URL('https://www.soliscloud.com:13333/v1/api/userStationList'), error code: None, response None

seems likely to be a server side issue:

'<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body bgcolor="white">\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n'
hultenvp commented 1 year ago

@dfr : Did you run the script described here: https://github.com/hultenvp/solis-sensor/wiki/Soliscloud-issues#testing-issues

dfr commented 1 year ago

@dfr : Did you run the script described here: https://github.com/hultenvp/solis-sensor/wiki/Soliscloud-issues#testing-issues

Yes - looking at the wiki page you linked, I think I fell into the rate limiting 502 error. I'm not sure what to try here - perhaps wait for a day and see if the test works after a break to let it 'cool down'.

dfr commented 1 year ago

@dfr : Did you run the script described here: https://github.com/hultenvp/solis-sensor/wiki/Soliscloud-issues#testing-issues

Yes - looking at the wiki page you linked, I think I fell into the rate limiting 502 error. I'm not sure what to try here - perhaps wait for a day and see if the test works after a break to let it 'cool down'.

I just tried running apitest_async.py again and it seems to be working, with believable results from the API calls.

I'm still not able to configure the integration with the same API key and plant ID though. I would like to try to debug it locally but I'm not seeing how to enable debug logging. The instructions at https://www.home-assistant.io/docs/configuration/troubleshooting/ seem to require that the integration is already listed on the integrations page and I can't get to that stage without completing the config dialog successfully.

snigehere commented 1 year ago

I just wanted to add my experience having just migrated from "https://m.ginlong.com/" to "https://www.soliscloud.com/"

I obtained my API approval but getting to my key was not at all intuitive .. After messing about a while clicking and waiting for emails I found the guidance in this doc https://github.com/hultenvp/solis-sensor and got it done.

I could not see a way to "re-configure" the integration so deleted the existing one and re-installed.... First pass through went well and after a few minutes I saw data showing up in HA .... However I had given the integration the wrong name so my existing automations would need sorting out. To make it easier I started again by deleting the integration, restarted HA and then tried again .. every attempt resulted in "Cannot login with provided URL and credentials" ... after googling for a while found a comment that said they had to disable and re-enable the API in solis cloud .. I did this and immediately was able to create the integration so a step forward however I started to get "[custom_components.solis.soliscloud_api] No inverters found" so although all the entities were created they all showed unavailable.

More googling I found a suggestion that this could be an issue with solis cloud synchronisation between instances .... and as I had disabled and re-enabled the api this sounded plausible. As I needed to go out I decided to wait until later before deleting and trying again....

When I returned some 2 hours later I found it had started working after about 1h30m after I left....

Lesson for learning ... stop poking about and leave it be ...

I noticed I have lost the entity "My Solis Inverter Timestamp Inverter Online" and "My Solis Inverter Energy Last Month" .. If needed I can derive these from other entities so that's ok.

ncot-tech commented 1 year ago

Is the Soliscloud API having issues at the moment? I'm trying to set the HA integration up and getting the "cannot log in..." error. I tried the soliscloud_test Python program and it worked once, but now I just get "502 Server Error: Bad Gateway for url: https://www.soliscloud.com:13333/v1/api/inveterDetail". I also get a 502 error when visiting the URL with my browser.

Oh, I modified the soliscloud_test.py with a bit of error checking

try:
    x = requests.post(req, data=Body, headers=header)
    x.raise_for_status()
except requests.exceptions.HTTPError as err:
    raise SystemExit(err)
viking2010 commented 1 year ago

It would seem that way. Since late yesterday evening (UK time) it seems to have been playing up. I'm wondering if they're applying a rate limit, as every so often I am able to get a connection. I also wonder if the work to migrate user accounts from the old portal to the new is having a hit on their systems, and subsequently those that use the api.

ncot-tech commented 1 year ago

It feels like some kind of "all the servers are on fire" problem rather than anything specific to our own API access being rate limited. I tried using incognito mode and then my mobile phone on data not wifi and got the same results. Slightly amusing I see an NGINX bad gateway error... they're running their services behind a reverse proxy.

Their Android app works perfectly fine, and the web version is also unaffected though. You'd think they were all the same.

cryogenfx commented 1 year ago

Just to further this case, I switched to Solis Cloud a good while back, some time last year, but only yesterday tried to switch in HA, and received the same "cannot login" message as described further up. Then I read the comment about not using the email address, but the inverter ID. At first i read wrong, and tried the SN of the inverter, but when I tried the actual Id from url, suddenly it kinda worked, I am now logged in, and the integration shows up as expected in the list. However, it does not currently show any devices or entities, but I'm hopeful that maybe they will appear later, so I will give it some time and see what happens.

Update: as expected (or, rather hoped), after a while, the device and all of its entities are now present, in all their glory. So, hopefully others with the same issue can try using the inverter ID instead of email of you are experiencing the same issues.

derekjtroy commented 1 year ago

Hi Folks,

So setting this up today and I'm getting the same errors as everyone above.

HA version 2023.4.6 Supervisor 2023.4.1 OS 10.0 Frontend 20230411.1 Integration Ver 3.3.2

From the log file all I can see if the following error

2023-04-26 15:59:04.564 WARNING (MainThread) [custom_components.solis.soliscloud_api] No inverters found 2023-04-26 15:59:36.201 WARNING (MainThread) [custom_components.solis.soliscloud_api] No inverters found 2023-04-26 16:03:42.827 WARNING (MainThread) [custom_components.solis.soliscloud_api] No inverters found

I've tried login using Id Parameter, username and email address.

Any thoughts ?

snigehere commented 1 year ago

I would recommend opening a ticket with solis to fix their systems - the issue we are all seeing is some sort of load reduction controls applied to limit load on the solis servers so many api calls are failing.

ncot-tech commented 1 year ago

I've opened a support ticket with Solis and linked them to this github issue. I will await their reply!

derekjtroy commented 1 year ago

Tried again there this morning and it connected fine !

snigehere commented 1 year ago

looks like the high failure rate stopped at 05:38 GMT today ... in the 6 hours since then I have only seen 4 errors .. this is typical of the 4 I have seen:

2023-04-27 08:37:07.082 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Error from URI (/v1/api/userStationList) : ContentTypeError(RequestInfo(url=URL('https://www.soliscloud.com:13333/v1/api/userStationList'), method='POST', headers=<CIMultiDictProxy('Host': 'www.soliscloud.com:13333', 'User-Agent': 'HomeAssistant/2023.4.6 aiohttp/3.8.4 Python/3.10', 'Content-MD5': 'xxxxxxx', 'Content-Type': 'application/json', 'Date': 'Thu, 27 Apr 2023 07:37:07 GMT', 'Authorization': 'API xxxxxxxxxx:xxxxxxxxxx+xxxxxxxxxx=', 'Accept': '/', 'Accept-Encoding': 'gzip, deflate', 'Content-Length': '2')>, real_url=URL('https://www.soliscloud.com:13333/v1/api/userStationList')), (), message='Attempt to decode JSON with unexpected mimetype: text/html', headers=<CIMultiDictProxy('Date': 'Thu, 27 Apr 2023 07:37:07 GMT', 'Content-Type': 'text/html', 'Content-Length': '206', 'Connection': 'keep-alive', 'Via': 'HTTP/1.1 SLB.9')>) 2023-04-27 08:37:07.084 INFO (MainThread) [custom_components.solis.soliscloud_api] Unable to fetch details for Station with ID: xxxxxxxxxxxxx 2023-04-27 08:37:07.084 DEBUG (MainThread) [custom_components.solis.soliscloud_api] Using inverterDetail for energy_today 2023-04-27 08:37:07.085 DEBUG (MainThread) [custom_components.solis.service] Scheduling next update in 0:05:00, at 2023-04-27 07:42:07.085305+00:00

I can live with that as a failure rate .. its way better than before.

viking2010 commented 1 year ago

That's good to hear it's working now. Solis still haven't updated my ticket on the issue yet, but I have reported back to them that it's now working again. Thanks for the update!

derekjtroy commented 1 year ago

Now, has anyone any good tutorials on Dashboards or Grafana ? :)

DebugDevil1 commented 1 year ago

Dear all, i was having issues loggin in. i recently needed to add another installation to my account and i noticed that this plant got an 6 charakter ID behind the name of the plant. when is was looking ad my first installation i noticed the ID was ------- so i changed the name of the installtion and a ID was assinged. when trying to loggin again 1 day later the intergration started working again.

no sure if it is related but it fixed my connection issues :-)

HamsenBender commented 1 year ago

@DebugDevil1 it was definitely the missing ID, had the same issue. @hultenvp maybe this should be added in the instructions? Check if the plant has an ID, if not, change the name of the plant so that one is generated. Maybe the ID is missing of you migrate the plant from the old platform

davyvr commented 1 year ago

I've tried to set this up, asked for API access yesterday, enabled it about half an hour ago, but I can't manage to log in. So, to be sure:

I always get the result "Cannot login with the provided URL and credentials". Since I've found no working solution in the posts above, any idea how to get this solved?

Kind regards, Davy

Moondevil-ha commented 1 year ago

@davyvr Have you tried removing the trailing slash from the URL? https://www.soliscloud.com:13333

davyvr commented 1 year ago

@Moondevil-ha The devil is in the details! Thanks a lot, I'm connected :)

hultenvp commented 1 year ago

Trailing slash is now fixed in v3.3.3

Klaxxon198 commented 1 year ago

I'm trying on and off for a month now... I get the "Cannot login with the provided URL and credentials" error. I dont understand, i'm doing the same thing as @davyvr. with the trailing slash removed or not.

Is there another way to check my API credentials are working?

swests commented 1 year ago

I'm trying on and off for a month now... I get the "Cannot login with the provided URL and credentials" error. I dont understand, i'm doing the same thing as @davyvr. with the trailing slash removed or not.

Is there another way to check my API credentials are working?

Have you tried the test python scripts?

snigehere commented 1 year ago

@Klaxxon198 I did post this a way up the chat .. did you try this:

snip ..... every attempt resulted in "Cannot login with provided URL and credentials" ... after googling for a while found a comment that said they had to disable and re-enable the API in solis cloud .. I did this and immediately was able to create the integration so a step forward however I started to get "[custom_components.solis.soliscloud_api] No inverters found" so although all the entities were created they all showed unavailable.

When I returned some 2 hours later I found it had started working after about 1h30m after I left....

Lesson for learning ... stop poking about and leave it be ... /snip

Klaxxon198 commented 1 year ago

I'm trying on and off for a month now... I get the "Cannot login with the provided URL and credentials" error. I dont understand, i'm doing the same thing as @davyvr. with the trailing slash removed or not. Is there another way to check my API credentials are working?

Have you tried the test python scripts?

I tried the python test script (apitest_async.py) and it says a lot lines that ends with [OK] and "Exceptions: [None]" just like in the screenshot under https://github.com/hultenvp/solis-sensor/wiki/Soliscloud-issues#testing-issues

I tried the soliscloud_test.py (there are typo's in it, the letter r is missing) i uncomment the 2 lines with "/v1/api/inverterList" filled in the stationId, then i get all the data. SOC and so on.

So i tried again in HA, i get the "Cannot login with the provided URL and credentials" In the logbook i see this: image

fyi: the inverter is not for solar, but for battery storage only: RAI-3K-48ES-5G

HamsenBender commented 1 year ago

When you get the error "no inverter found" Did you also check in SolisCloud that your plant has an ID? If not, modifiy name of your plant, and an ID will be generated. That was the issue on my end

Klaxxon198 commented 1 year ago

Yes, i do have an ID for my plant.

If i use the 'soliscloud_test.py' under the testing, uncomment it and fill in my station ID in these lines:

CanonicalizedResource = "/v1/api/inverterList" Body = '{"stationId":"1298491919448705454"}' # id = id number from the url bar of your station overview then i see all the information about my inverter, SOC and so on.

hultenvp commented 1 year ago

If the test app does give you data but the integration cannot connect then I'm really interested in your debug log. Can you run a try with debug-on on the integration? Look in the wiki how to do that if you are unfamiliar with the process.

Klaxxon198 commented 1 year ago

hmm, i was still on v3.3.2.. so i updated, and now on v3.3.3. and guess what, it works now without any problem.. no idea what bug caused this in 3.3.2 i'm glad it works now

FGOD1983 commented 1 year ago

When you get the error "no inverter found" Did you also check in SolisCloud that your plant has an ID? If not, modifiy name of your plant, and an ID will be generated. That was the issue on my end

Thank you! This solved the issue for me. It seems that after the move to the new portal, the ID is not created, so after the rename indeed the ID is created then I was able to login!

seban5991 commented 6 months ago

Hi, For the past two weeks, I've been trying to access the Solis API, but I keep getting the message "Cannot login with provided URL and credentials." I've tried several troubleshooting steps, including:

Disabling and enabling the API multiple times. Changing the plant name. Logging in with and without a trailing slash in the URL (https://www.soliscloud.com:13333/). Despite these efforts, I'm still unable to login. When testing the API in Python, all responses are successful except for inverter_detail, which returns the following error: Failed with: API returned an error: The inverter No operation permission or no longer exists, error code: None, response None

Do you have any suggestions on what else I can try?

snigehere commented 6 months ago

I would recommend disabling and re-enabling the API using the solis web site to see if that solves it - I had issues some time ago and that sorted it for me. If that does not solve it then open a ticket on the solis support site https://solis-service.solisinverters.com/ they respond quite quickly to issues

seban5991 commented 6 months ago

I have already reset the API on the Solis website several times, unfortunately without success. Up to now, I had no access to the API, but I created a ticket at https://solis-service.solisinverters.com/ and they enabled it for me immediately. When I had problems logging in through the HA integration, I reported it to them and received the API documentation in response with the information that they recommend using POSTMAN API.