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

Feature: Set operation mode and Backup percentage #46

Conversation

daniel-simpson
Copy link
Contributor

Was hoping to be able to set my powerwall's Operation Mode and Backup Reserve Percentage programmatically, in order to take advantage of times when power is cheap (by bumping up the backup reserve percent to pull in cheap power).

Pretty much implemented before I hit a roadblock while running integration tests though:

tesla_powerwall.error.AccessDeniedError: Access denied for resource /api/operation: Unable to POST to resource: User does not have adequate access rights

Seems that a regular user credential doesn't have access to POST to this endpoint. Have you seen this before / any way to access this endpoint? 🙏

@daniel-simpson daniel-simpson marked this pull request as ready for review March 21, 2023 05:24
@daniel-simpson
Copy link
Contributor Author

Note: I've marked this as ready for review, but until the unauthorized issue is sorted this PR should be merged

@jrester
Copy link
Owner

jrester commented Mar 21, 2023

Hey @daniel-simpson, thanks for your effort, but from my current understanding this is a wontfix. AFIK it is required to toggle some physical switch on the powerwall to enter installer mode so that one can access the operations API. You can read more about that topic here.
You could maybe try to login using powerwall.login_as(User.INSTALLER, "<password>", "<email>") and see if it works this way.

@daniel-simpson
Copy link
Contributor Author

Noted. I'll have a crack at logging in as an installer tomorrow, and if it doesn't look like it's going anywhere I'll close this PR myself (unless you want the reference code around?).

Thanks for the speedy response!

@daniel-simpson
Copy link
Contributor Author

Closing. Definitely frustrating but it doesn't look like this will be available without a change on Tesla's side to the local API (or user permissions, at least) 😢

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.

2 participants