Display how many devices are connected via an integration

I would like to see how many devices are currently connected via the Fritz.Box. Via Settings/Devices & Services/Integrations/Fritz.Box it is already displayed to me that xx devices are connected to xx entities. But how can I display this in my dashboard? “xx devices connected”

Is that number a sensor that is supplied by the integration? If so, just use that in an Entity card.

If it isn’t exposed as a sensor, you should be able to create a template sensor like this:

  - sensor:
      - name: FritzBox Entities
        state: "{{ integration_entities('fritz_box')|count }}"

I’m guessing at the integration title there. Reference document: Templating - Home Assistant

Thank you for your feedback. I tested it like this and it works. However, I get all the “entities” displayed. However, I need how many devices are connected.

You have to be able to see this too.

I don’t have that integration (or a Fritz.box). Can you show me the state and attributes for an entity that is connected please? Screenshot from Developer Tools / States would do.

Here’s a template that shows how many of my Unifi integration entities are connected to a specific AP:

{{ integration_entities('unifi')|map('state_attr','ap_mac')|select('eq','xx:xx:xx:xx:xx:xx')|list|count }}

Hi Andreas,
Can you post your working code as example please?
This sensor is empty for me and I need a working example to get an idea how it is working.