MQTT - Creating filters on Hassbian

Hello,
I’ve been trying to use the Xiaomi BLE Temperature and Humidity sensor in my Home Assistant!
I was able to install it on my hassbian with no problem following the tutorials in the HA site.

The problem is: the range!! in order to properly use the sensor I need to place it really close to the “station” where the rasp is fixed on the wall and with a screen, and that’s not an option!

So i’ve been developing a gateway board using an esp32 to receive the BLE signals and send via MQTT to my station!
Unfortunately, my final code gets too damn big for the 4MB memory of the board and I had to use ESP-IDF to solve my problem, using one pre-made code that I found only!

It works pretty great, the problem is: the Temp Sensor sends 16 Hex as anwser, I can post it but it wont mean anything! I could try either to code and work with those numbers on the ESP code (which is kid of hard, ESP-IDF) or I coul try to do this on the HASSBIAN side of the transmission.

Therefore, how can I create rules or filters or conditionings to manipulate values recived via MQTT with code?

I tried to see the template part, not much to see. HELP!!

The temperature sensor reports temperature as a hexadecimal value? So 30 C is reported as 1E?

no, its a BLE sensor, it outputs like this:

84,61,50,56,46,50,32,72,61,54,50,46,57
now thats int instead of hex, it translates to:
T, = , 2, 8, . , 2, ESPACE, H, =, 6, 2, . , 9
In ASCII

the code I got from web do the hex to int transformation, all i need to do is work this values at HASSBIAN so i can show T=28.2 H=62.9

Here is an example on HEX:
Notification handle = 0x000e value: 54 3d 32 33 2e 36 20 48 3d 33 37 2e 33 00

I would love to do a function to work with those numbers on the esp, but the code is not mine and its on ESP-IDF, which I know little about

I’vê managed to publish the string via mqtt, just need a way to filter the values ! Any idea?

My understanding of Jinja2 (templating language used by Home Assistant) is insufficient for converting hex to text.

Without using a template, the process of receiving the incoming data, converting it, and presenting in the UI becomes more complicated. My guess is there’s a straightforward way to do it with AppDaemon (allows for programming with python). However, I have little experience with AppDaemon so someone else will have to explain how to do it.

Here are the relevant python commands for converting hex to text:

OK, i solved it already, ty anyway!!