Toggle switch and then navigate to another view

I have tried this but I can’t find the right way of doing this
Could anyone point me in the right direction

- type:picture
  image: /local/graa.png
  entity: script.switchmedia #script is working
  tap_action: 
     action: navigate
     navigation_path: "/lovelace/main/"

Try it like this @pbangsoe

- type:picture
  image: /local/graa.png
  entity: script.switchmedia #script is working
  tap_action:
    action: navigate
    navigation_path: "main"

Thank for the reply…@houtknots

The problem is that the script “script.switchmedia” is working on its own and the tap action work on its own.
When I put them together the navigate action works but the script is not running.

What I want to do is simply that, when I tap a button in the ui(lovelace), it will run a script and then navigate to another page.

Maybe someone has an idea for a different approach

Thanks

@pbangsoe

Did you happen to find a solution for this? I am trying to do the same.

@photo64

No unfortunately.

At that time I ran into too many “stops” with Lovelace.
I switched to Tileboard insted.