Button navigate path not working

Hello,

I am trying to create a button which navigates to another dashboard using the following code:

type: button tap_action: action: navigate navigation_path: /test name: test

However, when i submit this code it just redirects the button to the default dashboard?

Hi and welcome to the forum.

Your card config can’t all be on one line like that.

Indentation is important in YAML.

Hello,

Thankyou for your quick response! The code is not written in one line like that i wrote it down in a bit of a rush. The code I copied was in ‘show code editor’. I have since tried to format my SD card and flash home assistant again but for some reason i am still running into the same problem. The other strange thing is that the button was working and correctly navigating to the navigation path for a small period of time but then all of a sudden stopped?

can anyone help with this?
Thanks in advance

You have to use the full path to the dashboard /lovelace-your_dashboard_name/view_path
the lovelace- prefix is what’s missing in the documentation :frowning:

Hello,

Thankyou for your help, i have tried to do this with no luck :frowning: i dont suppose you could kindly write out the full code for the dashboard name test? Would be hugely appreciated, i have been stuck on this issue for hours now :frowning:

I am coding this in the button card configurator not my config yaml, is this where i am going wrong?

This is the code i have at the moment:

type: button
tap_action:
action: navigate
navigation_path: /lovelace/test
entity: ‘’
name: test

Please read point 11 here. If you don’t format your post correctly it is very difficult to help you.

Hello, thank you for highlighting this I’m very sorry. Here is the code in the correct format

type: button
tap_action:
  action: navigate
  navigation_path: /lovelace/test
entity: ''
name: test
1 Like

Try this (as per Riccardo’s advice above):

type: button
tap_action:
  action: navigate
  navigation_path: /lovelace/lovelace-test
entity: ''
name: test
1 Like

Hello,

Thank you for the quick response, i really appreciate all your help too. I have tried that code, still with no luck :frowning: I am going to try and format my sd card and reinstall home assistant again but from a different source, hopefully that will do it.

Hello,

I seem to have fixed it :slight_smile: Thank you for all your help. Here is the code that fixed it:

type: button
tap_action:
  action: navigate
  navigation_path: /lovelace-test
entity: ''
name: test