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

Feature: Add configurable limit to charge/discharge on BYD Modbus #290

Merged
merged 8 commits into from
May 12, 2024

Conversation

dalathegreat
Copy link
Owner

@dalathegreat dalathegreat commented May 6, 2024

What

This PR does two things:

  • New feature: Values set in webserver for max charge/discharge in amps is now read and used by the BYD Modbus inverter protocol
  • Performance improvements for BYD Modbus

Why

To be able to tune peak power from the webui on Fronius inverters

How

Using the std::min function to see which is smaller, User set limit OR battery value? We use the smallest one! This PR also removes all memcopy handling, and simplifies the register writing significantly

@dalathegreat dalathegreat marked this pull request as draft May 7, 2024 20:56
@dalathegreat
Copy link
Owner Author

Converting to draft, I want to investigate more on how to increase performance

@dalathegreat dalathegreat marked this pull request as ready for review May 10, 2024 10:40
@dalathegreat
Copy link
Owner Author

Ready for review, this is now extremely sped up! :)

@smaresca
Copy link
Collaborator

Looks good to me given the PR scope. I agree with Caboom on the need/suggestions for initialization refactoring; I had the same impulses. Glad to see reduced reliance upon memcpy. For the future: configurable limit for charge/discharge being expanded elsewhere.

Copy link
Collaborator

@Cabooman Cabooman left a comment

Choose a reason for hiding this comment

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

LGTM! There's always small stuff to tweak but iterations are king

@dalathegreat dalathegreat merged commit e5c408f into main May 12, 2024
48 checks passed
@dalathegreat dalathegreat deleted the feature/byd-modbus-amp-limit branch May 12, 2024 16:47
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.

3 participants