Comments (14)
Found the issue. The code was preventing anything <5 and the exception was being raised instead of handled. I updated to log the error for any value outside range of 0-100.
Give this container a try and let me know if it addresses this issue:
jasonacox/pypowerwall:0.8.4t54-beta
from pypowerwall.
Good question. I'll have to take a look.
from pypowerwall.
It now accepts values <5, however the API response and queried reserve after it's set still says it's set to 5.
{"set_backup_reserve_percent": {"backup_reserve_percent": 5.0, "din": "1099752-01-B--T17K0001234", "result": "Updated"}, "set_operation": {"real_mode": "self_consumption", "din": "1099752-01-B--T17K0001234", "result": "Updated"}}
from pypowerwall.
Update: Setting to 1 works, just not 0. If you set 0, it doesn't change anything and just reports back the current setting.
I'm content with 1. I suspect it's the Tesla API not allowing 0?
from pypowerwall.
I don't know why I didn't notice that. You are right. I figured it out. It will take 1 but for 0, it needs to be set to False
, evidently indicating that you want to disable reserve. I updated the code to handle this condition if you want to test:
jasonacox/pypowerwall:0.8.4t54-beta2
Interesting note: The Tesla App will let you set it to 0, but above zero, it goes directly to 5. However, our API seems to let me set it to 1, 2, 3 and 4 as well.
from pypowerwall.
Done some more testing. Setting value=1 sets the value to 1 as expected, but setting 0 sets the value to 1.0 ?
{"set_backup_reserve_percent": {"backup_reserve_percent": 1, "din"
{"set_backup_reserve_percent": {"backup_reserve_percent": 1.0, "din"
I'm not really fussed about setting value to 0 as 1 is close enough, but the behaviour doesn't seem to match your expectation.
Not sure what the CANCEL lines are about either in the logs?
04/19/2024 03:00:08 AM [proxy] [INFO] Control Commands Activating - WARNING: Use with caution!
04/19/2024 03:00:09 AM [proxy] [INFO] Control Mode Enabled: Cloud Mode Connected
04/19/2024 04:34:01 AM [proxy] [INFO] Control Command: Set Reserve to 55
04/19/2024 06:33:55 AM [proxy] [INFO] Control Command: Set Reserve to 30
04/19/2024 07:00:06 AM [proxy] [INFO] Control Command: Set Reserve to 1
CANCEL
CANCEL
from pypowerwall.
Thanks @spoonwzd - Yes, my code should be setting it to "False" instead of "0". Just to confirm, you are using the latest container? jasonacox/pypowerwall:0.8.4t54-beta2
from pypowerwall.
Double-checked. Defo using jasonacox/pypowerwall:0.8.4t54-beta2
The console logs show me setting it to 0, but the API response is saying 1.0
from pypowerwall.
Ok, I wasn't able to reproduce but perhaps there is an edge case I'm missing.
from pypowerwall.
Let me know if you need anything further to assist with troubleshooting
from pypowerwall.
04/19/2024 07:00:06 AM [proxy] [INFO] Control Command: Set Reserve to 1
CANCEL
ah... The cancel means it is crashing. Can you turn on debug mode to see if we can figure out why? Edit pypowerwall.env
:
PW_DEBUG=yes
from pypowerwall.
I find the issue @spoonwzd ! If you are willing, please try this one:
jasonacox/pypowerwall:0.8.4t54-beta5
Also, now supports POST:
curl -X POST -d "value=20&token=1234" http://localhost:8675/control/reserve
curl -X POST -d "value=backup&token=1234" http://localhost:8675/control/mode
from pypowerwall.
Sorry for the delay. I did enable debug but the logs were being spammed by my repeating polling and I never go around to stopping them :/
Not sure if it's working or not until battery levels drop, but at least the response is different now when setting 0!
{"set_backup_reserve_percent": {"backup_reserve_percent": false, "din": "1099752-01-B--T17K0001234", "result": "Updated"}, "set_operation": {"real_mode": "self_consumption", "din": "1099752-01-B--T17K0001234", "result": "Updated"}}
Additionally I tried using POST as the method, but it doesn't seem to work. I get the output:
"{"unauthorized": "Control Command Token Invalid"}"
Setting the method back to GET makes it behave again.
from pypowerwall.
Thanks @spoonwzd !
You can get the current setting by using the API call but omitting the value
data.
curl -X POST -d 'token=1234' http://localhost:8675/control/reserve
Also, for the POST test, I suspect you have special characters in your token. I realized that I use double-quotes instead of single quotes in my examples so bash will translate any special characters like $
. Can you try this:
curl -X POST -d 'value=20&token=1234' http://localhost:8675/control/reserve
from pypowerwall.
Related Issues (20)
- set-reserve ERROR gives Missing access token parameter. Auth token expired? HOT 3
- Ran upgrade.sh but it does not pull all new files HOT 2
- New PW firmware seems to break vitals - 23.44.0 HOT 17
- INFO: Alerts displayed when one Powerwall is defective HOT 1
- Critical Bug - 404 HTTP Status Code Handling
- python3 set-reserve.py --read error HOT 15
- Missing ? energy_sites/grid_import_export HOT 3
- Powerwall not reachable ever since January 26th HOT 1
- Set Reserve via Proxy API HOT 8
- pyPowerwall [0.8.3] Proxy Server [t53] testing HOT 28
- Change the path .auth & .site files are saved to HOT 2
- Slow charge speed from grid? HOT 2
- Changing Battery Configuration State Via GET HOT 2
- PyPowerwall stopped connecting HOT 9
- Extra connection created? HOT 4
- Issues with POST HOT 3
- Possible FleetAPI bug in __main__.py HOT 1
- Powerwall 3 Local Access via TEDAPI HOT 32
- FleetAPI Setup Bug
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pypowerwall.