/
snmp_bandwidth.yaml
48 lines (43 loc) · 1.47 KB
/
snmp_bandwidth.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
sensor:
- platform: snmp
name: 'USG WAN in'
host: !secret router_ip
baseoid: 1.3.6.1.2.1.31.1.1.1.6.2
community: 'public'
version: '2c'
scan_interval: 10
- platform: snmp
name: snmp_wan_port_speed
host: !secret router_ip
baseoid: 1.3.6.1.2.1.31.1.1.1.15.2
- platform: snmp
name: 'USG WAN out'
host: !secret router_ip
baseoid: 1.3.6.1.2.1.31.1.1.1.10.2
community: 'public'
version: '2c'
scan_interval: 10
- platform: derivative
name: 'USG WAN In Derivative'
source: sensor.usg_wan_in
unit_time: s
unit: B
- platform: derivative
name: 'USG WAN Out Derivative'
source: sensor.usg_wan_out
unit_time: s
unit: B
- platform: template
sensors:
internet_in_mbps:
value_template: "{{ [((states('sensor.usg_wan_in_derivative')|float(none)*8)/1000000)|round(2, default=none),0]|max }}"
unit_of_measurement: 'Mbps'
entity_id: sensor.usg_wan_in_derivative
internet_out_mbps:
value_template: "{{ [((states('sensor.usg_wan_out_derivative')|float(none)*8)/1000000)|round(2, default=none),0]|max }}"
unit_of_measurement: 'Mbps'
entity_id: sensor.usg_wan_out_derivative
wan_port_speed:
friendly_name: 'WAN Port Speed'
value_template: '{{ (( states.sensor.snmp_wan_port_speed.state | float) / 1000000 ) | round(0) }}'
unit_of_measurement: 'Mbps'