Logged in User Variable

I have a basic markdown card that says Morning, Evening etc… but i would like to personalise this with the logged in user name. Is that possible? If so what variable should i use for the current logged in user.

I saw this in the template-entity-row custom component GitHub repository description.

Jinja templates have access to a few special variables. Those are:

config - an object containing the card configuration
user - the username of the currently logged in user
browser - the deviceID of the current browser (see browser_mod).
hash - the hash part of the current URL.

Should be enough to get you started.

Thanks, ive tried adding these to the template editor but i just get errors e.g. {{ user }} or {{ user.name }} etc…

Hi @eximo84

Came across this thread while looking for the same information. Since i really found nearly no information i thought i’ll write it here for the next person.

I made a custom-card which uses the user-object to show the lock only for non-admins:

lock:
  enabled: '[[[ return `${user.is_admin}` == "false" ]]]'
  exemptions: []

The Documentation about the hass/user object is here: https://developers.home-assistant.io/docs/frontend/data/#hassuser

4 Likes