[Noob] Switch/Sensor with 3 states? [SNMP]

I finally was able to get ethernet port report from my switch with SNMP.

I have a switch in HA called TPLink Switch Port 2 and a sensor TPLink Switch Port 2 Status. I also have the ability to get the name of the port from SNMP (and I think set it too).

TPLink Switch Port 2 Status
1 = Working/Connected
2 = Nothing connected or TPLink Switch Port 2 off

TPLink Switch Port 2
1 = On/Enabled
2 = Off/Disabled

Visual states I want to accomplish:

  • Easy way to check if something is connected or not (Status=1)
  • Switch next to status
  • Show the custom label retrieved from SNMP
  • Keep in mind that I have 28 ethernet ports XD

In a somewhat perfect world:
image
Put for now I would be pleased with just a entities card showing the right status.

I wish I had the ability to create a single entity with all the states like GPSLogger does, everything at the same place. But… I think I would need a custom integration for that?

I thought about using entities card in pair of 8 until I try to make my own component to display that in a nice way.

UI right now:
image

Port 2 Status
image

Port 2 Switch
image

Current code (I have to start somewhere):

# 1 = Something is connected, 2 = Nothing there or disabled
sensor:
    - platform: snmp
      name: TPLink Switch Port 2 Status
      host: !secret tplink_switch_ip
      auth_protocol: 'hmac-sha'
      username: !secret tplink_switch_snmp_username
      auth_key: !secret tplink_switch_snmp_password
      version: '3'
      baseoid: 1.3.6.1.2.1.2.2.1.8.49154
      accept_errors: true

# 1 = Enabled, 2 = Disabled
switch:
    - platform: snmp
      name: TPLink Switch Port 2
      host: !secret tplink_switch_ip
      auth_protocol: 'hmac-sha'
      username: !secret tplink_switch_snmp_username
      auth_key: !secret tplink_switch_snmp_password
      version: '3'
      baseoid: 1.3.6.1.2.1.2.2.1.7.49154
      payload_on: 1
      payload_off: 2