2019-12-04 18:47:02 +01:00
# Mikrotik Router
2019-12-02 01:55:25 +01:00

2022-03-03 11:42:50 +01:00
[](https://github.com/hacs/integration)

2022-03-04 14:08:06 +01:00

2019-12-02 01:55:25 +01:00


2022-03-04 14:08:06 +01:00

2019-12-02 01:55:25 +01:00
2020-04-22 08:34:27 +02:00
[](https://app.lokalise.com/public/581188395e9778a6060128.17699416/)
2020-04-19 12:08:45 +02:00


2020-07-10 03:23:32 +02:00

2020-04-19 12:08:45 +02:00







2020-07-10 03:23:32 +02:00

2020-04-19 12:08:45 +02:00

2020-07-10 03:23:32 +02:00


2021-01-15 01:47:22 +01:00

2020-04-19 12:08:45 +02:00





2020-07-10 03:23:32 +02:00


2020-04-19 12:08:45 +02:00
2020-04-18 04:13:04 +02:00

2019-12-02 01:55:25 +01:00
2019-12-04 18:47:02 +01:00
Monitor and control your Mikrotik device from Home Assistant.
2020-04-05 03:38:42 +02:00
* Interfaces:
* Enable/disable interfaces
2021-04-12 15:02:55 +02:00
* SFP status and information
* POE status, control and information
2020-04-05 03:38:42 +02:00
* Monitor RX/TX traffic per interface
* Monitor device presence per interface
2021-01-15 01:38:27 +01:00
* IP, MAC, Link information per an interface for connected devices
2019-12-03 18:31:29 +01:00
* Enable/disable NAT rule switches
2020-03-26 03:43:14 +01:00
* Enable/disable Simple Queue switches
2021-01-15 01:38:27 +01:00
* Enable/disable Mangle switches
2021-04-12 15:02:55 +02:00
* Enable/disable Filter switches
2021-01-15 01:38:27 +01:00
* Monitor and control PPP users
2022-08-16 00:45:58 +02:00
* Monitor UPS
* Monitor GPS coordinates
* Captive Portal
2021-01-15 01:38:27 +01:00
* Kid Control
2022-01-20 12:23:19 +01:00
* Client Traffic RX/TX WAN/LAN monitoring though Accounting or Kid Control Devices (depending on RouterOS FW version)
2020-04-07 04:44:07 +02:00
* Device tracker for hosts in network
2020-05-27 20:04:09 +02:00
* System sensors (CPU, Memory, HDD, Temperature)
2022-08-16 00:45:58 +02:00
* Check and update RouterOS and RouterBOARD firmware
2021-01-15 01:38:27 +01:00
* Execute scripts
* View environment variables
2020-04-05 03:38:42 +02:00
* Configurable update interval
* Configurable traffic unit (bps, Kbps, Mbps, B/s, KB/s, MB/s)
* Supports monitoring of multiple mikrotik devices simultaneously
2020-04-18 03:40:49 +02:00
2022-03-27 04:26:08 +02:00
# Features
2020-04-18 04:13:04 +02:00
## Interfaces
Monitor and control status on each Mikrotik interface, both lan and wlan. Both physical and virtual.
2020-03-26 03:43:14 +01:00



2020-04-18 04:13:04 +02:00
## NAT
Monitor and control individual NAT rules.
2021-01-15 01:38:27 +01:00
More information about NAT rules can be found on [Mikrotik support page ](https://help.mikrotik.com/docs/display/ROS/NAT ).
2020-03-26 03:43:14 +01:00

2020-04-18 04:13:04 +02:00
2021-01-15 01:38:27 +01:00
## Mangle
Monitor and control individual Mangle rules.
More information about Mangle rules can be found on [Mikrotik support page ](https://help.mikrotik.com/docs/display/ROS/Mangle ).

2020-04-18 04:13:04 +02:00
## Simple Queue
Control simple queues.
2021-01-15 01:38:27 +01:00
More information about simple queues can be found on [Mikrotik support page ](https://help.mikrotik.com/docs/display/ROS/Queues#heading-SimpleQueue ).
2020-04-18 04:13:04 +02:00
2020-05-12 01:10:32 +02:00
NOTE: FastTracked packets are not processed by Simple Queues.
2020-03-26 03:43:14 +01:00

2021-01-15 01:38:27 +01:00
2022-03-27 04:28:14 +02:00
## PPP
2021-01-15 01:38:27 +01:00
Control and monitor PPP users.


2020-04-18 04:13:04 +02:00
## 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.
2020-04-07 04:44:07 +02:00

2020-04-18 04:13:04 +02:00
## Scripts
Execute Mikrotik Router scripts.
2020-04-20 11:49:08 +02:00
You can execute scripts by automatically created switches or using services.
2020-04-18 04:13:04 +02:00

2021-01-15 01:38:27 +01:00
## Kid Control
2022-03-27 04:13:20 +02:00
Monitor and control Kid Control.
2021-01-15 01:38:27 +01:00
2022-03-27 04:13:20 +02:00


2021-01-15 01:38:27 +01:00
2022-01-20 12:23:19 +01:00
## Client Traffic
2021-01-15 01:38:27 +01:00
2022-03-27 04:28:14 +02:00
### Client Traffic for RouterOS v6
2020-04-18 04:13:04 +02:00
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 ](https://wiki.mikrotik.com/wiki/Manual:IP/Accounting ).
2020-05-12 01:08:46 +02:00
NOTE: Accounting does not count in FastTracked packets.
2022-01-20 12:23:19 +01:00
2022-03-27 04:28:14 +02:00
### Client Traffic for RouterOS v7+
2022-01-20 21:34:55 +01:00
In RouterOS v7 Accounting feature is deprecated so alternative approach for is to use
2022-01-20 12:23:19 +01:00
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` ``
2020-04-08 20:08:31 +02:00

2020-04-07 04:44:07 +02:00
2022-08-16 00:43:35 +02:00
## UPS sensor
Monitor your UPS.
2022-08-16 00:45:58 +02:00
2022-08-16 00:43:35 +02:00

## GPS sensors
Monitor your GPS coordinates.
2022-08-16 00:45:58 +02:00
2022-08-16 00:43:35 +02:00

## Update sensor
Update Mikrotik OS and firmare directly from Home Assistant.
2022-08-16 00:45:58 +02:00
2022-08-16 00:43:35 +02:00


2020-04-13 12:10:37 +02:00
# Install integration
This integration is distributed using [HACS ](https://hacs.xyz/ ).
You can find it under "Integrations", named "Mikrotik Router"
2020-06-02 21:12:54 +02:00
Minimum requirements:
2022-01-20 21:34:55 +01:00
* RouterOS v6.43/v7.1
2021-01-15 01:43:56 +01:00
* Home Assistant 0.114.0
2020-06-02 21:12:54 +02:00
2021-03-10 00:48:00 +01:00
## 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.
2020-04-18 04:13:04 +02:00
## Setup integration
1. Create user for homeassistant on your mikrotik router with following permissions:
2022-09-05 21:09:15 +02:00
* read, write, api, reboot, policy, test
2022-09-02 23:49:55 +02:00
* 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.
2020-04-18 04:13:04 +02:00
2. If you want to be able to execute scripts on your mikrotik router from HA, script needs to have only following policies:
2022-08-20 01:42:03 +02:00
* read, write
2020-04-10 11:53:09 +02:00
or check "Don't Require Permissions" option
2020-04-18 04:13:04 +02:00
3. Setup this integration for your Mikrotik device in Home Assistant via `Configuration -> Integrations -> Add -> Mikrotik Router` .
2019-12-04 18:47:02 +01:00
You can add this integration several times for different devices.
2019-12-02 01:55:25 +01:00
2021-11-19 18:45:56 +01:00
NOTES:
- Do not mistake "Mikrotik Router" integration with HA build-in integration named "Mikrotik".
- If you dont see "Mikrotik Router" integration, clear your browser cache.
2020-04-13 12:10:37 +02:00
2019-12-02 01:55:25 +01:00

2020-04-08 21:33:49 +02:00
* "Name of the integration" - Friendly name for this router
2019-12-02 01:55:25 +01:00
* "Host" - Use hostname or IP
* "Port" - Leave at 0 for defaults
2020-04-18 04:13:04 +02:00
## Configuration
2021-01-19 18:07:40 +01:00
First options page:
2022-03-27 04:18:55 +02:00
2019-12-02 01:55:25 +01:00

2020-04-18 04:13:04 +02:00
* "Scan interval" - Scan/refresh time in seconds. HA needs to be reloaded for scan interval change to be applied
2020-03-26 03:46:31 +01:00
* "Unit of measurement" - Traffic sensor measurement (bps, Kbps, Mbps, B/s, KB/s, MB/s)
2020-04-18 03:40:49 +02:00
* "Show client MAC and IP on interfaces" - Display connected IP and MAC address for devices connected to ports on router
2020-04-09 23:08:53 +02:00
* "Track network devices timeout" - Tracked devices will be marked as away after timeout (does not apply to Mikrotik wireless and caps-man)
2022-04-16 19:38:00 +02:00
* "Zone for device tracker" - Add new tracked devices to a specified Home Assistant zone
2019-12-02 01:55:25 +01:00
2021-01-19 18:07:40 +01:00
Second options page:
2022-03-27 04:18:55 +02:00
2021-01-15 01:38:27 +01:00

2021-01-15 01:43:56 +01:00
2021-01-19 18:07:40 +01:00
Select sensors you want to use in Home Assistant.
2021-01-15 01:38:27 +01:00
2020-04-18 04:13:04 +02:00
# Development
2020-04-16 00:03:47 +02:00
2020-04-18 04:13:04 +02:00
## Translation
2020-04-16 00:03:47 +02:00
To help out with the translation you need an account on Lokalise, the easiest way to get one is to [click here ](https://lokalise.com/login/ ) then select "Log in with GitHub".
2020-04-18 03:40:49 +02:00
After you have created your account [click here to join Mikrotik Router project on Lokalise ](https://app.lokalise.com/public/581188395e9778a6060128.17699416/ ).
2020-04-16 00:03:47 +02:00
2020-04-18 04:13:04 +02:00
If you want to add translations for a language that is not listed please [open a Feature request ](https://github.com/tomaae/homeassistant-mikrotik_router/issues/new?labels=enhancement&title=%5BLokalise%5D%20Add%20new%20translations%20language ).
2020-04-16 00:03:47 +02:00
2022-03-27 04:24:07 +02:00
## Diagnostics
Download diagnostics data for investigation:

2020-04-18 04:13:04 +02:00
## Enabling debug
2020-04-10 11:01:13 +02:00
To enable debug for Mikrotik router integration, add following to your configuration.yaml:
```
logger:
default: info
logs:
custom_components.mikrotik_router: debug
2020-04-19 03:25:16 +02:00
```