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!!
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: