PyMonitorMQTT
Network Sensor
This sensor reports network information about interfaces, wireless signal and the amount of network bytes transmitted both up and down.
Warning: interfaces information currently not available for macOS.
Compatibility
- macOS
- Linux
- Windows
Data and Topics
.../network/interfaces/{interface_name}/private_address
basic
Private address of the interface
.../network/interfaces/{interface_name}/signal_strenght
basic
For wireless interfaces, it sends the wireless signal strenght if the interface is connected to a Wireless network [dB or %]
.../network/traffic/bytes_recv
basic
Received bytes amount [Bytes]
.../network/traffic/bytes_sent
basic
Sent bytes amount [Bytes]
Configuration
contents
optional
Dictionary
Here you can pass configuration that will edit the functioning of the entity
exclude_interfaces
optional
List
Put in this list the name of the interfaces you want to exclude from the scan (enable the DEBUG log and run this entity to discover your interfaces name)
rename_interfaces
optional
Dict
Put in this dictionary the name of the interfaces you want to rename as key and the new name as value (enable the DEBUG log and run this entity to discover your interfaces name)
custom_topics
optional
List of String
List of topics to which the sensor will send the data.
If the sensor sends to a single topic, you will have to put one topic in the list.
If the sensor sends to more than one topic, you can register more topics; each topic in the list will be assigned in the same order as topics are added from the single sensor (order that you can check in the each individual sensor file).
If the sensor sends to a single topic, you will have to put one topic in the list.
If the sensor sends to more than one topic, you can register more topics; each topic in the list will be assigned in the same order as topics are added from the single sensor (order that you can check in the each individual sensor file).
formatted_values
optional
default: False
Boolean
If set to True, data will be sent in a more readable way, with the unit of measure and with K, M, G and T sizes.
Topics with the unit of measure in square brackets are those involved with this option
Example
In this example I set different parameters:
- value_format: I personally prefer to read traffic data as MB and not as B so I set the ‘size’ to MB and also without decimals
- discovery: I told that I want values in MB so when the remote Hub receives the data, must know the new unit_of_measurement to work properly and not log data as B
- exclude_interfaces: The ‘lo’ interfaces is the loopback interface and I don’t need information about that, also for the VirtualBox adapter
- rename_interfaces: I use my system in dual-boot with Linux and Windows so my wireless interface has 2 different names. I set the linux wireless adapter name (wlp0s20f3) to the windows adapter name (Wi-Fi) to have a single sensor in my smart-hub
- Network:
discovery:
settings:
- topic: "network/traffic/bytes_recv"
unit_of_measurement: MB
- topic: "network/traffic/bytes_sent"
unit_of_measurement: MB
value_format:
size: MB # for traffic
decimals: 0
contents:
exclude_interfaces:
- lo
- VirtualBox Host-Only Network
rename_interfaces:
wlp0s20f3: Wi-Fi