Per user lovelace dashboard, how?

I have created multiple dashboards. I also have created different user (eg. for visitors). As administrator of HA I would like to force user X to dashboard Y and user T to dashboard Z.
Ideally, user X shouldn’t be able to see dashboard Z and vice-versa. If this is not possible then, on login user X should be directed by default to dashboard Y.
Is that doable? If yes, how? I haven’t found any relevant documentation on this aspect. I might have missed it though.
Thanks for any tips!

3 Likes

Configure UI → Select dashboard → edit dashboard name → select visibility → select users.

Easy :wink:

1 Like

Thanks for the quick answer… But :wink: :

  • I am using yaml mode so “Configure UI” is not available. Is that doable in yaml mode ?
  • If I understand correctly this limits access to a particular “view” within a dashboard and not the entire dashboard

Is this what you mean by YAML?

Using the visible variable.

Yes, based on the document, visible is to hide/show tabs.

1 Like

this is the code I see for one of my several dashboards in yaml.

idd. visible is the way, it goes…

  - title: Slaapkamer
    path: slaapkamer
    visible:
      - user: 80b58715f4964b1cba79faa4d3867779
      - user: ed4ff95612bd47359d602d94f38352d0
      - user: b6ac2cdb5d8f48d4b977627d9adc19a8
      - user: 064d87558de042149b5f023b917386d2
    badges: []
    cards:
      - type: vertical-stack
        cards:
          - type: light
            entity: light.slaapkamer_lampje
            icon: mdi:ceiling-light
          - type: light
            entity: light.slaapkamer_paneel
            icon: mdi:dome-light
      - type: vertical-stack
        cards:
          - type: entities
            entities:
              - entity: light.slaapkamer_lampje
                icon: mdi:ceiling-light
              - entity: light.slaapkamer_paneel
                icon: mdi:dome-light
              - entity: switch.sonoff_1000aa2880
                icon: hass:lamp
            title: Slaapkamer
            state_color: true
          - type: gauge
            entity: sensor.fibaro_eye_slaap_air_temperature
            min: 0
            max: 43
            severity:
              green: 20
              yellow: 24
              red: 27
            name: Temperatuur Slaapkamer
          - type: gauge
            entity: sensor.fibaro_eye_slaap_illuminance
            min: 0
            max: 500
            severity:
              green: 100
              yellow: 200
              red: 1000
            name: Lichtintensiteit Slaapkamer
      - type: vertical-stack
        cards:
          - type: media-control
            entity: media_player.mk_nursery

so this ensures, that only users I choose can see the sleeping room dashboard, so the pubertal children can’t play disturbing games with the parents sleeping after hard working days :smiley:

1 Like

Guys, thanks for your answer.
If I get the manual Dashboards and Views - Home Assistant correctly:

Visible
You can specify the visibility of views as a whole or per-user. (Note: This is only for the display of the tabs. The URL path is still accessible)

It limits access to view (also named tabs) on a per user basis. I am looking for a level “above” the entire dashboard shouldn’t be accessible.
This is the part I am missing / looking for.

1 Like

sorry, can’t help with that, as I do not use it that way… :wink:

So basically you want to completely restrict access of specific dashboard pages to certain users. This is not directly possible, but it is indirectly possible. Dashboards are viewable by anyone that is logged in and visits the url. The solution that currently is, will still provide access if one visits the url. It just hides it from the sidebar. However…

You can create users without admin privileges. They won’t be able to access pages like Supervisor, Settings and Add-ons. According to the docs, you can also create Dashboards that are only accessible by admin: require_admin: true - Should this dashboard be only accessible for admin users

However, this means that in order to restrict a dashboard, that user is also restricted from other admin pages (like Supervisor, Settings, Add-ons).

So, yes this works, kinda. You cannot specifically restrict a user to a certain Dashboard. But you can restrict a user to all admin stuff and create admin-only Dashbords.

What you want to do is to also have differences between the non-admins. That is not possible. It only hides it from the sidebar, but using the url any non-admin user can access any non-admin Dashboard. For this you will need to make a feature request.

2 Likes

Thanks for the explanations. I had hoped I missed something obvious. Unfortunately not :frowning:
I’ll do a feature request or wait for the “what the heck” month :wink:

1 Like

Hi, any update on this ? I’m also missing this feature to customize the UI on a per-user basis.
Do you have a link to your feature-request so that I can vote ?

2 Likes

Nope… I have eventually done it on a per client basis which is possible but not as convenient IMHO.

Yes, it’s a pity that the ‘visible’ setting is only available on the views, but not for dashboard or not for cards :frowning:
It would be very handy to have this setting also available on other structures in lovelace so that you can make a finegrained config on a per user basis, it’s a bit clumsy that only the views have this setting.
But do you have a feature-request still open for this ? I was looking through the list but couldn’t find it.

2 Likes

No, I haven’t. I don’t think there has been a new WTH month. Or I missed it…

I am looking for this same thing. I propose that groups be implemented. It would work similarly to how the option for “admin only” can be applied, except that option would be replaced with “Available/Visible to Group” and then you would select which groups could see that dashboard. I suppose having a dropdown with checkboxes for individual users would also work though. I’m a Windows admin so groups is what is familiar, hah.

If I knew how to submit a feature request, I would.

Edit: Well that wasn’t too hard. Thanks Google. Here it is:

5 Likes

1 Select a dashboard on the sidebar
2 Open dashboard menu (3 dots on the right). Select Edit Dashboard
3 Edit view (pencil icon)
4 Click the Visibility tab
5 Select which user should see this view in the navigation.

This way, you can assign the different dashboards a user can see.

This is a method, but not THE method I am looking for.
As admin of HA, I can create X different dashboards. I would like to have a way to map user X to dashboard a, Y to b… Kind of a login page. And user X wouldn’t be able to go to b. All the available solutions for me are unideal ways to accommodate that missing (at least for me) feature.

6 Likes

This doesn’t work for two reasons:

  • The dashboard is still shown in the sidebar, even if all tabs are invisible to a user.
  • It doesn’t work at all for the automatic dashboard, the Energy dashboard, the Logbook, etc.
1 Like

I would also love to see this happen, I wanted to made a dashboard and a new user account for my sister’s kids to track me/Santa until Christmas and now they just keep flashing the lights cause they got access to this panel too. :joy:

This is the solution I use for my family’s companion app dashboards. I use ui minimalist to create my dashboards, I also use kiosk mode to limit the access to the side bar and header for all but me (admin).

Each person has a ‘home’ screen that is visible to only them, which allows them access to (for example) their own light, common lights in the garden etc, they can then navigate via buttons to room views and various other shared resources (local bus times, weather and our shared shopping list) But not heating controls, cameras, networking, and all the other elements I can’t trust them not to mess up!

I do have repetitive code in each of the home screens, but any changes that are common to all users is just a copy and paste exercise to propagate it to everyone.

I then use the UI minimalist back chip on each linked page to take them back ‘home’ I control this home action using the following:

- type: "custom:button-card"
    template: chip_back
    
    variables:
      usernavigation: &usernav |
          [[[
            let home = 'home';
            return user.name + home ;
          ]]]
      ulm_chip_back_path: *usernav

This means that any user ends up navigating to their own home page for example olliehome.yaml, or georgehome.yaml etc. Every common page that is shared by all users has this chip on it.

This obviously doesn’t prevent someone seeing any other pages if they log in and navigate directly to it in a browser, but within the companion app, they are limited. Works well for us.

Maybe this would help others?

5 Likes

Thanks for this idea/solution.

Something I don’t understand, when someone you know let’s say john uses a new phone/laptop/stuff to connect to HA. He uses john as his username, how do you force john to go to directly johnhome.yaml?
If I understand correctly, he arrives on a default page shared by all and as soon as he moves to another page he is “jailed” into johnhome.yaml. Is that it ?

I supported a WTH on the matter. It seems so obvious to me that there is such a requirement to be able, as an admin, to link john to johnhome.yaml without much complication.

2 Likes