Monitor Temperatures using Bluetooth Xiaomi Mijia Thermostat MJ_HT_V1 Linux (Python & Bash)

With Bash:

1. Create checktemp.sh:
#!/bin/bash
RES=$(timeout 30 gatttool --device=AA:AA:AA:AA:AA:AA --char-write-req -a 0x0010 -n 0100 --listen)
echo $RES

2. Run it:
chmod +x checktemp.sh
./checktemp.sh

With Python:

1. Download script: https://github.com/pFenners/mijia-sensor-domoticz/blob/master/mijia/mijia_poller.py

2. Download script: https://github.com/pFenners/mijia-sensor-domoticz/blob/master/domoticz_mijia.py

3. Comment out script:
domoticzrequest("http://" + domoticzserver ...
to
# domoticzrequest("http://" + domoticzserver ...

4. Change with your device mac:
update("AA:AA:AA:AA:AA:AA","1")

5. Run:
python3 domoticz_mijia.py

Another info:
#dev name
for c in $(gatttool --device=AA:AA:AA:AA:AA:AA --char-read -a 0x0003 | cut -c 34-); do echo '0x'$c|xxd -r; done
#battery
printf "%d\n" "0x"$(gatttool --device=AA:AA:AA:AA:AA:AA --char-read -a 0x0018 | cut -c 34-)
#manufacturer
for c in $(gatttool --device=AA:AA:AA:AA:AA:AA --char-read -a 0x001c | cut -c 34-); do echo '0x'$c|xxd -r; done
#model
for c in $(gatttool --device=AA:AA:AA:AA:AA:AA --char-read -a 0x001e | cut -c 34-); do echo '0x'$c|xxd -r; done
#sn
gatttool --device=AA:AA:AA:AA:AA:AA --char-read -a 0x0020 | cut -c 34-
#hw rev
for c in $(gatttool --device=AA:AA:AA:AA:AA:AA --char-read -a 0x0022 | cut -c 34-); do echo '0x'$c|xxd -r; done
#sw rev
for c in $(gatttool --device=AA:AA:AA:AA:AA:AA --char-read -a 0x0024 | cut -c 34-); do echo '0x'$c|xxd -r; done