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

Current shaper module #382

Merged
merged 7 commits into from
Aug 7, 2022
Merged

Conversation

KipK
Copy link
Collaborator

@KipK KipK commented Jun 23, 2022

Current Shaper Class WIP

configuration:
mqtt_live_pwr : mqtt topic for instantaneous power taken from the grid
current_shaper_max_pwr : max power you can get from your energy plan in Watts

Fixes #65

@jeremypoulter
Copy link
Collaborator

Does the max power need to be a feed? Would it not be a fixed value?

@KipK
Copy link
Collaborator Author

KipK commented Jun 23, 2022

Does the max power need to be a feed? Would it not be a fixed value?

not really for my use case.
I've kept it dynamic just in case some countries has different energy plan depending of season, time and co.
This info is already provided by my counter and I use it on other scripts so I use the mqtt feed to not have to change the value at different places.

src/evse_man.h Outdated Show resolved Hide resolved
@KipK KipK marked this pull request as ready for review June 24, 2022 14:15
@KipK
Copy link
Collaborator Author

KipK commented Jun 24, 2022

latest commit seems functional. I've tested it for few hours, from another branch merged with my mqtt mods.
There's no config yet from the web ui, but works with the api.

@KipK KipK changed the title Current shaper draft Current shaper module Jun 24, 2022
@KipK
Copy link
Collaborator Author

KipK commented Jun 24, 2022

I think we have everything needed to do the web UI parts now.

Copy link
Collaborator

@jeremypoulter jeremypoulter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look good, will give it a test

@KipK
Copy link
Collaborator Author

KipK commented Jun 29, 2022

I've added the UI part. There's a pull request on the gui repo too: OpenEVSE/openevse_wifi_gui#79
Probably something to change in config_save_current_shaper() in app_config.cpp, line 422.
I had to force config_changed(), haven't understood how it should be done properly.

@KipK
Copy link
Collaborator Author

KipK commented Jul 6, 2022

I don't get why it says it has conflicts with the static files here.
Does it need the gui branch to be merged first on your side?

@KipK
Copy link
Collaborator Author

KipK commented Jul 6, 2022

Code changes look good, will give it a test

you can test booth mqtt mods and shaper merged on this branch if needed :
https://github.com/KipK/ESP32_WiFi_V4.x/tree/mqtt_shaping

@jeremypoulter
Copy link
Collaborator

There have just been some updates to the GUI so you need to merge master on both the GUI and main firmware repos

@KipK
Copy link
Collaborator Author

KipK commented Jul 6, 2022

updates to the GUI so you need to merge master on both the GUI a

missed those, thanks.

@KipK KipK force-pushed the Current_Shaping branch 2 times, most recently from b5f1325 to e36e5e2 Compare July 13, 2022 23:41
src/app_config.cpp Outdated Show resolved Hide resolved
src/web_server.cpp Outdated Show resolved Hide resolved
@KipK
Copy link
Collaborator Author

KipK commented Jul 28, 2022

should be ok now

@KipK
Copy link
Collaborator Author

KipK commented Jul 28, 2022

you need first to get the gui pull request OpenEVSE/openevse_wifi_gui#79 to make it compile on the CI/CD

@jeremypoulter
Copy link
Collaborator

Hiya, can you merge master into this and the GUI? I will fix the GUI ref after merging this PR

@KipK KipK force-pushed the Current_Shaping branch from 066e6e3 to ffc4d85 Compare July 29, 2022 17:15
@KipK
Copy link
Collaborator Author

KipK commented Jul 29, 2022

Seems I've messed up with my git. I need to cleanup

@KipK KipK force-pushed the Current_Shaping branch from ffc4d85 to dd84024 Compare July 29, 2022 17:22
@jeremypoulter
Copy link
Collaborator

Yeah, was about to say something has gone very wrong ;-)

Copy link
Collaborator

@jeremypoulter jeremypoulter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need additional APIs for enabling/disabling the shaper, this can entirely be done via the config. To my mind it is a safety feature so should be setup and enabled then left. I don't think it should have the same MQTT/HTTP APIs to 'easily' switch on/off from external sources that the divert mode does, but other than that I think this is looking really good, will do some testing , hopefully tomorrow.

src/event_log.cpp Show resolved Hide resolved
src/evse_man.h Outdated Show resolved Hide resolved
src/current_shaper.cpp Outdated Show resolved Hide resolved
src/evse_monitor.cpp Outdated Show resolved Hide resolved
@KipK
Copy link
Collaborator Author

KipK commented Jul 29, 2022

Looks good now

@jeremypoulter
Copy link
Collaborator

jeremypoulter commented Jul 29, 2022 via email

KipK and others added 3 commits July 29, 2022 20:21
If there was only a single claim that didn't set the state the EVSE manager would not defalut to active, this was only done when there where no claims. This was not a problem for previous modes that always set the state one way or another but for the current shaper it only sets the current and does not set the state, so if it is the only mode in operation and it switched off the charge it would not recover untill something else activated the charge.
@jeremypoulter
Copy link
Collaborator

I have tested this and it looks to work well. I did find a bug in the EVSE Manager when the current sharper was the only claim, and have pushed a fix.

@jeremypoulter jeremypoulter merged commit 33c8cca into OpenEVSE:master Aug 7, 2022
@KipK KipK deleted the Current_Shaping branch August 24, 2022 10:26
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 this pull request may close these issues.

Grid current limiting in DIVERT_MODE_NORMAL
2 participants