HomeKit Geiger Counter
An Apple HomeKit accessory for the DF Robot Gravity Geiger Counter SEN0463 radiation sensor running on a Raspberry Pi.

Note: this app is currently only supported in Home+ and not yet in Apple Home. Please up-vote this forum post if you'd like Apple to add support.
Dependencies
- Go - this accessory is written in Go
- HomeControl - to expose climate readings from the Enviro+ as an Apple HomeKit accessory
- Geiger Counter - to read the Geiger Counter sensor and export it for scraping by Prometheus
Installation
Install this on a Raspberry Pi, or test it on macOS.
Setup
- Install Go >= 1.14 (useful Gist for Raspberry Pi)
- Clone this project:
git clone https://github.com/sighmon/homekit-geiger-counter and then cd homekit-geiger-counter
- Install the Go dependencies:
go get
- Install and run the Geiger Counter Sensor exporter geiger_counter_df_robot_sen0463_esp32_http_server
Build
- To build this accessory:
go build homekit-geiger-counter.go
- To cross-compile for Raspberry Pi on macOS:
env GOOS=linux GOARCH=arm GOARM=7 go build homekit-geiger-counter.go
Run
- Execute the executable:
./homekit-geiger-counter
- Or run with the command:
go run homekit-geiger-counter.go
Start automatically at boot
- sudo cp homekit-geiger-counter.service /lib/systemd/system/homekit-geiger-counter.service
- sudo systemctl daemon-reload
- sudo systemctl enable homekit-geiger-counter.service
- sudo systemctl start homekit-geiger-counter.service
Optional flags
The flag defaults can be overridden by handing them in at runtime:
-host=http://0.0.0.0 The host of your sensor
-port=1006 The port of your sensor
-sleep=3s The time between updating the accessory with sensor readings (3s equals five seconds)
-dev This turns on development mode to return a random reading without needing to have a sensor
e.g. to override the port run: go run homekit-geiger-counter.go -port=8000 or ./homekit-geiger-counter -port=8000
Reset this accessory
If you uninstall this accessory from your Apple Home, you'll also need to delete the stored data for it to be able to be re-added.
macOS
- Delete the data in the folder created:
homekit-geiger-counter/Radiation/
- Restart the executable
Raspberry Pi
- Remove the persistent data:
rm -rf /var/lib/homekit-geiger-counter/data
- Restart the Raspberry Pi
Thanks
This project uses the amazing work of Matthias. Please consider donating if you found this useful.