Update docs and comments

This commit is contained in:
Ivan Pavlina 2020-04-05 23:15:53 +02:00
parent 03e70e521c
commit ca39617aaf
3 changed files with 13 additions and 2 deletions

View file

@ -18,7 +18,7 @@ Features:
* System sensors (CPU, Memory, HDD) * System sensors (CPU, Memory, HDD)
* Firmware update binary sensor * Firmware update binary sensor
* Switches to run scripts * Switches to run scripts
* RX/TX traffic sensors per hosts from Mikrotik Accounting * RX/TX WAN/LAN traffic sensors per hosts from Mikrotik Accounting feature
# Integration preview # Integration preview
![Tracker and sensors](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/device_tracker.png) ![Tracker and sensors](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/device_tracker.png)
@ -32,6 +32,8 @@ Features:
![NAT switch](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/nat.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) ![Queue switch](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/queue_switch.png)
![Accounting sensor](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/accounting_sensor.png)
# Setup integration # Setup integration
Setup this integration for your Mikrotik device in Home Assistant via `Configuration -> Integrations -> Add -> Mikrotik Router`. 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. You can add this integration several times for different devices.
@ -50,3 +52,12 @@ You can add this integration several times for different devices.
## List of detected devices ## List of detected devices
![Integration options](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/integration_devices.png) ![Integration options](https://raw.githubusercontent.com/tomaae/homeassistant-mikrotik_router/master/docs/assets/images/ui/integration_devices.png)
## 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.
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).

View file

@ -514,7 +514,7 @@ class MikrotikAPI:
# --------------------------- # ---------------------------
# take_accounting_snapshot # take_accounting_snapshot
# Returns float -> seconds period between last run and current run # Returns float -> period in seconds between last and current run
# --------------------------- # ---------------------------
def take_accounting_snapshot(self) -> float: def take_accounting_snapshot(self) -> float:
"""Get accounting data""" """Get accounting data"""

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB