Child WiFi Blocker 
Version 1.3.0 | Automatically block your child's WiFi at bedtime and unblock it in the morning — via the UniFi Network integration!
Create one automation per child. Each child can have multiple devices (phone, tablet, laptop) — all blocked and unblocked together at the same time. ![]()
Features
Automatic blocking — Blocks all configured devices at the set bedtime
Automatic unblocking — Unblocks devices again in the morning
Day schedule — Choose which days the schedule is active (weekdays, weekend, or any combination)
Self-correcting — On HA startup and automation reload, immediately enforces the correct state without waiting for a manual trigger
Away blocking — Optionally block devices immediately when nobody is home, and unblock when someone returns (only during the allowed time window)
Quick toggle — Enable/disable the schedule without removing the automation
Requirements
- Home Assistant 2024.6.0+
- UniFi Network integration — Installed and configured in Home Assistant
- UniFi client block switches — The integration creates a
switchentity per tracked client device. When the switch is ON, the device is blocked from the network.
Optional
- Person / device_tracker / group entity — For the "block when nobody is home" feature
How It Works
The blueprint uses the UniFi switch entities that the UniFi Network integration creates per tracked device. Flipping a switch ON blocks that device from the network; OFF allows it again.
Trigger moments
| Trigger | Action |
|---|---|
| Block all devices — only on active days | |
| Unblock all devices — only on active days | |
not_home |
Block immediately (if away-blocking is enabled) |
home |
Unblock (if enabled and within allowed time window) |
| Evaluate current time and enforce correct state | |
| Evaluate current time and enforce correct state |
Midnight-crossing schedules
The blueprint correctly handles schedules that cross midnight (e.g. block at 22:00, unblock at 07:00):
If block_time > unblock_time → blocked when: now ≥ block_time OR now < unblock_time
If block_time < unblock_time → blocked when: now ≥ block_time AND now < unblock_time
Configuration
Child
| Parameter | Description | Default |
|---|---|---|
| Label only — does not affect automation logic | Child |
|
| UniFi switch entities for this child's devices (multi-select) | — |
Schedule
| Parameter | Description | Default |
|---|---|---|
| Time at which WiFi is blocked | 21:00:00 |
|
| Time at which WiFi is unblocked | 07:00:00 |
|
| Days on which the schedule applies | All days |
Options (collapsed)
| Parameter | Description | Default |
|---|---|---|
Block immediately when presence goes to not_home |
Off | |
| Person, device_tracker, group, or binary_sensor | Optional | |
| Quick on/off without removing the automation | On |
Setup — Finding UniFi block switches
- Go to Settings → Devices & Services → UniFi Network
- Open the integration and browse the entities
- Look for
switchentities named after your child's devices - Switch ON = device blocked, Switch OFF = device allowed
Usage Tips
- Name each automation after the child — e.g.
📵 WiFi — Emmaand📵 WiFi — Liamso they are easy to identify in the automations list - Multiple devices per child — Select all of a child's devices in one automation; they all block and unblock together
- Different schedules per day — Create two automations per child with different times, each covering different active days (e.g. weekdays vs weekend)
GitHub
Full documentation, troubleshooting, and version history: GitHub Repository
Changelog
- 1.3.0 - Added self-correcting behaviour: startup and automation-reload triggers immediately enforce the correct block/unblock state; fixed midnight-crossing time window logic
- 1.2.0 - Fixed "malformed" error on presence entity — added
default: {}to make the field truly optional - 1.1.0 - Device selector now filtered to UniFi switches only — no more unrelated switches in the list
- 1.0.0 - Initial release