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

79 lines
5 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)
2020-04-05 03:38:42 +02:00
![Tracker and sensors](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.
2019-12-03 18:31:29 +01:00
2019-12-02 01:55:25 +01:00
Features:
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
* 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-05 23:15:53 +02:00
* RX/TX WAN/LAN traffic sensors per hosts from Mikrotik Accounting feature
2020-04-07 10:54:19 +02:00
2020-03-26 03:43:14 +01:00
# Integration preview
![Tracker and sensors](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/device_tracker.png)
![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)
![Script Switch](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/script_switch.png)
![NAT switch](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/nat.png)
![Queue switch](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/queue_switch.png)
![Host tracker](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/host_tracker.png)
2020-04-05 23:15:53 +02:00
![Accounting sensor](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/accounting_sensor.png)
2019-12-04 18:47:02 +01:00
# Setup integration
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.
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)
* "Host" - Use hostname or IP
* "Port" - Leave at 0 for defaults
* "Name of the integration" - Friendy name for this router
* "Unit of measurement" - Traffic sensor measurement (bps, Kbps, Mbps, B/s, KB/s, MB/s)
2020-04-05 23:21:23 +02:00
* "Track accounting" - Determines if integration will track per-host throughput. Accounting must be enabled in Mikrotik first
2019-12-02 01:55:25 +01:00
2019-12-04 18:47:02 +01: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)
* "Show client MAC and IP" - Display connected IP and MAC address for devices connected to ports on router.
* "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)
2019-12-02 01:55:25 +01:00
## List of detected devices
![Integration options](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/integration_devices.png)
2020-04-05 23:15:53 +02:00
## Accounting
For per-IP throughput tracking Mikrotik's accounting feature is used.
[Mikrotik support page](https://wiki.mikrotik.com/wiki/Manual:IP/Accounting)
Before setting up integration in HA, go in Winbox IP-Accounting and setup the feature. Make sure that threshold is set to resonable value to store all connections between user defined scan interval. Max value is 8192 so for piece of mind i recommend setting that value. Web Access is not needed, integration is using API access.
2020-04-05 23:17:36 +02:00
Integration will scan DHCP Lease table and ARP table to generate all known hosts and create two sensors for WAN traffic (mikrotik-XXX-wan-rx and mikrotik-XXX-wan-tx). If the parameter *account-local-traffic* is set in Mikrotik's accounting configuration it will also create two sensors for LAN traffic (mikrotik-XXX-lan-rx and mikrotik-XXX-lan-tx).
2020-04-05 23:18:04 +02:00
2020-04-05 23:17:36 +02:00
Device's name will be determined by first available string this order:
1. DHCP lease comment
2. DNS static entry
3. DHCP hostname
4. Device's IP address