HomeAssistant Netgear Switch Integration
Grabs statistical network data from supported Netgear Switches
http://IP_OF_SWITCH/login.cgi
)http://IP_OF_SWITCH/portStatistics.cgi
) and compared with previous data ("in response time")switch_ip
- IP of the Switchresponse_time_s
- Response time of two requests send to the Switch to calculate the traffic speedport_{port}_receiving
- receiving traffic on {port}
in MB/sport_{port}_total_received
- total received traffic on {port}
in MBport_{port}_total_transferred
- total transferred traffic on {port}
in MBport_{port}_status
- port cable connected/disconnectedport_{port}_connection_speed
- port transmission speed (100M/1000M)Sensor Name | Platform | mapped key from get_switch_infos() |
Unit |
---|---|---|---|
Port {port} Traffic Received | SENSOR | port_{port}_traffic_rx_mbytes |
MB (in response time) |
Port {port} Traffic Transferred | SENSOR | port_{port}_traffic_tx_mbytes |
MB (in response time) |
Port {port} Receiving | SENSOR | port_{port}_speed_rx_mbytes |
MB/s |
Port {port} Transferring | SENSOR | port_{port}_speed_tx_mbytes |
MB/s |
Port {port} IO | SENSOR | port_{port}_speed_io_mbytes |
MB/s |
Port {port} Total Received | SENSOR | port_{port}_sum_rx_mbytes |
MB (since last switch reboot/reset) |
Port {port} Total Transferred | SENSOR | port_{port}_sum_tx_mbytes |
MB (since last switch reboot/reset) |
Port {port} Connection Speed | SENSOR | port_{port}_connection_speed |
MB/s |
Port {port} Status | BINARY_SENSOR | port_{port}_status |
"on"/"off" |
Port {poe_port} POE Power | SWITCH | port_{poe_port}_poe_power_active |
"on"/"off" |
Sensor Name | Platform | mapped key from get_switch_infos() |
Unit |
---|---|---|---|
Switch IO | SENSOR | sum_port_speed_bps_io |
MB/s |
Switch Traffic Received | SENSOR | sum_port_traffic_rx |
MB (in response time) |
Switch Traffic Transferred | SENSOR | sum_port_traffic_tx |
MB (in response time) |
Model | Ports | Firmwares | Bootloader |
---|---|---|---|
GS105E | 5 | ? | |
GS108E | 8 | V1.00.11 | V1.00.03 |
GS105Ev3 | 5 | ? | |
GS108Ev3 | 8 | V2.00.05, V2.06.10, V2.06.17, V2.06.24 | V2.06.01 - V2.06.03 |
GS305EP | 5 | V1.0.1.1 |
Supported firmware languages: GR (German), EN (English)
After adding the integration go to Add Integration and select Netgear GS108e Integration.
Example with ha-sankey-chart
Example with mini-graph-card
type: custom:mini-graph-card
entities:
- entity: sensor.gs108ev3_192_168_178_8_port_1_io
show_points: false
name: QNAP
- entity: sensor.gs108ev3_192_168_178_8_port_2_io
show_points: false
name: P2
- entity: sensor.gs108ev3_192_168_178_8_port_3_io
show_points: false
name: rpi4-001
- entity: sensor.gs108ev3_192_168_178_8_port_4_io
show_points: false
name: Telefon
- entity: sensor.gs108ev3_192_168_178_8_port_5_io
show_points: false
name: Unraid
- entity: sensor.gs108ev3_192_168_178_8_port_6_io
show_points: false
name: Drucker
- entity: sensor.gs108ev3_192_168_178_8_port_7_io
show_points: false
name: Beelink (HA)
- entity: sensor.gs108ev3_192_168_178_8_port_8_io
show_points: false
name: HomeOffice und WLAN
hours_to_show: 0.1
points_per_hour: 1000
name: 192.168.178.8 - GS108Ev3 Büro
line_width: 1
animate: true
requests
and lxml
python3 -m venv test-netgear
cd test-netgear
source bin/activate
pip install lxml requests
Using this VENV go to your local source folder
cd ~/workspace/src/ckw-ha-gs108e/custom_components/ckw_hass_gs108e
python3
ip = '192.168.178.68'
p = 'fyce4gKZemkqjDY'
import gs108e
sw = gs108e.NetgearSwitchConnector(ip, p)
sw.autodetect_model()
sw.get_login_cookie()
data = sw.get_switch_infos()
print(sw.switch_model.MODEL_NAME)
print(data["port_1_sum_rx_mbytes"])
print(data)