Codec payload chirpstack S2100 Seeed

Hi, I set up a personal Chirpstack 4.4 server connected to a Lorawan sensecap M2 gateway: everything works well except for the processing of values ​​with the codec?
I cannot create the codec for S2100, I have an S2110 sensorbuilder which has an i2c SDC41 sensor with 3 values ​​temperature, humidity and CO2 and the S2110 is connected via rs485 to the S2100, I receive the S2100 on my chirpstack 4.4 server but I cannot decode the values ​​for the S2100:
Could you help me create a codec? I recovered my HEX key: “30 12 02 00 28 83 18 00 45 AF D8 33 30 04 00 0C 54 40 80 00 00 00” thanks to the event log which gives me: data: “MBICACgG…” retrieved in UPLINK_CODEC
but the
the documentation does not mention a json codec for chirpstack server?

Since if seeedstudio doesn’t provide a codec, it tells me to post here

I have many things but it doesn’t work?

I used chatgpt to adapt my code: the key values: “4098” and “4098” and “4100” to inform key measurement in measurements were taken from a code so I don’t know if they are consistent?

I don’t know if I need to enter the HEX key? AND OR
codec json:
function Decoder(bytes, port) {
// Si le payload contient plus de 20 octets, ne conserver que les 20 premiers.
if (bytes.length > 20) {
bytes = bytes.slice(0, 20);
}

// Conversion du tableau d’octets en chaîne hexadécimale en majuscules.
var hexString = bytes2HexString(bytes).toUpperCase();

// Initialisation de l’objet décodé avec la structure souhaitée.
var decoded = {
valid: true,
err: 0,
payload: hexString,
messages: [ , , ]
};

// Exécute le décodage si le fPort est 3 et que le payload a au moins 20 octets.
if (port === 3 && bytes.length >= 20) {
var offset = 8; // Ignorer les 8 premiers octets (registres 0x0000 à 0x0003)

offset += 2; // Ignorer le registre 0x0004 (2 octets)
// Registre 0x0005 (Température) : octets 10-11
var temperatureRaw = (bytes[offset] << 8) | bytes[offset + 1];
var temperature = temperatureRaw / 100; // Conversion en °C
offset += 2; // Passer le registre 0x0006 (2 octets)

// Registre 0x0007 (Humidité) : octets 14-15
var humidityRaw = (bytes[offset] << 8) | bytes[offset + 1];
var humidity = humidityRaw / 100; // Conversion en %
offset += 2; // Passer le registre 0x0008 (2 octets)

// Registre 0x0009 (CO₂) : octets 18-19
var co2 = (bytes[offset] << 8) | bytes[offset + 1];

// Construction du premier groupe de messages avec nos mesures.
decoded.messages[0].push({
  measurementId: "4097",
  measurementValue: temperature,
  type: "Air Temperature"
});
decoded.messages[0].push({
  measurementId: "4098",
  measurementValue: humidity,
  type: "Air Humidity"
});
decoded.messages[0].push({
  measurementId: "4100",
  measurementValue: co2,
  type: "CO2"
});

} else {
decoded.valid = false;
decoded.err = -1; // fPort incorrect ou payload trop court
}

return { data: decoded };
}

// Fonction utilitaire pour convertir un tableau d’octets en chaîne hexadécimale.
function bytes2HexString(arrBytes) {
var str = “”;
for (var i = 0; i < arrBytes.length; i++) {
var hex = arrBytes[i].toString(16);
if (hex.length === 1) {
hex = “0” + hex;
}
str += hex;
}
return str;
}

Thank you in advance
christopher