RadonEye BLE Interface

Here is a one liner that works for the new device:

echo $(timeout 5 gatttool -i hci0 -t public -b 94:3c:c6:dd:42:ce --char-write-req --handle=0x002a --value=50 --mtu=507 --listen)

Great !

But why does gatttool provide only zero data in case -t public and --listen are not included ?
And most of the time gatttool complains with:

connect error: Function not implemented (38)

until it ends with success.
But at least this behavior is similar to the interactive mode.

Why not just use the updated python script I posted? It works better and posts stuff to MQTT.

Also I think that this is not a bug in gatttool. It seems that the process for getting current readings from the RD200 has changed. The new device expects you to subscribe to notifications and receive the data that way versus reading it directly from the handle.

1 Like

@lunaHome I spent way too much time trying to make the RadonEye I purchased this year work with ESPHome but with no luck. But your script works beautifully on my Rapsberry Pi Zero W.

2 Likes

So happy to see this script. I have installed on a pi 2 and I am getting the following errors on run. Any ideas would be great!

pi@phoscon:~/Downloads/radonreader-master $ python3 radon_reader.py -v -ms localhost -mu radonuser -mw radon123  -ma -m -t 1 -a 94:3C:C6:DD:20:02
2022-07-12 08:33:08,030 - root - DEBUG - Re-trying connections attempts: 1'
2022-07-12 08:33:09,070 - root - DEBUG - Re-trying connections attempts: 2'
2022-07-12 08:33:10,107 - root - DEBUG - Re-trying connections attempts: 3'
2022-07-12 08:33:11,140 - root - DEBUG - Re-trying connections attempts: 4'
2022-07-12 08:33:12,143 - root - DEBUG - Sending payload (byte): b'P' To handle (int): 42
Helper not started (did you call connect()?)
~~~

I got it working! Just realized pi 2 does not have BT. Setup a pi 3 and it works!
Thanks for this!!

Hey I don’t think that the RPi2 has Bluetooth. I think they added that with the RPi3

Good deal!

The python script with a raspberry pi zero w works great! I would love to get ESPHome working it’s a bit lighter than a full OS for this measurement, but for now at least I’m gathering data!

This may not be the right place for this question / issue but I’m running the phython script on a pi4 with phython 3.9. I’m getting a message “Helper not started (did you call connect()?)”. Any idea what I’m doing wrong? I had it working last night, I rebooted and now I get this message.

Thank you.

Make sure you have Bluetooth turned on.

Hi, great work, thank you so much for bringing this to HA! I was wondering, now that Bluetooth is a first class citizen in HA (since the last big update), can this script maybe be turned into a HA plugin so that a second pi is no longer needed (they are hard to find nowadays) ?

2 Likes

Hi! First of all, thanks to everyone contributing to this solution. The radon_reader script works great for me.

I got three RadonEye devices. Two are from 2022 – they are working fine. They get detected by the scanning function and the sensor data are transferred properly via MQTT.

I have a third device, probably from 2021 or earlier which I have an issue with though. It get’s detected by the scanning function, but then the script seems not to be able to connect to device and/or to retrieve the data. I do get the following output:

2022-08-25 20:28:27,094 - root - INFO - -a (mac address) and -t (device type 0|1 not specified, reverting to auto-scan)
2022-08-25 20:28:27,094 - root - DEBUG - Scanning for devices
2022-08-25 20:28:37,109 - root - DEBUG - Device name: FR:R20:SN0372     
2022-08-25 20:28:37,109 - root - INFO - Found RD200 - x<2022 revision with address: xx:xx:xx:xx:xx:xx
2022-08-25 20:28:37,153 - root - DEBUG - Re-trying connections attempts: 1'
2022-08-25 20:28:41,916 - root - DEBUG - Re-trying connections attempts: 2'
2022-08-25 20:28:46,918 - root - DEBUG - Re-trying connections attempts: 3'
2022-08-25 20:28:51,917 - root - DEBUG - Re-trying connections attempts: 4'
2022-08-25 20:28:52,918 - root - DEBUG - Sending payload (byte): b'P' To handle (int): 11
Helper not started (did you call connect()?)
2022-08-25 20:28:52,919 - root - DEBUG - Failed, trying again (1)
...

FYI - I replaced the real MAC address with “xx:xx:xx:xx:xx:xx” in the snippet above.

If I run ‘bluetoothctl info’, I get the following output:

bluetoothctl info xx:xx:xx:xx:xx:xx
Device xx:xx:xx:xx:xx:xx (random)
	Name: FR:R20:SN0372     
	Alias: FR:R20:SN0372     
	Paired: yes
	Trusted: yes
	Blocked: no
	Connected: yes
	LegacyPairing: no
	UUID: Vendor specific           (00001523-1212-efde-1523-785feabcd123)
	UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
	UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
	UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)

FYI - I ‘trusted’ and ‘paired’ the device with ‘bluetoothctl’, to see if this solves the problem. But it doesn’t work with both settings being “yes” or “no” for this device. The radon_reader script works well for the other two devices w/o either of them being trusted or paired.

Last but not least, I ran ‘gatttool’ to see if it returns anything, but it either returns an empty row or “Device or resource busy (16)”

echo $(timeout 5 gatttool -i hci0 -t public -b xx:xx:xx:xx:xx:xx --char-write-req --handle=0x002a --value=50 --mtu=507 --listen)
connect to xx:xx:xx:xx:xx:xx: Device or resource busy (16)

With the FTLabs App, I’m able to connect to the device and values show up as expected.

Does anyone have an idea how to debug this further? It might be an issue with the device or it is a new “version” of the device that doesn’t work with the current script. I’d be happy to update the GitHub repo to make it work also with this version, however I’m not a Bluetooth expert on the Linux terminal and could use some debugging support.

Thank you!

That is the older version, which should work with the original python code, but also should work with the updated code as well. Maybe it’s not working well with the old devices.

Also, your gatttool command should be different. Maybe try:
gatttool -i hci0 -t random -b xx:xx:xx:xx:xx:xx --char-write-req --handle=0x000b --value=50 --char-read --handle=0x000d

The new model uses --handle=0x000a while the old model uses --handle=0x000b.

I have the new one, but try again with gatttool to see if it will respond to that.

Also, you can set the hardware type. I don’t have the documentation right now, but there’s a command switch to choose the first or second version with the updated radon reader script.

I am with you here. I have these working great through ESPHome but I would love to be able to remove a layer by having HA communicate direct to the RD200.

I have create RD200 reader python script that reads one or more devices, publishes to MQTT and also publishes Home Assistant discovery event so it can be automatically discovered by Home Assistant if MQTT integration is set up:

1 Like

Hi. Thanks for updated gattool command. That seems to work. The issue with the Python code is, that the device actually doesn’t connect.

bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral xx:xx:xx:xx:xx:xx, addr type: public

I tried to use address type “random”, but also without success. I guess, the script works fine and would read the data if it could connect.

Is anyone aware of any efforts to create a native Home Assistant integration using the new bluetooth support and bluetooth proxies? I’ve never made an integration before, but if I find some time over the winter I might give it a go.

3 Likes

Hi,
i just set up the Radon Eye (RD200) with ESPHome on Home Assistant and did this config on my ESP32: Radon Eye BLE Sensors — ESPHome
Unfortunately it seems i have the same problem as described above, as the device is made 03/2022:
[esp32_ble_tracker:832]: Name: 'FR:RE2**********'
I don’t understand, what i have to do now, to make the connection to the Radon Eye work.
Would someone be kind and explain it here?
I am pretty new on Home Assistant and added ESPHome just for Radon Eye to work (have also the bluetooth proxies configured, but figured out, they don’t work yet with the Radon Eye, so configured an additional ESP32).

Does it list the name with asterisks in it, or are there numbers?

List the actual name if you changed it to asterisks.

Also, is it FR:RE2 or FR:RU2?

Try this to see if it works: