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

Allow setting max current #10

Open
mbbush opened this issue Apr 4, 2021 · 1 comment · May be fixed by #11
Open

Allow setting max current #10

mbbush opened this issue Apr 4, 2021 · 1 comment · May be fixed by #11

Comments

@mbbush
Copy link

mbbush commented Apr 4, 2021

The api supports a command to set the maximum charging current.

At the moment, I manually adjust the max current using the juicebox app, based on data from my home power meter, to allow the car to use as much excess solar power as I would otherwise be feeding back into the grid. I'd like to automate that.

I can take a stab at implementing this myself (and then subsequently getting the functionality into homeassistant), if you'd be willing to accept the PR.

@mbbush
Copy link
Author

mbbush commented Apr 4, 2021

At least in my experimentation with the api, when I issue the "set_limit" command with an "amperage" parameter, and then poll the "get_state" command to see the result, it updates the "charging.amps_limit" as I would expect, but then a few seconds later reverts to what it was before, without ever affecting the rate of charge.

What did work, though, was sending a "set_info" command, with a "amps_wire_rating" of the value I want. This also included "timeZoneId" as a required parameter (yes, with a different casing convention), so I just re-POSTed the value I got from a "get_info" command.

So I think the way I'll implement this (unless someone advises otherwise), is to add two more api endpoints, "get_info" and "set_info". I'll call "get_info" when initializing the Charger, and store the result on the Charger object, so that I can pass the same timeZoneId in when setting the max current. Then I'll add a public method for setting the max current that accepts an integer amperage, and issues the "set_info" call using that value.

@mbbush mbbush linked a pull request Apr 6, 2021 that will close this issue
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.

1 participant