How to show network devices with IPs by Fritzbox Tools integration?

Hello!

Is it possible to show devices with their IPs via this integration on a dashboard?

I have this sensor:

- sensor:
    - name: "Network Device Status"
      unique_id: network_device_status
      state: "ok"
      attributes:
        devices: >
          {% set status_list = {} %}
          {% for device in states.device_tracker %}
            {% set _ = status_list.update({device.entity_id: device.state}) %}
          {% endfor %}
          {{ status_list | to_json }}

    - name: "Network Device IPs"
      unique_id: network_device_ips
      state: "ok"
      attributes:
        devices: >
          {% set device_list = [] %}
          {% for device in states.device_tracker if 'ip' in device.attributes %}
            {% set device_list = device_list + [[ device.entity_id, device.attributes.ip ]] %}
          {% endfor %}
          {{ dict(device_list) | to_json }}

I am unable to create a working card code that shows all devices with IPs.

Thanks for sharing your thoughts! :+1:

yes this is possible
I use auto-entities and multiple-entity-row

following code as an example

type: custom:auto-entities
card:
  type: entities
filter:
  include:
    - domain: device_tracker
      options:
        type: custom:multiple-entity-row
        secondary_info:
          attribute: ip
      attributes:
        source_type: router
        ip: 192.168.69.*
1 Like

Thank you so much! :heart:

Would you mind sharing also some ideas how to sort by IP? I tried this but it does not sort by IP:

sort:
  method: attribute
  attribute: ip
  numeric: true

remove numeric. the IP is a string

1 Like

Ah, good to know! :+1: How did you find out? :wink: I should have observed this myself, of course. :face_with_hand_over_mouth:

And I need to add ip: true:

sort:
  method: attribute
  attribute: ip
  numeric: false
  ip: true

just tried it out :slight_smile:
but great that it works

1 Like