User identification

How easy would it be to associate things (such as devices, or notification channels) with a user?

Can you clarify what you mean by associated? My first thought is using customize and the friendly name attribute but I have a feeling you’re going for something else.

users:

  • name: Lewis
    devices:
    • device_tracker.lewis_phone
    • device_tracker.lewis_tablet
    • device_tracker.lewis_laptop
    • groups.lewis_devices
      notifications:
    • notify.lewis_pushbullet
    • notify.lewis_telegram

This way I could say;

if ‘lewis’ is home then notify him.

Well you can certainly name all the device_trackers using customize or naming in known_devices.yaml.

And the notifications platforms allow for naming conventions, so no problem there.

You could create a template sensor for the three devices to create a sensor that detects the presence and gives a true or false (not sure whether you want to test if ANY of the devices are home or if they are ALL home, but either could be done) for lewis being home. You can call that sensor anything you want within reason.

As far as the notifications, you’d just have it hit both notifications by doing two actions one after the other. Sometimes in a script I’ll have it do a pushbullet, but also a notification screen on my ecobee in case I’m somewhere in the house that I can’t hear the device.

I’m sure there’s a way to group the notifications and send one action but in my opinion it would add complexity and a point of failure when it’s just so easy to fire two actions. Copy and paste the first one and just change the platform.

1 Like

You can certainly group notifications: https://home-assistant.io/components/notify.group/

This topic is quite old, but now that users can be created through the auth component could device trackers be assigned to specific users?

1 Like