Switch port card

Hi! Just made my first HA component:

It shows the status of your network switch ports (based on SNMP data).
Link: GitHub - partach/hacs_switch_port_card: This Home Assistant card shows the status of your switch ports.
Still developing, but would love feedback, and know if it usefull to ad at some point add to HACS.
Personally i love it :slight_smile:

5 Likes

He he, I did something similar some time ago, but using set of button cards placed within layout card… what a hell of the job, wish you made this card earlier :slight_smile: Here is outcome of my work, perhaps will give you some inspiration to further develop your card:

1 Like

funny thing, was working on that :smiley:


Code is now live with additional explanation how to add these entities.
Thanks for the extra inspiration, it helped!

Btw also have the names of the ports as entities and thinking how to add that in this tight card setup

It’s a start, but the color and the text seems to be showing the same information, so one of them is unneeded.

I have made my own port with a markdown card and what I need is

  • port number
  • name
  • enabled/disabled/error
  • connected/disconnected
  • speed
  • duplex (maybe not so relevant)
  • VLAN

You should be able to find all those information through the SNMP sensors.

The trick is to present the information in a decent way. :slight_smile:

Wally,
Agree that UX is tricky…
Not sure i get all your comments:

  • port number: …it is there above the boxes.
  • name: current version has this, uploaded few hours ago together with hoovering support per port
  • enabled / disabled / error: so other kind of port status, will have to look into that and how far this is/can be vendor specific
  • connected disconnected: Connected is when it is a color, disconnected when it is gray… ? What else do you expect to see?
  • speed: You mean the actual current Rx/Tx per port per few seconds updated? That should be easy enough
  • duplex: Wonder how far that is very much used these days… Would consider that a much lower priority
  • VLAN: VLAN ID per port should also be easy enough to add
    Can start working on a few, which would you say would be your top 3?

BTW you can help me out by installing and giving it a test run to see if the card works for you

It is getting rather cramped… but it is working…


But hoovering is possible over the port for detailed information…

I was not looking at what you had, just what I had myself, so some of them where already handled by your first version.

Regarding speed, then it was the connected speed I referred to, which the color or text in the first one showed.
Actual speed I find not that useful in the button.
The reason for this is that the speed might vary a lot between for example an ESPHome sensor and a NAS, so in order to post meaning numbers, then you would have to change the suffix between Kb, Mb and Gb and then it becomes hard to compare.
The actual speed I have moved to a slider/bar card that shows the current RX and TX values in relation to the actual connected speed.

Following, but I’ll probably wait until a HACS install is available.

Regarding Tx/ Rx it will be what baseoid you couple your entity to and couple that entity to the card. So it can be Total Rx, etc.

Sure, wanted to first have a few testers before putting on hacs… :slight_smile:
Kind of chicken - egg thing. If you test it and is ok, i will make the hacs steps :smiley:

1 Like

You know that speeds of 2.5Gb/s and 5Gb/s also exist and if it is an AP then a whole other range of speeds can come in to play too.
If you want it to be a universal card, then maybe make the speed to color relation user defined.

Following. Would be nice for mij unifi setup

1 Like

True, was struggling a bit myself with this. My switch has 10GB SFP+ ports. I have connected devices with 2.5GB ports to it. However if i query via SNMP it tells me 4.2ish GB…? The current implementation treats this as blue (the switch itself also only has a blue light on the front of it which suggest it sees a kind of 10GBish thing). But definitely something to keep track of and indeed introduce later if possible.

To speed things up for those willing to try it out: i have now attached two yaml files with entity declarations needed. See github link above for what and how.

First phase of HACS compliance is done. PR in progress… I hope… You can already add it via HACS->custom repositories->
Repository: partach/switch_port_card
Type: Dashboard
(had to remove hacs_ in repository name)

It is now live on HACS

1 Like

For those watching this post, i have made an integration for this: