This custom integration provides a way to monitor sensors data and control equipment connected to Reef-Pi (An open source reef tank controller based on Raspberry Pi) (GIT repository).
Using HACS (recommended)
This integration can be installed using HACS.
To do it add custom integration repository using url: https://github.com/tdragon/reef-pi-hass-custom/.
Then search for Reef Pi in the Integrations section.
To install this integration manually you have to download the content of this repository to config/custom_components/reef-pi-hass-custom directory:
mkdir -p custom_components/reef_pi
cd custom_components/reef_pi
curl -s https://api.github.com/repos/tdragon/reef-pi-hass-custom/releases/latest | grep "/reef_pi.zip"|cut -d : -f 2,3|tr -d \"| wget -i -
unzip reef_pi.zip
rm reef_pi.zipAfter that restart Home Assistant.
Install integration from UI (Configuration --> Integrations --> + --> Search for reef pi)
Configuration options:
- Host (http://ip.address or https://ip.address)
- user name
- password
Integration creates temperature sensor for each sensor connected to Reef PI: sensor.{reef-pi name}_{temperature_sensor_name}
Additionally, it creates one sensor for CPU temperature: sensor.{reef_pi_name}
For each equipment configured in Reef Pi an outlet entity is created: switch.{reef_pi name}_{equipment_name}
Additional entities include:
switch.{reef_pi name}_displayto toggle the reef-pi display on or off.button.{reef_pi name}_rebootandbutton.{reef_pi name}_powerofffor rebooting or shutting down the controller.
The integration supports optional MQTT for real-time updates, significantly reducing API polling and providing instant state changes.
- Real-time updates for temperature, pH, and equipment state changes
- Intelligent polling optimization - skips API calls for devices with recent MQTT updates
- Automatic discovery - MQTT configuration detected from reef-pi automatically
- Diagnostic sensors - monitor MQTT connection status, message counts, and last update times
Prerequisites:
- reef-pi must have MQTT enabled (Settings → Telemetry → MQTT)
- Home Assistant must have MQTT integration configured and connected to the same broker
Steps:
- Open your reef-pi integration in Home Assistant (Settings → Devices & Services → reef-pi → Configure)
- If reef-pi has MQTT enabled, you'll see an "Enable MQTT" checkbox
- Check the box and click "Submit"
- Verify MQTT is working by checking the diagnostic sensors (MQTT Status, MQTT Messages Received)
Configure unique prefixes in each reef-pi instance (Settings → Telemetry → MQTT → Prefix):
- reef-pi #1:
reef-pi/main-tank - reef-pi #2:
reef-pi/frag-tank - reef-pi #3:
reef-pi/sump
Without unique prefixes, MQTT messages from different controllers will interfere with each other.
When MQTT is enabled, the following diagnostic sensors are created:
- MQTT Status - Connection status ("connected", "disabled", "no_messages")
- MQTT Messages Received - Total message count
- MQTT Last Temperature Update - Timestamp of last temperature MQTT message
- MQTT Last Equipment Update - Timestamp of last equipment MQTT message
- MQTT Last pH Update - Timestamp of last pH MQTT message
These sensors are visible in the device diagnostics view.
On some installations of this addon, it can cause Reef Pi to intermittently drop the reading from both the Reef Pi graph/database and in Home Assistant.
To fix this:
- In Home Assistant go to Settings → Integrations → Reef-Pi integration
- Under "Integration entries" click on "Configure"
- Select "Disable pH sensor" and click "Submit"
- Click the 3 vertical dots and select "Reload"
To continue monitoring pH in Home Assistant, enable MQTT support (see "MQTT Support" section above) which provides real-time pH readings without the intermittent drop issues.