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

Powerboost configuration #35

Merged
merged 4 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,6 @@ dmypy.json
test_liviu.py
APIDEBUG.md
.DS_Store

# PyCharm
.idea/
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ pip install wallbox
- a full charger reboot can take a few minutes. Charger status will be slow to update (ie: READY (10s) -> DISCONNECTED (90s) -> READY)
CAUTION: use this method with care!! Check if the charger is not in the middle of a firmware upgrade as this can brick your charger.


### setIcpMaxCurrent(chargerId, newIcpMaxCurrentValue)

- sets charger Maximum ICP Current available (Amps).

Please note that the wallbox may refuse this action if not setup properly of if not supported by your model


### getChargerSchedules(chargerId)

- gets the currently configured schedules for that charger.
Expand Down
27 changes: 8 additions & 19 deletions wallbox/wallbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,14 @@ def setEnergyCost(self, chargerId, energyCost):
raise (err)
return json.loads(response.text)


def setIcpMaxCurrent(self, chargerId, newIcpMaxCurrentValue):
try:
response = requests.post(
f"{self.baseUrl}chargers/config/{chargerId}",
headers=self.headers,
json={'icp_max_current': newIcpMaxCurrentValue},

def getChargerSchedules(self, chargerId):
try:
response = requests.get(
Expand All @@ -213,25 +221,6 @@ def getChargerSchedules(self, chargerId):
raise (err)
return json.loads(response.text)

"""
Example request:
{
'schedules': [{
'id': 0,
'chargerId': 42,
'enable': 1,
'max_current': 1,
'max_energy': 0,
'days': {'friday': True, 'monday': True, 'saturday': True, 'sunday': True, 'thursday': True,
'tuesday': True, 'wednesday': True},
'start': '2100',
'stop': '0500'
}]
}

Where id is the position to add/replace
"""

def setChargerSchedules(self, chargerId, newSchedules):
try:
# Enforce chargerId
Expand Down