tomaae.homeassistant-mikrot.../README.md

134 lines
8.1 KiB
Markdown
Raw Normal View History

2019-12-04 18:47:02 +01:00
# Mikrotik Router
2019-12-02 01:55:25 +01:00
![GitHub release (latest by date)](https://img.shields.io/github/v/release/tomaae/homeassistant-mikrotik_router?style=plastic)
2019-12-07 15:33:25 +01:00
[![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg?style=plastic)](https://github.com/custom-components/hacs)
2019-12-02 09:52:37 +01:00
![Project Stage](https://img.shields.io/badge/project%20stage-development-yellow.svg?style=plastic)
2019-12-02 01:55:25 +01:00
![GitHub commits since latest release](https://img.shields.io/github/commits-since/tomaae/homeassistant-mikrotik_router/latest?style=plastic)
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/tomaae/homeassistant-mikrotik_router?style=plastic)
![English](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/flags/us.png)
![Arabic](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/flags/eg.png)
![Czech](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/flags/cz.png)
![Dutch](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/flags/nl.png)
![French](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/flags/fr.png)
![German](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/flags/de.png)
![Greek](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/flags/gr.png)
![Hindi](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/flags/in.png)
![Hungarian](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/flags/hu.png)
![Italian](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/flags/it.png)
![Polish](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/flags/pl.png)
![Portuguese](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/flags/pt.png)
![Russian](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/flags/ru.png)
![Slovak](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/flags/sk.png)
![Spanish](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/flags/es.png)
2020-04-18 04:13:04 +02:00
![Mikrotik Logo](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/header.png)
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
* Monitor RX/TX traffic per interface
* Monitor device presence per interface
* IP, MAC, Link information per 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
2020-04-18 03:40:49 +02:00
* Mikrotik Accounting traffic sensors per hosts for RX/TX WAN/LAN
* Device tracker for hosts in network
2019-12-03 03:09:46 +01:00
* System sensors (CPU, Memory, HDD)
2020-04-05 03:38:42 +02:00
* Check firmware update
* Execute scripts
* 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
2020-04-18 04:13:04 +02:00
## Features
## 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
![Interface Info](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/interface.png)
![Interface Switch](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/interface_switch.png)
![Interface Sensor](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/interface_sensor.png)
2020-04-18 04:13:04 +02:00
## NAT
Monitor and control individual NAT rules.
More information about NAT rules can be found on [Mikrotik support page](https://wiki.mikrotik.com/wiki/Manual:IP/Firewall/NAT).
NOTE: dst-port and protocol combination must be unique for each rule. All conflicting NAT rules will not be available in HA.
2020-03-26 03:43:14 +01:00
![NAT switch](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/nat.png)
2020-04-18 04:13:04 +02:00
## Simple Queue
Control simple queues.
More information about simple queues can be found on [Mikrotik support page](https://wiki.mikrotik.com/wiki/Manual:Queue#Simple_Queues).
2020-03-26 03:43:14 +01:00
![Queue switch](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/queue_switch.png)
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.
NOTE: Host Tracking is disabled by default and has to be enabled in integration options.
![Host tracker](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/host_tracker.png)
2020-04-18 04:13:04 +02:00
## Scripts
Execute Mikrotik Router scripts.
![Script Switch](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/script_switch.png)
## 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](https://wiki.mikrotik.com/wiki/Manual:IP/Accounting).
2020-04-08 20:08:31 +02:00
![Accounting sensor](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/accounting_sensor.png)
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-04-18 04:13:04 +02:00
## 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
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
2020-04-13 12:10:37 +02:00
NOTE: Do not mistake "Mikrotik Router" integration with HA build-in integration named "Mikrotik".
2019-12-02 01:55:25 +01:00
![Add Integration](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/setup_integration.png)
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
2019-12-02 01:55:25 +01:00
![Integration options](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/integration_options.png)
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
* "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" - 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)
2019-12-02 01:55:25 +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
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
```