How do I lock a user to a specific dashboard?

Hi @Stevemm

Sorry for my late reply. I do use custom header, but I was told I couldn’t create a custom dashboard and link it to a specific user only? Now I just hide tabs from that second user in custom header.

If you actually are able to do what I originally wanted, I would be quite happy if you could shade your custom header configuration :slight_smile:

Did this get worked out since CCH is now deprecated?

I would like to know as well if this is still possible to do without Custom Header

Me 3. I’d like to give my neighbor access to only our shared garage and front door, but not the rest of the house.

1 Like

You can do it without Custom Header now.

Then just remove the ones you don’t want for that user.

4 Likes

Nice !

In my case, it is not persistent after a logout and then a login. Is it a normal behavior ?

The problem with this is that it’s per device, so your neighbor can always log in on his iPad even if he lets you use his iPhone to do the above.

The best way I’ve found to handle this is adding a visible: section to every view. See the docs.

2 Likes

the link that you shared no longer exists… Will you be able to re-share the link again.

1 Like

Correct, you can’t, to a bunch of my own frustration. What you can do, however is take control of that dashboard and then clear out everything from it. You can then create different tabs (views) that have restricted access. When someone logs in they’ll fall to the first view that they have access to.

1 Like

@tykeal
Please explain further, would like to test this out but do not understand how

So, here’s the process that I used to do something like you’re asking for:

  1. Navigate to Open your Home Assistant instance and show your Lovelace dashboard config. and create a new dashboard and mark it admin only. I called my admin-overview this way I still have an auto-generated everything dashboard, though in my case that’s pretty useless now days because of how many entities I have :joy:
  2. Go to your overview dashboard and press the triple dot menu in the upper right and select edit dashboard. If you have not taken control of this dashboard yet you will be prompted to take control and optionally start with an empty dashboard. NOTE doing this causes the dashboard to stop being auto-generated (which is why we created a new auto-generated board in the previous step, though that could be done later as or skipped)
  3. In your newly taken over dashboard you will only have one view currently, you can add more views by pressing the ‘+’ at the top. In any case, select the edit (pencil) icon next to the current view’s name (default’s to home generally). On the pop up, select the visibility tab. All users that are defined as being allowed to login will by default have access to the view, just turn off the ones you don’t want to have access.
  4. Make edits to your view as needed
  5. Make new views, and make sure that at least one view is accessible by everyone that has login rights because people will always land on the Overview page when they first login from a given device and you want to make sure that they have something to interact with!
5 Likes

I have wallmounted touchscreens that have cameras. They usually stay logged in under the same user etc. is there a card or something that i can enable when i have guests over that will lock the dashboard so people can’t mess with it? I can lock the windows machine sure but is there a way to do this in lovelace?

No full solution but some thought input.

First could be an an input boolean with home_alone and guest_mode and from there on:

Actions - Home Assistant part about confirmation
GitHub - iantrich/restriction-card: 🔒 Apply restrictions to Lovelace cards

This was quite helpful. Taking control of the “Overview” dashboard to make it empty for all users is a good idea.

So, its impossible to lock the access of an user to settings right? They can always un-hide the views they want and access it.
In the pov of a company that´s selling a service to a client, for exemple and block him to screw around the Settings etc…

I have had the same issue and I may have found a solution. Even though you posted this question a long time ago, I still wanted to post my solution for users.

As administrator you can can edit the code of a dashboard.
Go Dashboard - Edit dashboard - Raw configuration Editor

it should look something like this:

title: Titledashboard
views:
  #Tab 1
  - Theme
    Title
    Icon
    visible:
      - user: Some long code like "12b3hjbdbshje77giehrbfbbf4446h"
      - user: #some long code 2
      - user: #some long code 3
  #Tab 2

you can put the same “visible” string under dashboard for the same effect:

title: Titledashboard
visible:
  - user: Some long code like "12b3hjbdbshje77giehrbfbbf4446h"
  - user: #some long code 2
  - user: #some long code 3
views:
  #Tab 1
  #Tab 2

Users not mentioned under “visible” wont be able to see any of views within the dashboard and, as long as they are no administrator, they are not able to change that logging into another device.

4 Likes

Great find @Hotfield

You can do that without going into YAML editing mode. Select the edit option for the dashboard tab in question and you’ll see a visibility option.

1 Like

Yeah true, but the initial question was about locking the whole dashboard, not individual views.

Managing your views will have the same result ofcourse, it only doesn’t hide the dashboard if you want to use different dashboards