parvez / network_scanner

This Home Assistant integration provides a network scanner that identifies all devices on your local network. Utilizing the provided IP range and MAC address mappings, it gives each identified device a user-friendly name and manufacturer information.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Req: Ability to import into Flex Table

gridlockjoe opened this issue · comments

Do you know a way I could get this into Flex Table? If the devices could be broken out into individual entities it would be quite easy.

In the context of the flex-table-card for Home Assistant, the prop field in the configuration directly references the attributes of the entity specified in the entities section. I believe the flex-table-card automatically handles the mapping between the entity's attributes and the columns in the table.

type: 'custom:flex-table-card'
title: Devices
entities:
  include: sensor.network_scanner
columns:
  - name: IP Address
    prop: ip
  - name: MAC Address
    prop: mac
  - name: Custom Name
    prop: name
  - name: Custom Description
    prop: type
  - name: Hostname
    prop: hostname
  - name: Vendor
    prop: vendor

Tried this and only one row populates with "undefinedundefinedundefined" in each column, except "Network Scanner" is in the Custom Name column.

I am unable to test it out using it. It might be complex to get the plugin to work with the data. Not sure if someone else could help you with this. I preferred markdown as it gave me pretty good control.

I got it to work!

See my next comment for the code.

type: custom:flex-table-card
title: Devices
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: Custom Name
    data: devices
    modify: x.name
  - name: Custom Description
    data: devices
    modify: x.type
  - name: Hostname
    data: devices
    modify: x.hostname
  - name: Vendor
    data: devices
    modify: x.vendor

awesome! feel free to add a screenshot so could add to documentation!

I tried it as well! pretty cool, thanks!