Count template sensor help

Hello,
I´m trying to create a sensor that counts the devices in the guest wifi of my fritzbox.
All devices in that wifi gets an IP from the 192.168.179.0 subnet, so I tried to do it this way:

      count_guest_devices:
        value_template: >
          {{ states.device_tracker | selectattr('ip', 'search', '179') | list | count }}  

Should it work that way? I have 2 guest devices online, but the sensor output is 0

Thanks for help
Philipp

I found help in another post, had to add attributes to the attribute:

 {{ states.device_tracker | selectattr('attributes.ip', 'search', '179') | list | count }}