Network Scanner Integration that shows list of devices in your network

You can iterate through the list. I’m not best with Jinja, but I’m sure it can be done.

I modified some other array responses and found a solution. Posting below for anyone else that needs to find a specific MAC or Device

| map(attribute='mac') | select('search', 'xx:xx:xx:xx:xx:xx') 
| list | count }}’’’

If that results in “1”, it’s active, otherwise it’s inactive.
1 Like

Thanks! that was what I was looking for

How/where do I change the scan interval from 15 minute?

Thanks.

How do I change row color of flex table when the device name is ‘Unknown Device’

I tried this:
css:
tbody tr+: “user-select: text”
table+: “border: 0;”
thead th: “background-color: #aaa
tbody tr:
- background-color: |
{% set n = x.name %}
{% if (n == ‘Unknown Device’) %} red
{endif}

I ended up adding a conditional statement to the modify property.

type: custom:flex-table-card
title: Clients
grid_options:
  columns: 24
entities:
  include: sensor.network_scanner
sort_by: x.ip+
columns:
  - name: IP Address
    data: devices
    modify: x.ip
  - name: MAC Address
    data: devices
    modify: x.mac
  - name: Name
    data: devices
    modify: |-
      if (x.name == 'Unknown Device'){
          '<div style="background-color:lightcoral">' + x.name + '</div';}
      else {
      x.name
      }
  - name: Description
    data: devices
    modify: |-
      if (x.type == 'Unknown Device'){
          '<div style="background-color:lightcoral">' + x.type + '</div';}
      else {
      x.type
      }
  - name: Vendor
    data: devices
    modify: x.vendor
css:
  table+: "border: 0;"
  thead th: "background-color: #aaa"
  tbody tr+: "user-select: text"
  tbody tr:hover: "background-color: gold!important;"

Any idea how to add the count of devices as the title for the flex table card configuration?

I haven’t used flex table card.

This is what I have as a collapsable card with total devices at the top, it’s not the prettiest, but with a little work :wink:

HTH

type: custom:collapsable-cards
title: Network Devices
title_card:
  type: tile
  entity: sensor.network_scanner
  vertical: true
  show_entity_picture: false
  buttonStyle: "font-size: 24px;"
  show_header_toggle: true
cards:
  - type: custom:flex-table-card
    title: Clients
    grid_options:
      columns: 24
    entities:
      include: sensor.network_scanner
    sort_by: x.ip+
    columns:
      - name: IP Address
        data: devices
        modify: x.ip
      - name: MAC Address
        data: devices
        modify: x.mac
      - name: Name
        data: devices
        modify: |-
          if (x.name == 'Unknown Device'){
              '<div style="background-color:lightcoral">' + x.name + '</div';}
          else {
          x.name
          }
      - name: Description
        data: devices
        modify: |-
          if (x.type == 'Unknown Device'){
              '<div style="background-color:lightcoral">' + x.type + '</div';}
          else {
          x.type
          }
      - name: Vendor
        data: devices
        modify: x.vendor
    css:
      table+: "border: 0;"
      thead th: "background-color: #aaa"
      tbody tr+: "user-select: text"
      tbody tr:hover: "background-color: gold!important;"
1 Like

This is odd, to me it is. I used the Flex Table card and the coding that is provided here. On my PC screen the table is perfect. From my Cell phone running the HA app I get a "Custom element doesn’t exist: flex-table-card. Why would this happen??

Thanks

Hello , is there a way to increase the number of entries to more than 25 in the flow dialog box ?

after a couple of days it started working on my Pixel Not sure why but it is working now

You can change the number in Developer Tools under States.

To expand upon this card, I modified it a little bit. I did see that TD has a margin left/right so text in div, especially in multiline isn’t centered and there’s a small gap. I changed the div into a span and used the selector on the TD when there’s a span.warning-cell present inside of it.

The colors are also dynamic now so it’ll follow your theme nicely:

type: custom:flex-table-card
title: Clients
grid_options:
  columns: 48
entities:
  include: sensor.network_scanner
sort_by: x.ip+
columns:
  - name: IP Address
    data: devices
    modify: x.ip
  - name: MAC Address
    data: devices
    modify: x.mac
  - name: Name
    data: devices
    modify: |-
      if (x.name == 'Unknown Device'){
          '<span class="warning-cell">' + x.name + '</span>'}
      else {
      x.name
      }
  - name: Description
    data: devices
    modify: |-
      if (x.type == 'Unknown Device'){
          '<span class="warning-cell">' + x.type + '</span>'}
      else {
      x.type
      }
  - name: Vendor
    data: devices
    modify: x.vendor
css:
  tbody tr:hover: "background-color: color-mix(in srgb, var(--primary-color) 80%, transparent);"
  tbody td:has(span.warning-cell): "background-color: var(--warning-color);"
  tbody tr+: "user-select: text"


3 Likes

Very nice! I cannot wait to try this. I had to restore my HAOS and the network scanner has not properly initialized since, so once I get through that, I will try this.

After restoring my HAOS I was able to get this change in the card. It’s awesome! Any idea how to add device count to the same card?

Hello, I have two questions:

I have set up the integration and it scans my devices, but I cant get to the menu in the wizard where I can add aliases for the mac’s. can I get there somehow withour having to reset my integration?

Is it possible to get notifications when new unknown devices connect on lan with this addon somehow?

I found this thread that seems working:

Ok, here's what's happening. If you first set up the integration through the UI and then customized it through configuration.yaml, you'll need to delete the original configuration from the UI.

Then you'll need to click "Add Entry" and it will populate with the full list of configuration.yaml customizations.

I believe the issue is this integration doesn't generate unique IDs for its platform. So you'll get an error in the log:
"Platform network_scanner does not generate unique IDs. ID network_scanner_xxx.xxx.xxx.xxx/24 already exists - ignoring sensor.network_scanner"