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

Conditional modes #14

Open
MikeBishop opened this issue Oct 18, 2019 · 3 comments
Open

Conditional modes #14

MikeBishop opened this issue Oct 18, 2019 · 3 comments

Comments

@MikeBishop
Copy link

MikeBishop commented Oct 18, 2019

I'm interested in using this project for a slightly different purpose. I'm okay if the car charges off the grid, so long as there is grid power -- the joy of net metering. What I want is for the limitation to kick in when the power is off, to ensure that the car is never siphoning from the Powerwall. So:

  • If grid is up, full power is permitted.
  • If grid is down:
    • Do not charge / provide minimum allow current until Powerwall recharges to X%
    • Track green energy until power is restored

Both of these policies seem to be possible in the current setup, but there's no grid-up/grid-down discrimination. Is there interest in adding different policies for grid states?

@laur3ns
Copy link

laur3ns commented Oct 18, 2019

Should be do-able. You will have to do a few things

  • query the different sources for their 'state': grid on/off and consumption; solar generation; powerwall state
  • change the TrackGreenEnergy function to implement your policy and provide a singular 'available Amps for charging'.

I did a (slightly less complex) thing to track my home consumption and give my chargers (2) the remainder of the available amps as to now blow my main fuse.

@ngardiner
Copy link

@MikeBishop if you don't have much luck with this, you can feel free to drop an issue on my fork at https://github.com/ngardiner/TWCManager, I've done quite a bit of modularisation of the TWCManager code including a module for Powerwall, it wouldn't take much to track grid status from the Powerwall API and use it as a condition - however not having a Powerwall myself I'd need your help testing it out.

@MikeBishop
Copy link
Author

Thanks for pointing to your fork, @ngardiner! I realized after posting the issue that the base repo doesn't have any Powerwall-specific code and had found the TMC post that contained some, but I hadn't found your fork.

After a cursory look at your new "charging policy" code, I think this fits pretty well. The "track green energy" path should be fine when running off-grid -- consume nothing if the PW battery is below target charge, consume excess solar output once the PW is charged. The simplest change would be to make the "scheduled charging" function always say "not scheduled" if the grid is down. Perhaps in a generic sense, it would make sense for the EMS modules to have a "veto scheduled charging" function? That would even let you have the option of using "non-scheduled charging" to control what power draw you think is sustainable when running on battery.

My install isn't likely to be for another few months; I'm just figuring out what pieces I'll need to have to automate it. Happy to try things out with you once I have hardware!

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

No branches or pull requests

3 participants