Passing logged in user to script

Hi all

I am looking to make an entity available only to select users. Preferably by passing the the username of the current user to a script as as variable. OR if there is another way to do this I am open to suggestions.

Does anyone know of a way to do this?

Thanks
Scott

Compact Custom Header (CCH) can make views available based on the logged in user.

If you’re just looking to modify one card for a user, template-card can do this.

Ah nice. Looks like this might do what I need.

Thanks

I’m bringing this up again because the title is really what I need. I’m making a task tracking app with the tasks displayed in Lovelace.

I need to be able to pass which user pressed a button to a python script.

Right now I have this working by making two separate tabs that look the same ,but call different python scripts. While that works it’s very inefficient making the same page twice with 50+ buttons even when they are templated.

the context attribute passes who pressed what if it’s an offical card.

states.domain.object_id.context.user_id
1 Like

Hi Petro. Ok, I got it, but, I do not know how to solve this. I have a button card, and I want to save to the log who push it. I have:

type: button
tap_action:
action: toggle
entity: switch.sonoff_10007a20b2
show_state: true

Where/how can I add states.domain.object_id.context.user_id??

1 Like