Set navigation_path dynamically related to username

Hello there,

I have a typical problem, where I use a tablet and my mobile phone for Home Assistant. In some views of the dashboard, I performed some adjustments, so it will render well on the tablet.

The easiest solution would be, to make a copy of the dashboard and set it to use it only for the tablet and the other dashboard for my mobile phone.

However, not all views need an adjustment and so I thought, that I could adjust the navigation_path dynamically dependent on the user John and the user Tablet.

configuration.yaml

sensors:
  user_navigation_path:
    friendly_name: "User Navigation Path"
      value_template: >-
        {% if states('sensor.current_user') == 'Tablet' %}
          /dashboard-raumplan/a
        {% else %}
          /dashboard-raumplan/b
        {% endif %}

The dashboard:

type: custom:mushroom-vacuum-card
entity: vacuum.valetudo_roborocks55
icon: mdi:robot-vacuum
name: Alfred
icon_animation: true
commands:
  - start_pause
  - stop
  - return_home
tap_action:
  action: navigate
  navigation_path: >-
    [[[ return (states["sensor.user_navigation_path"].state)]]]
layout: horizontal

However, this won’t work. The content of navigation_path is set in double quotes and handles it like text.

it should though, handle it as text. as a string. any template output is a string unless you instruct it not to be.

are you sure the path is correct and complete?

I always add the full path in the system to those, starting from '/config/dashboard/whatever/xyz`

you could probably test easily, by adding the identical template to the name too, so you can actually see what it returns

ofc, the card needs to support those templates on those options. I dont know this card, but did you check the docs if it does?