Template - List of all devices connected to specific essid

Tags: #<Tag:0x00007fc3eb13c368>

Hi there –

my goal is to create a template that would list down all the devices in my house that are connected to a specific essid. The objective would be to make sure no unintended devices are connected to my network by just looking at my dashboard.

I’m struggling to execute/write the following logic steps

  • for all devices in domain: device_tracker
  • if essid of devices == TEST
  • print out entity_id of these devices

I’m really struggling to write this script given my very limited experience with scripting in general (let alone Jinja2…)

Appreciate if anyone can help me get started. Thanks much!

This template should help. It generates a comma separated list of all trackers with essid == TEST:

{{ states.device_tracker | selectattr('attributes.essid','eq','TEST') | map(attribute='entity_id') | join(',') }}
1 Like

This is great, thanks! will study the nomenclature to understand how the magic happened. Thanks for your time!

Here’s a handy reference topic:

1 Like