[Solved] Rpi 3 + Miflora plant sensor: gattool not found

I’m running HASS in a virtualenv. I’ve set up a miflora plant sensor but no data is received. Having a look at /var/log/daemon.log shows that gatttool could not be found. This is the necessary tool that reads the data from sensor:
Feb 10 21:06:57 schneekluth hass[31099]: /bin/sh: 1: gatttool: not found

When running demo.py using this library data is correctly received from miflora sensor:

Getting data from Mi Flora
FW: 2.8.6
Name: Flower care
Temperature: 18.0
Moisture: 9
Light: 136
Conductivity: 69
Battery: 87

The sensor itself if working fine but it wont work with HASS. Can anybody help with this issue?

Got it working! It’s basically the same issue I had with my nmap tracker in my virtualenv installation.

To get the sensor working and gatttool executed successfully just edit this file:
/srv/homeassistant/lib/python3.4/site-packages/miflora/miflora_poller.py
and add full path to gatttool (/usr/bin/gatttool) in the functions def write_ble in line 47 and def read_ble in line 106 for example:

while attempt <= retries:
   cmd = "/usr/bin/gatttool --device={} --char-read -a {} --adapter={}".format(mac, handle, adapter)

I’d also point to these useful debugging commands that helped a lot while troubleshooting the mi flora plant sensor:

Final Question:

I basically don’t understand why my virtualenv constantly needs full path for components involving the shell. I’ve installed Homeassistant according to the installation instructions but with every update I have to readd the full path to the corresponding files. It is a little annoying. Can anyone help me out with this? Is there something wrong with my virtualenv?