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

Support Shared Accounts #9

Merged
merged 2 commits into from
Apr 23, 2024

Conversation

oemich
Copy link
Contributor

@oemich oemich commented Apr 19, 2024

The change allows to retrieve data with the rights of an shared account. Due to this the main account can be still used in the app where the shared account is used to the API access.

As shared accounts have no access to the "Homepage" the topic "site_homepage" does not contain any data. But the topic "site/${site.site_name}/scenInfo" reports the same data as if it would have been used with the main account.

Data changes are not possible with a shared account.

Fixes #8

@oemich
Copy link
Contributor Author

oemich commented Apr 23, 2024

@tomquist could you please review and merge this PR?

Copy link
Owner

@tomquist tomquist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! LGTM

@tomquist tomquist merged commit 5a02419 into tomquist:main Apr 23, 2024
@SvG-sys
Copy link

SvG-sys commented Jun 26, 2024

Hi,

I recently installed the new SOLIX Solarbank 2 E1600 Pro, and it seems that data requests can only be made every 5 minutes. Otherwise, all values are "0". Only when the Anker app is kept open do all values come in as usual, but this is not a viable solution. Is there a solution for this?

Thank you
Sven

@oemich
Copy link
Contributor Author

oemich commented Jun 29, 2024

@SvG-sys not sure what the issue could be. I have the first E1600 and cannot reproduce the issue you mention (I get the values constantly every 60 secs as configured in the S2M_POLL_INTERVAL parameter). Also I'm not sure why the opened app has an influence on the data which is retrieved from the website. Can you maybe test with verbose mode (S2M_VERBOSE=true) and check if you see something in the logs. If you have some findings it would be best filling this in an issue instead of the PR.

@SvG-sys
Copy link

SvG-sys commented Jul 1, 2024

@oemich Thank you for looking into this matter. Yes, that's correct – everything works perfectly with the E1600 system. The values are reliably transmitted after 60 or even after 10 seconds.

Recently, I started using the newest model, Solix E1600 Plus with an integrated inverter. Here too, the values can be queried via MQTT, but only if the Anker iPhone app is open or kept open. If you close the app, after about 3-4 minutes, only values of "0" are transmitted. Once you open the Anker app again, the transmission runs smoothly.

log file looks normal:
[2024-07-01T22:24:45.946Z] {"site_id":"xxxxx"} [2024-07-01T22:24:46.058Z] Published. [2024-07-01T22:24:46.059Z] Sleeping for 9740ms... [2024-07-01T22:24:55.801Z] Fetching data [2024-07-01T22:24:55.802Z] Using cached auth data [2024-07-01T22:24:55.802Z] 0fedbd64e48d9fdeb4029a054358d74487efc932 [2024-07-01T22:24:55.802Z] {} [2024-07-01T22:24:55.854Z] {} [2024-07-01T22:24:55.892Z] {"site_id":"xxxxx"} [2024-07-01T22:24:55.965Z] Published. [2024-07-01T22:24:55.965Z] Sleeping for 9836ms... [2024-07-01T22:25:05.803Z] Fetching data [2024-07-01T22:25:05.804Z] Using cached auth data [2024-07-01T22:25:05.804Z] 0fedbd64e48d9fdeb4029a054358d74487efc932 [2024-07-01T22:25:05.805Z] {} [2024-07-01T22:25:05.876Z] {} [2024-07-01T22:25:05.937Z] {"site_id":"xxxxx"} [2024-07-01T22:25:06.031Z] Published. [2024-07-01T22:25:06.031Z] Sleeping for 9772ms... [2024-07-01T22:25:15.809Z] Fetching data [2024-07-01T22:25:15.809Z] Using cached auth data [2024-07-01T22:25:15.810Z] 0fedbd64e48d9fdeb4029a054358d74487efc932 [2024-07-01T22:25:15.810Z] {} [2024-07-01T22:25:15.873Z] {} [2024-07-01T22:25:15.937Z] {"site_id":"xxxxx"} [2024-07-01T22:25:16.021Z] Published. [2024-07-01T22:25:16.021Z] Sleeping for 9788ms...

However, I don't want to keep the Anker iPhone app open all the time to be able to read the values every minute. Is there another solution for this – or perhaps this behavior is intentional by Anker?

If you would like, I can give you access to the new system through a specially created read-only account.
SvG

@oemich
Copy link
Contributor Author

oemich commented Jul 2, 2024

@SvG-sys I opened the issue #12 for your issue. Let's continue there ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Only empty data
3 participants