Can a button on one page trigger the display of a second lovelace page?

Backstory: My Harmony remote finally died, and in lieu of rolling the dice on a used remote/hub combo on ebay, I’m going the “Just let HA do it’s thing” route with a Broadlink RM4 Pro device. Yeah, I know I’ll have to program everything; not a big deal for me.

My question is (And I tried to search for something similar, but came up blank): Can you tell Lovelace to display a new page/tab based upon a button click on a different page?

Example: Harmony has the concept of “activities”, where if you click something like “Watch TV”, it might change the harmony display to a consolidated view of all the different devices included in that activity. I’d kinda like to simulate that in HA/Lovelace by having a page I’d call “Dashboard” with a button that could simulate that old Harmony “activity”, namely turn on the TV, Soundbar, set proper input, dim the lights, etc, then swap Lovelace from the “dashboard” page to a dedicated “remote” page with all the buttons to control the TV, Soundbar, etc.

Is that even possible? Or, am I simply missing something that’s easily done in HA?

Thanks in advance!

As long as the card you are using supports actions, you can assign a navigate action to tap or hold…

Thank you! I’ll experiment with the “navigate” functionality. Ideall, I’d want to click/press the button, have it launch an automation or NodeRed flow, then do the navigation to the other page/tab/view, so I’ll look at a script to see what I can do with that.

It’s possible with custom cards that allow custom actions. AFAIK, a script isn’t going to work since there are no script service calls to perform frontend navigation.

OOF! That kinda sucks. I was hoping to somewhat mimic that instead of having to explicitly navigate to a different tab, just to launch an automation and have those buttons available.

Update: Actually, you CAN do view navigation! I found I can use a custom:button-card component from HACS and have it launch a script, then set window navigation to take me to the appropriate view!

Here’s the config I am using:

type: custom:button-card
name: Watch TV
icon: mdi:television
show_name: true
show_icon: true
tap_action:
  action: custom
  custom: |
    [[[

     hass.callService(
       "script",
       "watch_tv",
       {}
     )
     

     window.history.pushState(null,"","/tablet-main/remote-view");
     window.dispatchEvent(new CustomEvent("location-changed"));
     ]]] 

I found this from a really old thread here after stumbling haphazardly onto it, and it still works like a champ!

When possible, it is customary to include a link to the other thread both for attribution and so that future users can review the source if they try your posted config and it doesn’t work for them.

Yes, I know. Unfortunately, I cleared my browser cache in order to force my browser to re-render some dashboards after adding a HACS component (hui-element) and it also wiped my history, so I couldn’t find the original post I got it from, and can’t find it now. So, I just searched for the actual code for the “tap_action” and found it! It’s this one:

1 Like