-
-
Notifications
You must be signed in to change notification settings - Fork 720
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
RCT: add battery control #18178
base: master
Are you sure you want to change the base?
RCT: add battery control #18178
Conversation
@Maschga could you give this PR a try? I'm not sure I'm calling the right functions for hold/normal. Would be great if you could test this with an actual device. |
I wouldn't know. It sounded as if the RCT would then hold the soc constant. However, that's also not what we want. Hold should prevent discharge, but still allow charge. Not sure how to best do this. I guess SOCTargetExternal with given Soc would still have the same problem. |
Is it evcc possible to calculate how much surplus is available in addition to charging the e-car and how many kw could still charge the battery? Then this could be added using |
Why? Battery does that itself?! |
I have set |
So: what to use for hold (but still charge surplus)? You'll need to tell me- I can't test this... |
Keine Ahnung, aber vielleicht hilft es euch ja... External battery control is possible when the SoC target selection is set to "Extern": Parameter: 0xF168B748 // power_mng.soc_strategy | t_enum (uint8_t) | SoC target selection The following six values are possible: 0 – SoC target = SoC 1 – Const 2 – Extern 3 – Average Battery voltage 4 – Intern (default) 5 – Timetable The power_mng.battery_power_extern parameter allows external control of the desired battery power: 0xBD008E29 // power_mng.battery_power_extern | t_float | Battery target power [W] (positive = discharge) |
You could set |
Welches Datenformat braucht da der Parameter? 1 Byte? Float32? |
Laut rctclient ist das ein float. // SetSocMin sets the minimum SOC target (power_mng.soc_min) with the given value
func (c *Connection) SetSocMin(min float32) error {
if min < 0.00 || min > 1.00 {
return fmt.Errorf("invalid SOC min value: %.2f, valid range is 0.00 to 1.00", min)
}
// Round to 2 decimal places
min = float32(math.Round(float64(min)*100) / 100)
data := make([]byte, 4)
binary.BigEndian.PutUint32(data, math.Float32bits(min))
if err := c.Write(PowerMngSocMin, data); err != nil {
return fmt.Errorf("failed to set SOC min: %w", err)
}
return nil
} |
Das Runden der Zahl kannst du weglassen. Das ändere ich noch im PR. |
Du kannst nochmal probieren. Wenn das nicht funzt gerne nach Bedarf anpassen. |
Kannst du für |
Das kannst du im Template ändern. |
Braucht man für charge überhaupt external? Sonst könnte man da auch einfach nur den minsoc setzen und müsste gar nicht mit dem Modus rumfrickeln... |
|
Hab's mit einem separaten PR gelöst. |
* Update dependency * fix BatteryCharge * add defaults * add comment
Super, das muss dann nur noch endgültig getestet werden. |
Kannst du das testen? |
Argh. Warum brauchts diese ganzen Werte? Ich möchte die nicht setzen falls es nicht absolut notwendig ist. Ich würde das gerne rückgängig machen, es sei denn es gäbe einen zwingenden Grund dafür. |
Depends on mlnoga/rct#18