This Home Assistant integration shows the status of your switch ports and includes embedded SNMP integration (no need to setup SNMP seperately via configuration files).
Any remarks or questions? Please see our Discussion corner on GitHub
Integration after installation
Live port status per switch with color coding (can be configured in several ways)
IMPORTANT: SNMP requires the right base-oid's for getting the required data. This base oid can be manufacturer dependent and are sometimes hard to find. The integration uses baseoids that you can configure on the fly and has default some standard ones.
integration configuration option after install
- No entities have to be set manually for SNMP!
- Supports multiple hubs (switch instances). You can monitor your whole switch farm from one dashboard
- Indication of
10M,100M,1G,2.5G,5G10G,DOWN - Fully configurable UI to show the information per port as you want it.
- Automatic detection of number of available ports (if standard oid is honored by network Switch)
- Visible vlan tagging (ports show to which VLAN they belong)
- Indication of port name, vlan id, Rx speed, Tx speed, POE power, POE status,
- Cpu load and memory load indication as well as firmware version.
- Custom system OID possibility (monitor your specific need like temperature)
- Custom per port OID (will be 'walked' and information collected per port)
- Compact mode (for smaller dashboards)
- Hover Tooltip per port showing status details per port
- Integration (and card) configuration screen
- Dark / Light Mode
Options:
-
Install via HACS
-
Install manually:
- The integration: In UI go to
HACS-->custom repositories-->Repo: partach/switch_port_card_pro,Type: Integration - Reboot
- The integration: In UI go to
Let the install config of the integration guide you as it asks you network switch IP and SNMP community string (make sure network switch is configured for SNMP).
Use the card: Dashboard --> Edit --> Add Card --> chose in the card list the switch_port_card_pro.
Don't forget to refresh the browser for the card to be visible. Much can be fixed with browser refresh and fixing browser caching...
You need to enable SNMP in your switch. This is different per manufacturer, please follow the switch manual. What is important that you need:
- SNMP option enabled (tricky to find on some switches)
- Define the community string (per default this is named
publicbut you can change for slightly better security). Info is needed by integration during setup - The example uses SNMP Version v2C that you should set both at switch side and during initial integration configuration
- Set target IP trap desitnation (on your network switch) towards your HA IP
- Some switches require different additional details settings (follow manufacturer manual)
The card comes with a configuration dialog that guides the instalation in HA.
| Setting | Result |
|---|---|
| Title | The title shown at the top of the card |
| Device | The entity that represents your switch |
| Fallback Entity | Optional if HA has issues with device recognition. Choose an entity belonging to the integration |
| Total Ports | The total number of ports to shown in the card |
| First SFP Port | At which index is the port an SFP port |
| Bandwidth | The maximum bandwidth the switch can handle (in Gbps) |
| Custom system value text | You can set your own system oid to monitor. This text is shown in the card to represent the retreived value |
| Custom port value text | You can set your own per port oid to monitor. This text is shown in the Hoover text to represent the retreived values |
| Port Size | You can choose how big the port should be shown on the card. Mostly affects text size |
| Ports per Row | You can tweak your card toward the number of ports per row that will be shown |
| Port 2 row display | Choose which value to show in the second row to of the port display (can be none) |
| Port 3 row display | Choose which value to show in the third row to of the port display (can be none) |
| Port color scheme | Choose the dynamic port color scheme |
| Card Background Color | Set any rgba value for the background of the card |
| Show Bandwidth gauge | Toggle to show or not show the bandwidth gauge |
| Show System info | Toggle to show or not show the system info tray |
| Show Port Selection Title | Toggle to show or not show the title for the 2 port sections |
| Hide Unused Ports | If you have ports that are unused in your switch you can disable them showing up in the card |
| Inactive for (>hours) | Tied to hiding ports. Inactive ports keep being shown until after this setting. To ensure temporary inactive ports to show up in the card for the set amount of hours. |
The card has a configuration screen which can be used in stead...
type: custom:switch-port-card-pro
device: sensor.switch_192_168_1_1
name: XGS1935
compact_mode: false
show_total_bandwidth: false
show_live_traffic: true
total_ports: 28
sfp_start_port: 25
show_system_info: true
show_port_type_labels: false
custom_text: Temperature MACSNMP implementations vary a lot sadly. I will try to update with specific examples shared. Per default, if the auto port detection does not work, the configuration will show 8 ports. See picture below how to set the number of ports to the desired amount via the port selection drop down selection list (if auto detect fails).
configuration of the integration
Example uses switch name 'switch 192.168.1.1'. The number 890 is the zyxel manufacturer code (oid's with that number are manufacturer specific)
For the 'port oid's' the integration will walk these oid's (meaning the sw puts .1 for port 1 behind it, etc.)
| Port # | Entity ID Example | Attribute | Description | SNMP OID (or note) |
|---|---|---|---|---|
| – | sensor.switch_192_168_1_1_total_bandwidth |
state |
Total switch bandwidth (Mbps) | Custom aggregate (SW calculates) |
| – | sensor.switch_192_168_1_1_system_cpu |
state |
CPU usage (%) | 1.3.6.1.4.1.890.1.15.3.2.8.0 |
| – | sensor.switch_192_168_1_1_system_memory |
state |
Memory usage (%) | 1.3.6.1.4.1.890.1.15.3.2.5.0 |
| – | sensor.switch_192_168_1_1_firmware |
state |
Firmware text | 1.3.6.1.4.1.890.1.15.3.1.6.0 |
| – | sensor.switch_192_168_1_1_hostname |
state |
The vendor name and type | 1.3.6.1.2.1.1.5.0 |
| – | sensor.switch_192_168_1_1_uptime |
state |
The up time of the switch | 1.3.6.1.2.1.1.3.0 |
| x | sensor.switch_192_168_1_1_port_x_status |
port_name |
Port description / name | 1.3.6.1.2.1.31.1.1.1.18 |
| x | sensor.switch_192_168_1_1_port_x_status |
status |
Link state (up/down) | 1.3.6.1.2.1.2.2.1.8 |
| x | sensor.switch_192_168_1_1_port_x_status |
speed_bps |
Current link speed in bps | 1.3.6.1.2.1.2.2.1.5 (32 bit) 1.3.6.1.2.1.31.1.1.1.15 (64 bit) |
| x | sensor.switch_192_168_1_1_port_x_status |
rx_bps_live |
Real-time RX bandwidth (bps) | Custom calculation / script |
| x | sensor.switch_192_168_1_1_port_x_status |
tx_bps_live |
Real-time TX bandwidth (bps) | Custom calculation / script |
| x | sensor.switch_192_168_1_1_port_x_status |
poe_enabled |
PoE enabled on port | 1.3.6.1.4.1.<vendor>.poe.x |
| x | sensor.switch_192_168_1_1_port_x_status |
vlan_id |
Current VLAN (if supported) | 1.3.6.1.2.1.17.7.1.4.5.1.1 |
See here
See CHANGELOG.md
Report at GitHub Issues
If you like it and find it usefull or want to support this and future developments it would be greatly appreciated :)
