Check logged in user and Save state/scene per user and device

I have a Nest Doorbell and several tablets over the house, they all share the same username but each have their own Area on a shared Dashboard.

Now I started doing a simple automation, when the doorbell is Pressed, i navigate to the View that has the camera for the door, so far so good.

Now, what i want to do is,

  1. Make a Condition for the Automation to only apply to the user “Tablet”, reason being when someone pressed the doorbell i dont want my computer changing View risking loosing data when I´m working on the HA administration. But I haven’t found a way to check the currently logged in User but i figure it should be easy for HA to see that information so maybe I´m missing something basic here.

  2. Before the action to Navigate to the camera view, i need to save the current View for each Device/Tablet, normally i would just create a Scene and store the state of the current Url but I´m not sure how i can do that on a per device basis?

  3. And of course, after a short delay of say 45 seconds, return each Device to the previous View/url. Again, no problem to check my saved Scene state, but per user/device is where I´m stuck.

Surely this shouldent be out of the realm of possibility i thought and maybe someone already had something simular already in place or can point me in the right direction when it comes to,
Checking currently logged in user and Saving a state for each device logged in with a specific username.

In the GUI you can restrict an automation to only run for specific users.
The other option though is to use BrowserMod (install via HACS) which let’s you control specific devices.

Hi Andrew, must have had a brain-freeze but a lightbulb triggered when I read your comment about Automations for specific users, know i had seen that but dident click in the moment i suppose, thanks.

I will have a look at the Integration, seems promising at first glance. Trying to lay off integrations as I´m getting heavy but it might be my only choice.

I think it will probably your only option, because I think the automation system, which is of course backend - only uses the user restriction option to limit automations to a user that has triggered the automation rather than how you would like to use it.

If a user turns on a light from the web interface, you can react to that happening. But you can’t react to someone pressing the doorbell or activating a motion sensor - because those are events that don’t have a user attached to them.

BrowserMod will let you “more info” pop up a camera on the screen of any / all devices with a delay timeout, which will automatically close the popup if it has not been closed, after the timeout.

Reading through the documentation and I hadn’t thought about using a popup but that would save me from storing the Device state to begin with, thanks again.

1 Like