Update PYLON-CAN.cpp

- Add Sleep status to open contactors in inverter at Fault
- Change status-value from 0x 11, 12, 13 to 01, 02, 03 to not call for extra chargning.
This commit is contained in:
LevinSwe 2024-07-27 14:11:32 +02:00 committed by GitHub
parent 3e0ad30de5
commit 866bc8e1e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -240,12 +240,14 @@ void update_values_can_inverter() { //This function maps all the values fetched
PYLON_4211.data.u8[7] = (datalayer.battery.status.soh_pptt / 100);
// Status=Bit 0,1,2= 0:Sleep, 1:Charge, 2:Discharge 3:Idle. Bit3 ForceChargeReq. Bit4 Balance charge Request
if (datalayer.battery.status.current_dA < 0) {
PYLON_4251.data.u8[0] = (0x11); // Charge
if (datalayer.battery.status.bms_status == FAULT) {
PYLON_4251.data.u8[0] = (0x00); // Sleep
} else if (datalayer.battery.status.current_dA < 0) {
PYLON_4251.data.u8[0] = (0x01); // Charge
} else if (datalayer.battery.status.current_dA > 0) {
PYLON_4251.data.u8[0] = (0x12); // Discharge
PYLON_4251.data.u8[0] = (0x02); // Discharge
} else if (datalayer.battery.status.current_dA == 0) {
PYLON_4251.data.u8[0] = (0x13); // Idle
PYLON_4251.data.u8[0] = (0x03); // Idle
}
#ifdef INVERT_LOW_HIGH_BYTES //Useful for Sofar inverters