Payload decoder/tags/attributes

I was able to create a decoder that works with the UM-101 vega sensor. I pass it

function Decode(fPort, bytes) {

if (fPort === 2) {
if (bytes[0] === 0x01) {
return {
Puerto_mensaje: fPort,
Tipo_paquete: bytes[0],
Carga_bateria: bytes[1],
Fecha: bytes[2] | (bytes[3] << 8) | (bytes[4] << 16) | (bytes[5] << 24),
Power_tipe: bytes[6],
Тemperatura: (bytes[7] | (bytes[8] << 8))/10,
Humedad: bytes[9],
Luz: bytes[10] | (bytes[11] << 8),
Ruido: bytes[12],
CO2: bytes[13] | (bytes[14] << 8),
Vertical_agle: bytes[15],
Temperatura_low_threshold: bytes[16],
Temperatura_high_threshold:bytes[17],
Humedad_low_threshold: bytes[18],
Humedad_high_threshold: bytes[19],
Luz_level_low_threshold: bytes[20] | (bytes[21] << 8),
Luz_level_high_threshold: bytes[22] | (bytes[23] << 8),
Ruido_level_low_threshold: bytes[24],
Ruido_level_high_threshold: bytes[25],
CO2_low_threshold: (bytes[26]) * 10,
CO2_high_threshold: (bytes[27]) * 10,

};
}

}
}
It works well
“data” : “ATCA8NFgAQsBKDMBKWEFBAAgGSgKABAnKFoAyA==”,
“object” : {
“CO2” : 1377,
“CO2_high_threshold” : 2000,
“CO2_low_threshold” : 0,
“Carga_bateria” : 48,
“Fecha” : 1624371328,
“Humedad” : 40,
“Humedad_high_threshold” : 40,
“Humedad_low_threshold” : 25,
“Luz” : 307,
“Luz_level_high_threshold” : 10000,
“Luz_level_low_threshold” : 10,
“Power_tipe” : 1,
“Puerto_mensaje” : 2,
“Ruido” : 41,
“Ruido_level_high_threshold” : 90,
“Ruido_level_low_threshold” : 40,
“Temperatura_high_threshold” : 32,
“Temperatura_low_threshold” : 0,
“Tipo_paquete” : 1,
“Vertical_agle” : 4,
“Тemperatura” : 26.7

I do not get that for example Thinsgboard can read the different elements, example CO2, temperature, etc… Do you know how I can complete the decoder so that these elements are tags or attributes? It’s possible? Thank you…

Hi @Francisco_Javier_Gar ,

“Do you know how I can complete the decoder so that these elements are tags or attributes? It’s possible?”
I would think it is impossible to develop a Decoder to add tags. Because, Decoder only works on the device uplink data and not on the device meta data (Tags and Variables).

BR,
Chay