Home

Awesome

Mikrotik Router

GitHub release (latest by date) hacs_badge Project Stage GitHub all releases

GitHub commits since latest release GitHub commit activity GitHub Workflow Status

Help localize

English Arabic Chinese Czech Dutch French German Greek Hindi Hungarian Icelandic Italian Japanese Korean Latvian Polish Portuguese Russian Slovak Spanish Turkish Vietnamese

Mikrotik Logo

Monitor and control your Mikrotik device from Home Assistant.

Features

Interfaces

Monitor and control status on each Mikrotik interface, both lan and wlan. Both physical and virtual.

Interface Info Interface Switch Interface Sensor

NAT

Monitor and control individual NAT rules.

More information about NAT rules can be found on Mikrotik support page.

NAT switch

Mangle

Monitor and control individual Mangle rules.

More information about Mangle rules can be found on Mikrotik support page.

Mangle switch

Simple Queue

Control simple queues.

More information about simple queues can be found on Mikrotik support page.

NOTE: FastTracked packets are not processed by Simple Queues.

Queue switch

PPP

Control and monitor PPP users.

PPP switch PPP tracker

Host Tracking

Track availability of all network devices. All devices visible to Mikrotik device can be tracked, including: LAN connected devices and both Wireless and CAPsMAN from Mikrotik wireless package.

Host tracker

Netwatch Tracking

Track netwatch status.

Netwatch

Scripts

Execute Mikrotik Router scripts. You can execute scripts by automatically created switches or using services.

Script Switch

Kid Control

Monitor and control Kid Control.

Kid Control Enable Kid Control Pause

Client Traffic

Client Traffic for RouterOS v6

Monitor per-IP throughput tracking based on Mikrotik Accounting.

Feature is present in Winbox IP-Accounting. Make sure that threshold is set to reasonable value to store all connections between user defined scan interval. Max value is 8192 so for piece of mind I recommend setting that value.

More information about Accounting can be found on Mikrotik support page.

NOTE: Accounting does not count in FastTracked packets.

Client Traffic for RouterOS v7+

In RouterOS v7 Accounting feature is deprecated so alternative approach for is to use Kid Control Devices feature (IP - Kid Control - Devices).

This feature requires at least one 'kid' to be defined, after that Mikrotik will dynamically start tracking bandwidth usage of all known devices.

Simple dummy Kid entry can be defined with

/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

Accounting sensor

UPS sensor

Monitor your UPS.

UPS sensor

GPS sensors

Monitor your GPS coordinates.

GPS sensor

Update sensor

Update Mikrotik OS and firmare directly from Home Assistant.

RouterOS update Firmware update

Install integration

This integration is distributed using HACS.

You can find it under "Integrations", named "Mikrotik Router"

Minimum requirements:

Using Mikrotik development branch

If you are using development branch for mikrotik, some features may stop working due to major changes in RouterOS. Use integration master branch instead of latest release to keep up with RouterOS beta adjustments.

Setup integration

  1. Create user for homeassistant on your mikrotik router with following permissions:
    • read, write, api, reboot, policy, test
    • lower permissions are supported, but it will limit functionality (read and api permissions are mandatory).
    • system health sensors won't be available without write permissions. this limitation is on mikrotik side.
  2. If you want to be able to execute scripts on your mikrotik router from HA, script needs to have only following policies:
    • read, write or check "Don't Require Permissions" option
  3. Setup this integration for your Mikrotik device in Home Assistant via Configuration -> Integrations -> Add -> Mikrotik Router. You can add this integration several times for different devices.

NOTES:

Add Integration

Configuration

First options page:

Integration options

Second options page:

Integration sensors

Select sensors you want to use in Home Assistant.

Development

Translation

To help out with the translation you need an account on Lokalise, the easiest way to get one is to click here then select "Log in with GitHub". After you have created your account click here to join Mikrotik Router project on Lokalise.

If you want to add translations for a language that is not listed please open a Feature request.

Diagnostics

Download diagnostics data for investigation:

Diagnostics

Enabling debug

To enable debug for Mikrotik router integration, add following to your configuration.yaml:

logger:
  default: info
  logs:
    custom_components.mikrotik_router: debug