Monitor and control your entire MikroTik network from Home Assistant. This HACS custom integration connects to MikroTik routers, switches and access points running RouterOS v6 or v7 via the RouterOS API — surfacing system health, interface status, PoE monitoring, traffic sensors, wireless client counts, DHCP server monitoring, firewall rule control, network device tracking, firmware updates and more as native Home Assistant entities.
Works with: RB4011, RB5009, hAP ac2, hAP ax3, CRS switches, CCR routers, hEX, and any MikroTik device with the RouterOS API enabled. Tested on RouterOS 7.13 through 7.22.
Vote on upcoming features — WireGuard VPN monitoring, firewall address lists, LTE modem stats, certificate expiry alerts, and more. Tell us what you need.
This is a community-maintained fork of tomaae/homeassistant-mikrotik_router. The original author built an incredible integration that many of us rely on daily. This fork exists to keep things running and ship bug fixes while the upstream repo is quiet. We're happy to contribute fixes back anytime.
librouteros 4.x hotfix — Pin librouteros<4.0 in manifest.json. Version 4.0.1 of librouteros renamed connect()'s login_methods kwarg to login_method, breaking every install that auto-upgraded. Addresses #55 and #56. Proper 4.x migration will ship in a future release.
Wireless client detection fix — Wireless clients on routers with empty WiFi registration tables (e.g. hAP ac2 with the new WiFi package) are now correctly detected via bridge host table lookup. The clients_wireless and clients_wired counters are accurate for these devices.
DHCP server sensors — Two new sensors per DHCP server:
dhcp_server_status— shows "running" or "disabled"dhcp_server_lease_count— real-time count of active DHCP leases- Both include attributes: interface, address-pool, enabled, comment
Documentation — Added comprehensive data store schema (docs/data-schema.md), sensor gap analysis, and community feature poll.
Previous: v2.3.12 — Faster startup, cleanup services
Faster startup — The integration no longer blocks Home Assistant startup by sequentially pinging every tracked host. First-run host availability now uses the ARP table for instant results, with pings starting on the next 10-second tracker cycle. MAC vendor lookups are also parallelised instead of running one-by-one.
Entity cleanup services — Two new service actions available in Developer Tools > Services:
mikrotik_router.cleanup_entities— removes orphaned entities that no longer have backing router data (deleted interfaces, old firewall rules)mikrotik_router.cleanup_stale_hosts— reports or removes stale device tracker entities for away hosts (dry_run mode by default)
Bug fixes:
- Fixed chained comparison bug that could skip firmware v7+ client traffic processing
- Fixed
voluptuous.Optionalincorrectly used as a type hint in API parser - All
datetime.now()calls replaced with timezone-aware equivalents (HA coding standards) get_system_resourcenow properly guarded against disconnected API
Previous: v2.3.11 — Attribute cleanup
Attribute cleanup — Entity attributes now only show information relevant to each port type. Previously, all ethernet ports displayed SFP diagnostics, PoE status, and client tracking fields regardless of hardware capability. Now:
| Attribute type | Before | After |
|---|---|---|
| SFP diagnostics | Shown on all ethernet ports | Only SFP ports |
| Link rate & duplex | Only copper ports | Both copper and SFP ports |
| PoE status | Shown as "N/A" on non-PoE ports | Only PoE-capable ports |
| Client IP/MAC | Shown as "unknown" on all interfaces | Only when a client is connected |
| Wireless metrics | Shown on all tracked devices | Only wireless/CAPsMAN clients |
Mangle fix — Rules differing only by in-interface/out-interface (e.g. MSS clamping for inbound vs outbound PPPoE) were silently removed as duplicates. Interface fields are now included in the rule unique ID.
Previous: v2.3.10 — Device tracker fix
Device tracker fix — ARP entries with "incomplete" status were incorrectly treated as reachable, causing devices to show as "home" when they were actually unreachable. Both "failed" and "incomplete" ARP statuses are now filtered. See ADR-001.
Previous: v2.3.9 — Upstream feature ports
Four upstream feature requests implemented.
| Feature | Detail | Upstream |
|---|---|---|
| Firewall RAW switches | Enable/disable individual /ip/firewall/raw rules. Opt-in via integration options. |
#310 |
| Container monitoring | Monitor status and start/stop MikroTik containers (RouterOS 7.4+). Requires container package. Opt-in via integration options. | #334 |
| DHCP client sensors | WAN IP, gateway, DNS server, DHCP server, lease expiry per DHCP client interface. Always-on. | #321 |
| Script env refresh | Coordinator refreshes immediately after script button press — environment variables update without waiting for next poll. | #298 |
Also includes: cognitive complexity reduction (ADR-007), 461 automated tests, ruff migration, and CI/CD improvements from v2.3.8 dev work.
Previous: v2.3.8 — Bug fixes
The v2.3.6–v2.3.8 releases fix critical bugs and align with HA best practices. Install v2.3.8 — it includes all fixes from v2.3.6 and v2.3.7 plus a patch for log spam introduced in v2.3.6.
| Fix | Version | Detail |
|---|---|---|
| Options flow crash on HA 2025.12+ | v2.3.6 | Config panel now works on modern HA versions (upstream #470, #471) |
Deadlock in run_script() |
v2.3.6 | Lock was never released when script not found — permanently froze the integration |
| Blocking I/O on event loop | v2.3.6 | Switch toggles, button presses, firmware updates no longer freeze the HA UI |
| False "home" device tracking | v2.3.7 | ARP entries with status: failed no longer cause devices to show as home (#17) |
Deprecated DeviceInfo params |
v2.3.6 | Updated to current HA API (name, manufacturer, model) |
| Duplicate entity log spam | v2.3.8 | Fixed "does not generate unique IDs" errors flooding the log every 30s |
v2.3.5 — Python compatibility
| Fix | Detail |
|---|---|
| Python 3.12 compatibility | Replaced deprecated datetime.utcfromtimestamp() with datetime.fromtimestamp(ts, tz=UTC) |
Removed pytz dependency |
Replaced with stdlib datetime.timezone.utc — no behavioural change |
v2.3.4 — Reliability patch
| Fix | Detail |
|---|---|
| Crash on empty accounting query | No longer crashes when /ip/accounting returns no data |
| Firmware version parse | Handles RouterOS versions without a minor segment |
| Host manufacturer lookup | Exception during MAC OUI lookup no longer propagates |
The v2.3.3 release is the first stable release of this community fork. It adds a major new feature and fixes several long-standing bugs reported against the upstream integration.
Monitor Power over Ethernet status and power metrics for each PoE-capable port on your MikroTik switch or router directly in Home Assistant. Enable PoE port sensors under Settings → Devices & Services → Mikrotik Router → Configure.
| Sensor | Description | Hardware |
|---|---|---|
| PoE out status | Port operational state (powered-on, waiting-for-load, overload, etc.) |
All PoE ports |
| PoE out voltage | Output voltage to connected device | Full monitoring hardware (CRS/CSS/hEX PoE) |
| PoE out current | Output current to connected device | Full monitoring hardware (CRS/CSS/hEX PoE) |
| PoE out power | Power consumed by connected device | Full monitoring hardware (CRS/CSS/hEX PoE) |
Voltage, current and power sensors are automatically hidden on passive-PoE hardware that does not report measurements (e.g. hAP ax3 ether1). Only poe-out-status appears on those ports.
| Fix | Detail |
|---|---|
| Error 500 on Configure | Fixed for HA 2025.12+ — OptionsFlow compatibility with the new framework (#464) |
| Integration crash on non-wireless routers | RB4011, RB5009, CCR series no longer fail on startup when wireless package is absent (#433) |
| Wired client count always 0 | ARP/DHCP hosts now correctly marked available — wired client counter works (upstream #468) |
| Wireless client count | Correct client count on hAP ac2 and compatible devices (upstream #421) |
| Temperature sensors ignore Fahrenheit preference | Sensors now respect the HA unit preference (#230) |
| PoE measurement sensors showing 0 on passive PoE ports | Voltage/current/power sensors now hidden when hardware does not report measurements |
| RouterOS 7 WiFi package detection | Supports wifiwave2, wifi, wifi-qcom, wifi-qcom-ac |
Or manually:
- In HACS, add this repo as a custom repository (if not already):
- HACS > Integrations > 3-dot menu > Custom repositories
- URL:
https://github.com/jnctech/homeassistant-mikrotik_router - Category: Integration
- Install Mikrotik Router from HACS
- Restart Home Assistant
If you are currently on tomaae/homeassistant-mikrotik_router and seeing Error 500 on Configure, Internal Server Error, or crashes on startup since updating Home Assistant:
- Remove
tomaae/homeassistant-mikrotik_routerfrom HACS custom repositories - Add
https://github.com/jnctech/homeassistant-mikrotik_routeras a custom repository in HACS - Install Mikrotik Router from HACS and restart Home Assistant
Your existing configuration and entities are preserved — no reconfiguration needed.
- System health — CPU, memory, HDD, temperatures, voltages, fan speeds, PoE-in, UPS, GPS
- Interface monitoring — enable/disable, SFP diagnostics, RX/TX traffic, link status, connected client IP/MAC
- PoE monitoring — per-port status, voltage, current and power for PoE-capable switches and routers
- Firewall control — enable/disable individual NAT, filter, mangle, and RAW rules
- Device tracking — presence detection for wired, wireless, CAPsMAN, and bridged AP clients (hAP ac2, etc.)
- DHCP server monitoring — per-server status and active lease count
- DHCP client sensors — WAN IP, gateway, DNS server, lease expiry per DHCP client interface
- Container management — monitor status and start/stop MikroTik containers (RouterOS 7.4+)
- Client traffic — per-client RX/TX bandwidth via Accounting (v6) or Kid Control (v7)
- Queue management — enable/disable simple queues with bandwidth monitoring
- PPP management — monitor and control PPP secrets and connections
- Kid Control — enable/disable/pause internet schedules
- Firmware updates — check and install RouterOS and RouterBOARD updates from HA
- Scripts — execute RouterOS scripts with immediate environment variable refresh
- Netwatch — probe status tracking
- Entity cleanup — services to remove orphaned entities and stale device trackers
- Multiple devices — monitor several MikroTik routers, switches and APs simultaneously
Coming Soon — Vote Here
| Feature | Status |
|---|---|
| WireGuard VPN tunnel and peer monitoring | Planned — high demand |
| Firewall address list management (toggle entries from HA) | Planned — high demand |
| Interface IP address tracking (WAN IP change detection) | Planned |
| Certificate expiry alerts | Planned |
| LTE modem signal stats (RSSI, RSRP, SINR) | Planned — hardware-specific |
| Wireless client signal strength as standalone sensors | Planned |
| Firewall rule byte/packet counters | Planned |
| Connection tracking stats | Planned |
For the full analysis, see the Sensor Gap Analysis.
Monitor and control status on each MikroTik interface — LAN, WLAN, physical and virtual.
Monitor Power over Ethernet (PoE) status and power metrics for each PoE-capable port on your MikroTik switch or router directly in Home Assistant.
More information about PoE-Out can be found on the MikroTik support page.
PoE-Out sensors are available on MikroTik devices with managed PoE-Out ports, including (but not limited to):
- CRS series managed switches: CRS106, CRS112, CRS210, CRS212, CRS226, CRS317, CRS328, CRS354, CRS310-8G+2S+IN
- CSS series with PoE: CSS106, CSS326, CSS610
- RB series with PoE-Out: RB260, RB2011, RB3011, RB4011, RB5009
- hEX PoE, hEX PoE lite
- Any RouterOS device where
/interface/ethernet/poereturns data
| Tier | Hardware examples | Sensors available |
|---|---|---|
| Full monitoring | CRS series managed switches, CSS series, hEX PoE | Status + voltage + current + power |
| Status only | hAP ax3 ether1 (passive 24 V PoE), some RB series ports | Status only |
On status-only ports the voltage, current and power sensors are automatically hidden because the hardware does not report those measurements. Only poe-out-status will appear.
To confirm your device capability, run in RouterOS terminal:
/interface ethernet poe monitor ether1 once
Enable PoE port sensors in the integration options to add the following diagnostic sensors for each PoE-capable ethernet port:
| Sensor | Description | Example values | Hardware requirement |
|---|---|---|---|
| PoE out status | Current PoE port operational state | powered-on, waiting-for-load, short-circuit, overload, voltage-too-low, off |
All PoE ports |
| PoE out voltage | Output voltage to the connected device | 48.0 V | Full monitoring only |
| PoE out current | Output current to the connected device | 120 mA | Full monitoring only |
| PoE out power | Power consumed by the connected device | 5.76 W | Full monitoring only |
Note: PoE port sensors are opt-in. Enable them under Settings → Devices & Services → Mikrotik Router → Configure → PoE port sensors. Voltage, current and power sensors are automatically hidden on hardware that does not report those measurements. Implements upstream feature request #259.
For MikroTik devices powered via PoE, the following sensors appear automatically under the System device when the hardware reports them — no opt-in required:
| Sensor | Description |
|---|---|
| PoE in voltage | Input voltage supplied to the device via PoE |
| PoE in current | Input current supplied to the device via PoE |
Example devices with PoE-In:
- CRS310-8G+2S+IN — management port accepts 802.3af/at (standard PoE) and passive PoE 18–57 V DC
PoE-In sensors only appear if your device exposes these values via /system/health. Not all PoE-powered devices support this command (e.g. hAP ac2 returns bad command name health). Verify with /system health print in RouterOS terminal.
Monitor and control individual NAT rules.
More information about NAT rules can be found on Mikrotik support page.
Monitor and control individual Mangle rules.
More information about Mangle rules can be found on Mikrotik support page.
Enable/disable individual firewall RAW rules — the same control you have for NAT, Mangle and Filter, now extended to /ip/firewall/raw. Dynamic and jump rules are automatically excluded. Each rule exposes chain, action, protocol, src/dst addresses and ports as attributes.
Enable Firewall RAW switches in the integration options.
More information about RAW rules can be found on the MikroTik support page.
Implements upstream feature request #310.
Monitor and control MikroTik containers (RouterOS 7.4+). Each container appears as:
- Status sensor — shows
running,stopped, orerrorwith attributes (image tag, OS, arch, interface, root-dir, mounts, DNS, cmd, entrypoint) - Start/stop switch — toggle containers on and off, usable in automations
The container package must be installed and enabled on your router. Enable Container sensors and switches in the integration options.
More information about containers can be found on the MikroTik support page.
Implements upstream feature request #334.
Monitor DHCP client status on each interface (typically WAN). Two sensors per DHCP client interface:
- DHCP status —
bound,searching,stopped, etc. - DHCP address — the current IP address assigned by the ISP/upstream
Each sensor exposes gateway, DNS server, DHCP server address, lease expiry (expires-after), and comment as attributes. Useful for WAN IP change detection, multi-WAN failover awareness, and ISP DNS drift monitoring.
DHCP client sensors appear automatically for each interface that has a DHCP client configured — no opt-in required.
Implements upstream feature request #321.
Control simple queues.
More information about simple queues can be found on Mikrotik support page.
NOTE: FastTracked packets are not processed by Simple Queues.
Control and monitor PPP users.
Track availability of all network devices. All devices visible to the MikroTik device can be tracked, including LAN connected devices and both Wireless and CAPsMAN clients.
Track netwatch probe status.
Execute MikroTik Router scripts from Home Assistant via automatically created buttons.
After a script executes, all sensor data (including environment variables) is refreshed immediately — no need to wait for the next polling cycle. This makes script → read-environment-variable automations reliable.
Environment variable refresh implements upstream feature request #298.
Monitor and control Kid Control internet schedules.
Monitor per-IP throughput based on MikroTik Accounting (Winbox: IP → Accounting).
Set the threshold to a reasonable value — max is 8192. FastTracked packets are not counted.
More information: MikroTik Accounting.
In RouterOS v7 the Accounting feature is deprecated. Use Kid Control Devices instead (IP → Kid Control → Devices). Requires at least one Kid entry to be defined — a dummy entry works:
/ip kid-control add name=Monitor mon=0s-1d tue=0s-1d wed=0s-1d thu=0s-1d fri=0s-1d sat=0s-1d sun=0s-1d
Monitor your UPS.
Monitor GPS coordinates.
Check and update RouterOS and RouterBOARD firmware directly from Home Assistant.
This integration is distributed using HACS.
Minimum requirements:
- RouterOS v6.43 or v7.1+
- Home Assistant 2024.3.0+
- Create a dedicated Home Assistant user on your MikroTik device with these permissions:
read, write, api, reboot, policy, testreadandapiare mandatory; lower permissions will limit functionality- System health sensors require
writeandreboot(MikroTik limitation)
- For script execution, the script itself needs only
read, write— or check "Don't Require Permissions" - Add the integration: Settings → Devices & Services → Add Integration → Mikrotik Router
Do not confuse "Mikrotik Router" with the built-in Home Assistant "Mikrotik" integration. If you don't see it, clear your browser cache.
- Scan interval — poll frequency in seconds (HA reload required after change)
- Unit of measurement — traffic sensor units: bps, Kbps, Mbps, B/s, KB/s, MB/s
- Show client MAC and IP on interfaces — display connected device info per port
- Track network devices timeout — mark tracked devices away after this period
- Zone for device tracker — assign new tracked devices to a Home Assistant zone
Affected devices: hAP ax2, hAP ax3, Audience, and devices using the newer WiFi package (not the legacy Wireless package).
What's happening: Devices running the newer WiFi package (802.11ax/WiFi 6 hardware) use /interface/wifi API endpoints instead of the legacy /interface/wireless. The sensor.*_wireless_clients_api sensor works correctly on legacy Wireless package devices (confirmed on hAP ac2). Devices on the newer WiFi package may report 0.
Workaround — use Kid Control for device tracking:
- SSH or open a terminal to your MikroTik router
- Create a dummy Kid Control entry:
/ip kid-control add name=Monitor mon=0s-1d tue=0s-1d wed=0s-1d thu=0s-1d fri=0s-1d sat=0s-1d sun=0s-1d
- In integration options, enable "Track network devices"
- Reload the integration
This provides device presence detection and per-client traffic stats regardless of WiFi package version.
Status: Native support for the new WiFi package API is planned (upstream #421).
Affected devices: RB4011, RB5009, CCR1009, CCR1016, CCR1036, CCR2004, CCR2116, and any MikroTik router where the wireless package is absent.
Status: Fixed in v2.3.3. The fix checks which WiFi packages are installed before querying wireless endpoints. (upstream #433)
Affected users: Home Assistant instances configured for imperial/Fahrenheit units.
Status: Fixed in v2.3.3. Temperature sensors now respect HA unit preferences and auto-convert. (upstream #230)
To help with translation, log in to Lokalise with GitHub then join the Mikrotik Router project.
To request a new language, open a Feature request.
Download diagnostics data for investigation:
Add to configuration.yaml:
logger:
default: info
logs:
custom_components.mikrotik_router: debug


















