Skip to content

cataseven/Keenetic-Router-Pro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

157 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Keenetic Router Pro - Home Assistant Integration

hacs_badge version

Buy Me a Coffee

An advanced Home Assistant integration for Keenetic routers. Provides mesh network management, VPN control, device tracking, and more.

🌟 Features

📡 Real Time Device Tracking

  • Real-time device status via ICMP Ping. You don't need to wait Keenetic's update time for device tracking. This integration ping the devices you selected in every 3 seconds.
  • Selectable client list
  • 3-seconds update interval
  • Automatic updates on IP address changes

Important

⚠️ If Apple IOS devices are registered with client name including 'apple', 'iphone' or 'ipad' then they will NOT be pinged in every 3 seconds. Instead of this, they will sync with status on Router's interface. This is because they go into Deep Sleep mode and disable wifi connection even they are connected to wifi.

image3

🔗 Mesh Network Management

  • Status of all extenders/repeaters (binary sensors)
  • Separate reboot button for each mesh node
  • CPU, RAM, and uptime information
  • Firmware update notification (update available sensor)
  • Number of connected clients (associations)

🔐 VPN Management

  • Enable/disable WireGuard profiles (switch)
  • OpenVPN, IPsec, L2TP, PPTP support
  • VPN uptime, RX/TX sensors

📶 WiFi Control

  • Enable/disable switch for each SSID
  • Guest WiFi control

🌐 WAN Status

  • Real WAN IP address (PPPoE supported)
  • Connection status sensor
  • Uptime information

👥 Client Management

  • Number of connected / disconnected devices

  • Connection Policy selection (per client)

    • Default, VPN, No VPN, Smart Home, Roblox, etc.
    • Deny (block internet access)
  • Event trigger when a new device connects

🔘 Buttons

  • Router reboot
  • Mesh node reboot (separate for each node)

image4 image5

📦 Installation

Via HACS (Recommended)

  1. HACS > Integrations > ⋮ > Custom repositories
  2. URL: https://github.com/YOUR_USERNAME/keenetic_router_pro
  3. Category: Integration
  4. Search for "Keenetic Router Pro" and install
  5. Restart Home Assistant

Manual Installation

  1. Copy the keenetic_router_pro folder into config/custom_components/
  2. Restart Home Assistant

⚙️ Configuration

1. Web management interface must be enabled on the router

2 🔒Security, Firewall & Port Forwarding

To use this integration securely, it is strongly recommended to configure Firewall rules and Port Forwarding properly on your Keenetic router. This section explains why it matters and how to do it.

3. ⚠️Why Firewall Configuration Is Important

  • Home Assistant communicates with the router via its web management API

  • Exposing router services directly to the internet without restrictions is a security risk

  • Proper firewall rules ensure:

    • Only trusted devices (Home Assistant) can access the router
    • No unintended WAN access to router management services

Think of the firewall as a bouncer with a clipboard. Only invited guests get in.


4.🔌Port Forwarding

How to Configure Port Forwarding

  1. Enable UPnP if it is not
  2. Go to Internet > Port forwarding
  3. Add a new rule:
Setting Value
Service Home Assistant Router API
Protocol TCP
External Port 100
Internal IP Router LAN IP (e.g. 192.168.1.1)
Internal Port 79

image1

🚫 Never expose port 80/443 to WAN without firewall rules


5.🛡️Firewall Rules (Recommended & Safe)

Use Firewall rules to restrict access.

Recommended Firewall Setup

  1. Go to Network Rules > Firewall
  2. Create a new rule for your PPPoE connection:
Option Value
Direction Input
Source Home Assistant IP (e.g. 192.168.1.50)
Destination Router
Service Custom port
Action Allow
  1. Create a second rule:
Option Value
Direction Input
Source Any
Destination Router
Service Custom port
Action Deny

✅ Ensure only Home Assistant can talk to the router API.

image2


1. Add the Integration

Settings > Devices & Services > Add Integration > Keenetic Router Pro

2. Connection Details

Field Description Example
Host Router IP address 192.168.1.1
Port Web interface port 100
Username Admin username admin
Password Admin password ********

3. Select Devices for Tracking and Other Device based managements

During setup, you can choose which devices should be monitored via ping.


📊 Created Entities

🔔 Events

keenetic_router_pro_new_device

Triggered when a new device connects to the network.

automation:
  - alias: "New Device Notification"
    trigger:
      - platform: event
        event_type: keenetic_router_pro_new_device
    action:
      - service: notify.mobile_app
        data:
          title: "🆕 New Device Connected"
          message: "{{ trigger.event.data.name }} ({{ trigger.event.data.ip }})"

Event Data:

  • mac: MAC address
  • name: Device name
  • ip: IP address
  • hostname: Hostname
  • interface: Connected interface
  • ssid: WiFi SSID (if applicable)


🌍 Language Support

  • 🇬🇧 English
  • 🇹🇷 Turkish
  • 🇷🇺 Russian

🔧 Requirements

  • Home Assistant 2024.1.0 or newer
  • Keenetic router (NDMS 3.x / 4.x / 5.x)
  • Web management interface must be enabled on the router

Tested Models

  • Keenetic Ultra (KN-1810)
  • Keenetic Hopper (KN-3810)
  • Keenetic Buddy 5 (KN-3311)
  • Keenetic Air (KN-1610)

🐛 Troubleshooting

Connection Error

  1. Verify router IP address and port
  2. Verify username and password
  3. Ensure the web interface is enabled on the router

Entities Not Appearing

  1. Restart Home Assistant
  2. Remove and re-add the integration

Ping Not Working

  • Home Assistant must have permission for ICMP ping
  • Docker installations may require network_mode: host

📄 License

MIT License


Buy Me a Coffee

⭐ If you like this project, don’t forget to give it a star!

About

High level Keenetic Router integration for Home Assistant including instant device_tracker mode

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages