Group for Device Tracker Devices

Dear all, I would like to create a device group to group my mobile devices together and use the group as a trigger. The devices are presented in the form of device tracker, i.e. device_tracker.xyz. However I tried all categories in the Group but none of it allows me to select my device as entity. Could someone give me an idea how to do this?

Thanks a lot.

Welcome, this is something that will need to be done in yaml and can’t be done via the Ui at present.

You will need a file editor installed, check here:

Then you can create a group in your config.yaml

1 Like

Thank you rossk. Hopefully we can complete this in UI in the future. It would be more user friendly, especially for those with less knowledge on coding like me

3 Likes

Hi there @rossk,

I’ve tried to do that adding this to my configuration.yaml:

device_tracker:
  - platform: group
    name: "Smartphones"
    entities::
      - device_tracker.device1
      - device_tracker.device2
      - device_tracker.device3

When I test the yaml I get the error that config is not valid:

Platform error device_tracker.group - No module named  'homeassistant.components.group.device_tracker'

What am I doing wrong?
thx,
Zavjah

Any ideas folks?

Same error here :confused:

Configure it properly… :upside_down_face:

You have an extra : after entities.

The “Old-Style” groups that work with device tracker entities are configured under the top-level key group not device_tracker:

group:
  smartphones:
    name: "Smartphones"
    entities:
      - device_tracker.device1
      - device_tracker.device2
      - device_tracker.device3

Depending on exactly what you are trying to do, you may also want to take a look at the Composite Device Tracker custom integration.

1 Like

thx @Didgeridrew , i’ll look into this.

I tried to create an old-style group using device_tracker entities, and it seems to be created fine, but I can’t seem to reference it in a card or anything?

I’m not sure how to determine the entity id for it? Should it be
group.my_devicetracker_group_name?

group:                                         #domain
  smartphones:                                 #object_id
    name: "Our Smartphones"
    entities:
      - device_tracker.device1
      - device_tracker.device2
      - device_tracker.device3

An entity_id follows the pattern domain.object_id. In the example above, the entity_id will be group.smartphones.

I actually figured out what I did wrong. I’m using a separate package yaml file to declare my custom resources and I accidentally renamed it from *.yaml to *.json. Operator error. I renamed the file back and everything works as expected. Sorry for bothering you with the dumb mistake on my part :slight_smile:

1 Like