Help with Sensor Template for a device_tracker sensor

Hello,
I´m using this sensor template to show how many devices are connected:

      count_online_device_tracker:
        value_template: >
          {{ states.device_tracker | selectattr('state', 'eq', 'home') | list | count }}

How can i modify this sensor to show me only devices that are online AND connected to the guest network of my Fritzbox?
I think this can be either done by quering the attribute “ip” for the value 192.168.179.* or the attribute “ssid” for the guest-wifi-ssid, but I don´t know how to put that into code (in case it´s possible at all)

Thanks a lot
Philipp

If by ‘show’ you mean a list of Friendly names then:

      count_online_device_tracker:
        value_template: >
          {{ states.device_tracker | selectattr('state', 'eq', 'home') | selectattr("attributes.ssid", 'eq', 'your_ssid') | map(attribute='name') | list | join(', ') }}

Or if you just want the count of devices:

      count_online_device_tracker:
        value_template: >
          {{ states.device_tracker | selectattr('state', 'eq', 'home') | selectattr("attributes.ssid", 'eq', 'your_ssid')| list | count }}

Thank you, works perfect