Decyphering iMiEV and iON CAR-CAN message data

Mitsubishi i-MiEV Forum

Help Support Mitsubishi i-MiEV Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
In case anyone ever does it:
MeatPi wiCAN interface, sends CAN Data via MQTT to home Assistant. Node Red Subscribed to topic.
Function with 16 Outputs sends iMiev Data to Home Assistant for automation.
Note, the IDs are in decimal.

Here is the code for the function:

Code:
var SOC1, SOC2, Battery100Cap, CellMaxTemp, CellMinTemp, BatteryVolts, CellMaxVolt, CellMinVolt, ChargeAmpsAC, ChargeAmpsDC, ChargeVoltsAC, ChargeVoltsDC, ChargerTemperature1, ChargerTemperature2, Odometer, OutdoorAirTemperature;

for (let i = 0; i < msg.payload.frame.length; i++) {
    let frame = msg.payload.frame[i];
    let id = frame.id;
    let data = frame.data;

    switch (id) {
        case 884:
            SOC1 = { payload: (data[0] - 10) / 2 };
            SOC2 = { payload: (data[1] - 10) / 2 };
            Battery100Cap = { payload: data[6] / 2 };
            CellMaxTemp = { payload: data[4] - 50 };
            CellMinTemp = { payload: data[5] - 50 };
            break;


        case 883:
            BatteryVolts = { payload: (data[4] * 256 + data[5]) / 10 };
            CellMaxVolt = { payload: (data[0] + 210) / 100 };
            CellMinVolt = { payload: (data[1] + 210) / 100 };
            break;
        case 905:
            ChargeAmpsAC = { payload: data[6] / 10 };
            ChargeAmpsDC = { payload: data[2] / 10 };
            ChargeVoltsAC = { payload: data[1] };
            ChargeVoltsDC = { payload: 2 * data[0] + 0.5 };
            ChargerTemperature1 = { payload: data[3] - 50 };
            ChargerTemperature2 = { payload: data[4] - 50 };
            break;
        case 1042:
            Odometer = { payload: data[2] * 65536 + data[3] * 256 + data[4] };
            break;
        case 646:
            OutdoorAirTemperature = { payload: data[3] - 50 };
            break;
        default:
            break;
    }
}

return [SOC1, SOC2, Battery100Cap, CellMaxTemp, CellMinTemp, BatteryVolts, CellMaxVolt, CellMinVolt, ChargeAmpsAC, ChargeAmpsDC, ChargeVoltsAC, ChargeVoltsDC, ChargerTemperature1, ChargerTemperature2, Odometer, OutdoorAirTemperature];
 
hello,

looks like you guys know a lot about the can data, your information will realy help me.
thanks for that.

i'm currently trying to readout the OBC without a car, and i think i need some can data for that.
i do not have a car for recording myself at the time.
so i was wondering if someone got some can recordings i can try?


regards,
thijs
 
Back
Top