custom-components / ble_monitor

BLE monitor for passive BLE sensors
https://community.home-assistant.io/t/passive-ble-monitor-integration/
MIT License
1.91k stars 247 forks source link

adding airthingwave sensors #704

Closed Vendo232 closed 2 years ago

Vendo232 commented 2 years ago

Hi

running already Airthingswave addon in HA which reads BLE data from Radon sensors over BT. Problem is that it is cloding with BLE Monitor probably conflict over access to the BT device,

Would it be possible to add AirThingsWave sensors?

https://github.com/marcelm/radonwave

Ernst79 commented 2 years ago

The airthingswave integration is setting up a connection with the device. This is not supported in BLE monitor at the moment. To run both blemonitor and airthingwave integration, I would recommend to use a second Bluetooth adapter, e.g. a ASUS BT400 or something else. You can set BLE monitor to use one device while the airthingswave integration can use the other.

andras-tim commented 2 years ago

The Airthings has official repositories for its devices:

... and as I see, all of them use only BLE instead of connection-oriented BT.

(I think, the Wave Plus is very impressive because it can provide humidity, temperature, radon, relative atmospheric pressure, CO2 and TVOC)

Ernst79 commented 2 years ago

Are you sure its using BLE broadcasting instead of connnection-oriented BT? For example in Wave mini I see

    def connect(self, retries=1):
        tries = 0
        while (tries < retries and self.is_connected() is False):
            tries += 1
            if self.mac_addr is None:
                self.mac_addr = self.discover()
            try:
                self._periph = btle.Peripheral(self.mac_addr)
                self._char = self._periph.getCharacteristics(uuid=self.CURR_VAL_UUID)[0]
            except Exception:
                if tries == retries:
                    raise
                else:
                    pass

https://github.com/Airthings/wavemini-reader/blob/8ce3e116e29b73e483a83eaeafa2e3030b9240f3/read_wavemini.py#L60

andras-tim commented 2 years ago

Are you sure its using BLE broadcasting instead of connnection-oriented BT? For example in Wave mini I see

    def connect(self, retries=1):
        tries = 0
        while (tries < retries and self.is_connected() is False):
            tries += 1
            if self.mac_addr is None:
                self.mac_addr = self.discover()
            try:
                self._periph = btle.Peripheral(self.mac_addr)
                self._char = self._periph.getCharacteristics(uuid=self.CURR_VAL_UUID)[0]
            except Exception:
                if tries == retries:
                    raise
                else:
                    pass

https://github.com/Airthings/wavemini-reader/blob/8ce3e116e29b73e483a83eaeafa2e3030b9240f3/read_wavemini.py#L60

Wow... sorry! In this case, the README.md files are lying a "bit":

This is a project to provide users an interface (read_waveplus.py) to read current sensor values from the Airthings Wave Plus devices using a Raspberry Pi 3 Model B over Bluetooth Low Energy (BLE).

Ernst79 commented 2 years ago

Both types are BLE. See for some explanation this page. https://www.blemobileapps.com/ble-mobile/

BLE communication can be done as "advertising" (one-way communication, supported by BLE monitor) or as "connecting" (two-way communication, not supported by BLE monitor). But they are both BLE communication.