Automatically creates Wake-on-LAN switches for all devices discovered by the UniFi integration in Home Assistant.
- 🔄 Automatic Discovery: Creates WoL switches for all UniFi devices with MAC addresses
- 🏷️ Name Sync: Updates switch names when you rename devices in UniFi
- 🧹 Auto Cleanup: Removes switches for devices no longer in UniFi
- 📱 Real-time Monitoring: Shows device online/offline status based on UniFi presence
- 🎯 No Duplicates: One switch per MAC address, regardless of name changes
- Home Assistant with the UniFi integration configured
- UniFi devices with Wake-on-LAN capability enabled in BIOS/OS
- Devices must be connected via Ethernet (Wi-Fi WoL is unreliable)
- Ensure HACS is installed
- Go to HACS → Integrations
- Click the three dots in the top right → Custom repositories
- Add this repository URL with category "Integration"
- Find "UniFi Auto Wake-on-LAN" and click Install
- Restart Home Assistant
- Download the
custom_components/unifi_auto_wolfolder - Copy it to your
config/custom_components/directory - Restart Home Assistant
- Go to Settings → Devices & Services
- Click "Add Integration"
- Search for "UniFi Auto Wake-on-LAN"
- Click to add it
The integration will automatically:
- Scan for existing UniFi devices
- Create WoL switches for devices with MAC addresses
- Monitor for new devices and name changes
- Use the switch in the UI:
switch.wol_device_name - Call the service:
switch.turn_onwith entityswitch.wol_device_name - In automations:
service: switch.turn_on
target:
entity_id: switch.wol_my_computer- On: Device is connected to UniFi (online)
- Off: Device is not connected to UniFi (offline/sleeping)
- Open Device Manager
- Find your network adapter → Properties
- Power Management tab
- Enable "Allow this device to wake the computer"
- Enable "Only allow a magic packet to wake the computer"
- Boot into BIOS/UEFI settings
- Look for "Wake on LAN", "WOL", or "Power on by PCI-E"
- Enable the setting
- Save and exit
sudo ethtool -s eth0 wol g- Verify UniFi integration is working
- Check that device has a MAC address in device tracker attributes
- Check logs for errors:
grep unifi_auto_wol home-assistant.log
- Ensure device has WoL enabled in BIOS and OS
- Use Ethernet connection (Wi-Fi WoL is unreliable)
- Check if device is on same network segment
- Test manually:
wakeonlan AA:BB:CC:DD:EE:FF
- Integration updates names automatically when UniFi device names change
- Restart integration if names seem stuck
- Check entity registry for conflicts
automation:
- alias: "Wake Computer When I Get Home"
trigger:
- platform: state
entity_id: person.me
to: "home"
action:
- service: switch.turn_on
target:
entity_id: switch.wol_my_computerscript:
wake_all_computers:
alias: "Wake All Computers"
sequence:
- service: switch.turn_on
target:
entity_id:
- switch.wol_desktop
- switch.wol_server
- switch.wol_laptopIssues and pull requests are welcome! Please check existing issues before creating new ones.
This project is licensed under the MIT License - see the LICENSE file for details.