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.