Home Assistant integration for Rad Pro radiation detector devices (Geiger-Müller tube based dosimeters).
- Auto-detection of RadPro devices on serial ports (
/dev/ttyACM*,/dev/ttyUSB*) - Radiation measurements:
- CPS (counts per second)
- CPM (counts per minute)
- µSv/h (dose rate in microsieverts per hour)
- Tube pulse count (lifetime counter)
- Device diagnostics:
- Device ID
- Battery voltage (per cell)
- Periodic refresh of tube sensitivity and device info
- Open HACS in your Home Assistant
- Click on "Integrations"
- Click the three dots menu → "Custom repositories"
- Add repository URL:
https://github.com/Defensor7/radpro-ha - Select category: "Integration"
- Click "Add"
- Search for "RadPro" and install
- Restart Home Assistant
- Add configuration to
configuration.yaml
- Download the latest release from GitHub Releases
- Copy the
custom_components/radprofolder to your Home Assistant'sconfig/custom_components/directory - Restart Home Assistant
- Add configuration to
configuration.yaml
- Go to Settings → Devices & Services
- Click + Add Integration
- Search for RadPro
- Select serial port (or use
autofor auto-detection) - Configure scan interval
- Click Submit
You can still use YAML configuration, but UI is recommended:
radpro:
port: auto # or /dev/ttyACM0, /dev/ttyUSB0, etc.
baudrate: 115200 # serial port baudrate (default: 115200)
scan_interval: 2 # polling interval in seconds (default: 2)| Option | Type | Default | Description |
|---|---|---|---|
port |
string | auto |
Serial port path or auto for auto-detection |
baudrate |
int | 115200 |
Serial port baudrate |
scan_interval |
int | 2 |
Polling interval in seconds |
After configuration, the following sensors will be available:
| Sensor | Description | Unit |
|---|---|---|
sensor.radiation_cps |
Counts per second | cps |
sensor.radiation_cpm |
Counts per minute | cpm |
sensor.radiation_usv_h |
Dose rate | µSv/h |
sensor.tube_pulse_count |
Lifetime pulse counter | pulses |
sensor.radpro_device_info |
Device ID + attributes | — |
This integration communicates with RadPro devices via serial port using the same protocol as radpro-tool.py.
- Baudrate: 115200
- Format: ASCII commands with newline terminator
- Response:
OK <value>on success
CPM = delta_pulses × 60 / delta_time
µSv/h = CPM / tubeSensitivity
The tubeSensitivity value is device-specific and depends on the GM tube model (e.g., SBM-20: ~153.8 CPM per µSv/h).
Use the provided development script:
# Start Home Assistant with the component mounted
./dev-setup.sh start
# After making code changes, restart to apply
./dev-setup.sh restart
# View logs
./dev-setup.sh logs
# Stop and cleanup
./dev-setup.sh clean./dev-setup.sh [command] [options]
Commands:
start Start/create the HA container (default)
stop Stop the container
restart Restart after code changes
logs Show container logs
shell Open shell in the container
clean Stop and remove container + config
status Show container status
Options:
--port PORT Serial port (default: auto)
--config DIR Config directory (default: ~/ha-radpro-dev/config)
--tz TIMEZONE Timezone (default: UTC)docker run -d \
--name homeassistant-dev \
--privileged \
-v ~/ha-dev/config:/config \
-v /path/to/radpro-ha/custom_components/radpro:/config/custom_components/radpro:ro \
-v /dev:/dev \
--network=host \
ghcr.io/home-assistant/home-assistant:stableCreate a mock device using socat:
# Terminal 1: Create virtual serial port
socat -d -d pty,raw,echo=0,link=/tmp/radpro-mock pty,raw,echo=0,link=/tmp/radpro-client
# Terminal 2: Run emulator
python3 << 'EOF'
import serial
ser = serial.Serial('/tmp/radpro-client', 115200, timeout=1)
pulse_count = 1000000
while True:
line = ser.readline().decode().strip()
if not line:
continue
print(f"< {line}")
if line == "GET deviceId":
response = "OK RadPro-Mock-001"
elif line == "GET tubePulseCount":
pulse_count += 5 # ~5 cps
response = f"OK {pulse_count}"
elif line == "GET tubeSensitivity":
response = "OK 153.8" # SBM-20
elif line == "GET deviceBatteryVoltage":
response = "OK 1.45"
else:
response = "ERROR unknown command"
print(f"> {response}")
ser.write((response + "\n").encode())
EOFThen configure:
radpro:
port: /tmp/radpro-mockAdd to configuration.yaml:
logger:
default: warning
logs:
custom_components.radpro: debug-
Check if the device is connected:
ls -la /dev/ttyACM* /dev/ttyUSB*
-
Check permissions:
# Add user to dialout group sudo usermod -a -G dialout $USER
-
Test communication directly:
python3 -c " import serial ser = serial.Serial('/dev/ttyACM0', 115200, timeout=1) ser.write(b'GET deviceId\n') print(ser.readline().decode().strip()) "
Make sure to run Docker with --privileged flag and mount /dev:
docker run --privileged -v /dev:/dev ...- Check Home Assistant logs for errors
- Verify the device is responding to commands
- Ensure
tubeSensitivityis being read correctly (check debug logs)
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
