Local Bluetooth integration for Petkit water fountains (W4, W5, CTW3 series).
Communicates directly over BLE — no cloud, no API token, no Petkit account required.
| Model | BLE Name | Notes |
|---|---|---|
| CTW3 | Petkit_CTW3* | Battery + AC, extra sensors |
| CTW2 | Petkit_CTW2 | |
| W5C | Petkit_W5C | |
| W5N | Petkit_W5N | |
| W5 | Petkit_W5 | |
| W4X UVC | Petkit_W4XUVC | |
| W4X | Petkit_W4X |
- Sensors: filter life %, pump runtime, water purified, energy today, filter days remaining, battery (CTW3), RSSI
- Binary sensors: pump running, water missing, filter warning, hardware failure, DND, pet detected (CTW3), AC power (CTW3), low battery (CTW3)
- Buttons: reset filter, pump on, pump off
- Switch: power on/off
- ESPHome Bluetooth proxy support — works transparently via Home Assistant's native Bluetooth stack
- Home Assistant 2024.1 or newer
- A Bluetooth adapter or ESPHome Bluetooth proxy
- In HACS → Integrations → ⋮ → Custom repositories
- Add
https://github.com/aavdberg/ha-petkitwith category Integration - Install Petkit BLE and restart Home Assistant
Note: HACS 2.x no longer supports branch selection in the UI. Use one of the methods below to test the
devbranch.
- In Home Assistant, open File Editor or connect via SSH / Samba
- Copy the folder
custom_components/petkit_blefrom thedevbranch to:/config/custom_components/petkit_ble/ - Restart Home Assistant
To download the dev branch as a zip:
https://github.com/aavdberg/ha-petkit/archive/refs/heads/dev.zip
Extract and copy the custom_components/petkit_ble folder.
Every push to dev automatically creates a pre-release tag (e.g. v1.0.0-dev.202604071200).
- In HACS, open the Petkit BLE repository
- Select the ⋮ menu → Show details
- Enable "Show beta releases" in your HACS settings (⋮ → Settings → Experimental)
- The latest dev pre-release will appear as an available update in HACS
cd /config/custom_components
git clone -b dev https://github.com/aavdberg/ha-petkit.git petkit_ble_dev
# Then symlink or copy the inner folder:
cp -r petkit_ble_dev/custom_components/petkit_ble ./petkit_bleAfter installation, go to Settings → Devices & Services → Add Integration → Petkit BLE.
HA will scan for nearby Petkit fountains automatically. If none appear, enter the device's Bluetooth MAC address manually (found in the Petkit app or your router's ARP table).
The integration polls the fountain every 60 seconds. Commands (pump on/off, filter reset) connect on demand and refresh the state immediately after.
A ready-made dashboard YAML is included in docs/dashboard.yaml that mirrors the Petkit iOS app layout.
- In Home Assistant, go to Settings → Dashboards → Add Dashboard
- Choose New dashboard from scratch
- Open the new dashboard, click ⋮ → Edit dashboard → ⋮ → Raw configuration editor
- Paste the contents of
docs/dashboard.yaml - Save
Note: The YAML uses entity prefix
petkit_ctw3_100. If your device has a different prefix, use find-and-replace to update all entity IDs.
| Section | Contents |
|---|---|
| Controls | Power switch, mode selector (Normal/Smart) |
| Status | Pump running, pet drinking, AC power, DND, warnings |
| Daily Statistics | Water purified, energy used, pump runtime, drink events |
| Filter | Filter life gauge, days remaining, reset button |
| Battery | Battery gauge, voltage, AC power, pump suspended |
| Settings | Smart work/sleep timing, LED brightness & schedule, DND schedule |
| Device Info | Firmware, hardware version, BLE RSSI, total pump runtime, UVC |
Communication uses a proprietary BLE protocol over two GATT characteristics (notify + write-without-response). Authentication is required on every connection.
feature/* or fix/*
│
▼ Pull Request + lint check
dev ← development & testing
│
▼ Pull Request + lint check
main ← production (HACS users)
→ automatic GitHub Release
| Branch | Purpose | Protected |
|---|---|---|
main |
Stable production release | ✅ PR required + lint must pass |
dev |
Integration & testing | ✅ PR required + lint must pass |
feature/* |
New functionality | Free — PR to dev |
fix/* |
Bug fixes | Free — PR to dev |
- Branch off
dev:git checkout dev git checkout -b feature/my-feature
- Commit your changes:
git commit -m "feat: description of the change" - Push and open a Pull Request to
dev:git push origin feature/my-feature
- The lint check (ruff) and Copilot code review run automatically.
- When
devis stable, a PR tomainis opened to trigger a release.
Every merge to main automatically creates a GitHub Release based on the version field in manifest.json.
Bump the version in manifest.json on dev before opening a release PR.
# Install linter
pip install ruff
# Check for lint errors
ruff check custom_components/
# Check formatting
ruff format --check custom_components/
# Auto-fix issues
ruff check --fix custom_components/