Mikrotik router integration for Home Assistant
Find a file
2020-05-03 15:33:51 +02:00
.github workflow for checking PR conflicts 2020-04-22 18:34:31 +02:00
custom_components/mikrotik_router added download and upload rate attributes for queue switches #40 2020-05-03 15:33:51 +02:00
docs/assets/images added download and upload rate attributes for queue switches #40 2020-05-03 15:33:51 +02:00
tests added config flow test and workflow for tests 2020-04-14 20:57:34 +02:00
.gitattributes initial commit 2019-12-02 01:13:28 +01:00
hacs.json added warning in info.md for versions older then v1.5 2020-04-19 12:22:13 +02:00
info.md added warning in info.md for versions older then v1.5 2020-04-19 12:22:13 +02:00
LICENSE Create LICENSE 2019-12-02 01:24:37 +01:00
Pipfile added config flow test and workflow for tests 2020-04-14 20:57:34 +02:00
README.md added lokalize badge to docs 2020-04-22 08:34:27 +02:00
requirements.txt added workflows 2020-04-12 08:45:50 +02:00
setup.cfg change lib exclude for flake8 2019-12-08 18:13:46 +01:00
sonar-project.properties added workflows 2020-04-12 08:45:50 +02:00

Mikrotik Router

GitHub release (latest by date) hacs_badge Project Stage

GitHub commits since latest release GitHub commit activity

Help localize

English Arabic Czech Dutch French German Greek Hindi Hungarian Italian Polish Portuguese Russian Slovak Spanish

Mikrotik Logo

Monitor and control your Mikrotik device from Home Assistant.

  • Interfaces:
    • Enable/disable interfaces
    • Monitor RX/TX traffic per interface
    • Monitor device presence per interface
    • IP, MAC, Link information per interface for connected devices
  • Enable/disable NAT rule switches
  • Enable/disable Simple Queue switches
  • Mikrotik Accounting traffic sensors per hosts for RX/TX WAN/LAN
  • Device tracker for hosts in network
  • System sensors (CPU, Memory, HDD)
  • Check firmware update
  • Execute scripts using switches or services
  • Configurable update interval
  • Configurable traffic unit (bps, Kbps, Mbps, B/s, KB/s, MB/s)
  • Supports monitoring of multiple mikrotik devices simultaneously

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.

NOTE: dst-port and protocol combination must be unique for each rule. All conflicting NAT rules will not be available in HA.

NAT switch

Simple Queue

Control simple queues.

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

Queue switch

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.

NOTE: Host Tracking is disabled by default and has to be enabled in integration options.

Host tracker

Scripts

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

Script Switch

Accounting

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.

Accounting sensor

Install integration

This integration is distributed using HACS.

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

Setup integration

  1. Create user for homeassistant on your mikrotik router with following permissions:
    • read, write, api, test
  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, test 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.

NOTE: Do not mistake "Mikrotik Router" integration with HA build-in integration named "Mikrotik".

Add Integration

  • "Name of the integration" - Friendly name for this router
  • "Host" - Use hostname or IP
  • "Port" - Leave at 0 for defaults

Configuration

Integration options

  • "Scan interval" - Scan/refresh time in seconds. HA needs to be reloaded for scan interval change to be applied
  • "Unit of measurement" - Traffic sensor measurement (bps, Kbps, Mbps, B/s, KB/s, MB/s)
  • "Show client MAC and IP on interfaces" - Display connected IP and MAC address for devices connected to ports on router
  • "Track network devices" - Enable device tracker
  • "Track network devices timeout" - Tracked devices will be marked as away after timeout (does not apply to Mikrotik wireless and caps-man)

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.

Enabling debug

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

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