A HACS-compatible custom integration for Home Assistant that provides presence detection (device tracking) via the Plusnet Hub 2 or BT Smart Hub 2 router's local web interface.
The built-in bt_smarthub integration in Home Assistant:
- Has no UI config flow (YAML-only)
- Accepts no username or password fields
- Uses a synchronous third-party library (
btsmarthub_devicelist) that violates HA's async requirements - Has no
DataUpdateCoordinator— each entity polls independently - Has fragile JS-parsing code that breaks on firmware updates
This integration is a full rewrite using native aiohttp, a DataUpdateCoordinator, a proper UI config flow, and robust JS parsing.
| Hardware | Status |
|---|---|
| Plusnet Hub 2 | Tested target |
| BT Smart Hub 2 | Same hardware, same endpoints |
| EE Smart Hub (white) | Same hardware, should work |
| BT Smart Hub (original) | Uses different endpoints — not supported |
The hub exposes connected device information via two JavaScript CGI endpoints that are accessible on the local network without authentication:
http://192.168.1.254/cgi/cgi_basicMyDevice.js— list of known devices (MAC, IP, hostname, active status)http://192.168.1.254/cgi/cgi_owl.js— network topology (connection type: Ethernet/2.4GHz/5GHz)
Since firmware update V35 (~mid-2022), requests to these endpoints require a Referer header:
Referer: http://192.168.1.254/basic_-_my_devices.htm
This integration always sends this header. The username and password you enter in the config flow are stored for future-proofing but are not currently required by the endpoints.
- Open HACS in Home Assistant
- Go to Integrations → click the three dots in the top right → Custom repositories
- Add
https://github.com/YOUR_USERNAME/plusnet-hub2-hawith category Integration - Find "Plusnet Hub 2 / BT Smart Hub 2" in the HACS integration list and click Download
- Restart Home Assistant
- Go to Settings → Devices & Services → Add Integration → search for "Plusnet Hub 2"
- Download or clone this repository
- Copy the
custom_components/plusnet_hub2/folder into your HA config directory:config/ └── custom_components/ └── plusnet_hub2/ ├── __init__.py ├── manifest.json ├── config_flow.py ├── coordinator.py ├── device_tracker.py ├── const.py ├── strings.json └── translations/ └── en.json - Restart Home Assistant
- Go to Settings → Devices & Services → Add Integration → search for "Plusnet Hub 2"
Fill in the config flow form:
| Field | Default | Description |
|---|---|---|
| Hub IP address | 192.168.1.254 |
Change only if you have a non-standard LAN setup |
| Username | admin |
Leave as admin for most setups |
| Admin password | (blank) | Printed on the label on the back of the hub |
After setup, you can change the scan interval via the integration's Options:
- Settings → Devices & Services → Plusnet Hub 2 → Configure
- Range: 10–3600 seconds (default: 30 seconds)
Each tracked device creates an entity like device_tracker.my_laptop. To find a specific device's MAC address:
- Open the entity in the Home Assistant UI
- The MAC address is shown in the entity's attributes
- Alternatively, check your hub's web interface at
http://192.168.1.254→ Hub Manager → My Devices
To use a device tracker for presence detection, create a Person and assign the relevant device_tracker.* entity to it.
-
No authentication on CGI endpoints: The device list endpoints are unauthenticated. The password field is for future use. If BT/Plusnet change firmware to require auth, the integration will need updating.
-
Active status latency: The hub may show devices as "active" for a few minutes after they disconnect. This is a hub firmware behaviour, not an integration issue. Use the
consider_homeoption in HA's person/zone settings to tune this. -
IPv6 devices: The hub sometimes permanently shows IPv6 devices as active even after disconnection. This is a known firmware quirk.
-
Hub restart: After a hub restart the integration will fail to fetch until the hub is back online. HA will show a warning and retry automatically.
-
Firmware changes: The hub returns JavaScript variable declarations that this integration parses with regex. Major firmware changes could break parsing. If this happens, check the GitHub issues.
-
SmartHub 1 not supported: The original BT Smart Hub (model 1) uses a completely different JSON-RPC API with MD5 digest auth. Use the built-in
bt_smarthubintegration withsmarthub_model: 1for that.
"Cannot connect to hub"
- Verify the hub IP: open a browser and go to
http://192.168.1.254 - If you use a different IP (e.g.
192.168.0.1), enter that in the config flow
"No devices detected" / entities not created
- Check HA logs for parsing errors:
Settings→System→Logs, search forplusnet_hub2 - The hub may have returned an unexpected response format — file a GitHub issue with the raw response
"403 Forbidden" errors in logs
- A firmware update may have changed the Referer requirement
- Check if the
Refererheader value needs updating for your firmware version
pip install -r requirements_test.txt
pytest tests/ -vMIT