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

Changing Battery Configuration State Via GET #87

Closed
KevM opened this issue Apr 17, 2024 · 2 comments · Fixed by #86
Closed

Changing Battery Configuration State Via GET #87

KevM opened this issue Apr 17, 2024 · 2 comments · Fixed by #86

Comments

@KevM
Copy link

KevM commented Apr 17, 2024

I noticed that you added a control surface for the battery reserve. I am very excited about this for my needs. Thank you all for working on this. 💯

I was curious why you made the request a GET and not a POST? Maybe this has already been debated. My history with creating web APIs points to avoiding using GETs in front of anything that changes the state of the world.

Feel free to close this if I am being too pedantic.

Thanks again.

@jasonacox
Copy link
Owner

Excellent point, @KevM ! I'll add it to my TODO list to move to POST.

@jasonacox jasonacox mentioned this issue Apr 22, 2024
@jasonacox
Copy link
Owner

Staged update in #86 to add POST method. Available via beta proxy container:

jasonacox/pypowerwall:0.8.4t54-beta5
# Set Reserve to 20
curl -X POST -d "value=20&token=1234" http://localhost:8675/control/reserve

# Set Mode to self_consumption
curl -X POST -d "value=self_consumption&token=1234" http://localhost:8675/control/mode

# Read values by omitting value
curl -X POST -d "token=1234" http://localhost:8675/control/reserve
curl -X POST -d "token=1234" http://localhost:8675/control/mode

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 a pull request may close this issue.

2 participants