Automation to trigger when a certain user logs in

Hi,

I am not sure if I am in the correct place, but I would like to create an automation that will trigger when a particular user logs in to Home Assistant.

As an example:
trigger: User Joe Blogg logs in to Home Assistant interface.
action: A notification is sent to push_bullet.

Is this possible? I have had a look around and not quite found how to do it.

installable via HACS.

1 Like

Thanks @nickrout. I was hoping there might be an official way, but a custom is going to be a good solution too :slight_smile:

I hope they have official logging included as the authentication improves.

Thanks again

There may be an event associated with a login, but I couldn’t find it!

1 Like

That was the issue I had as well.
Thanks for finding the custom component :slight_smile:

If anyone does know of an event for login, I’d still be interested in that.

1 Like

did you ever find a solution to this? I’m also looking to trigger stuff when a specific user logs in.

Ya how do you specify just like one particular user?

I suspect what you need to look to trigger on the attribute last_authenticated_time with a condition of the attribute username

Is there something I can add that allows it to send the date and time of the last authenticated state, or whatever other data? Can I just put like %time% or %country% %reigon% %city% to have it send the data of the country region and City it has in states?

Send where?

thanks, but to what entity are you referring? Can’t find any attributes called last_authenticaed_time in HA.

sensor.last_successful_authentication

Has attributes incl username and last_authenticated_time

Can verify this. Make sure to add to config
Sensor:

  • Some other stuff I can’t remember
    Idk it’s on the authenticated page.
    Also Install authenticated from hacs

Broken in HA 2022.4 - all attributes missing. Therefore unfortunately pretty useless :frowning:

Looking for
a) reason
b) alternatives

Hints warmly welcome.

Is this now totally not working for everyone or still working for some?
thanks

Ya seriously this was useful why doesn’t it work now that sucks