Creation of Button URL

Hello,

i am looking for a solution to create a booton linked with an URL adress.
Can you give me the good ways please,
In lovelaca it’s shouldn’t possible, then i try to creat it in configuration yaml.
please read my code:

type: button
tap_action:
  action: url
  url_path: 'http://192.168.XX.XX/config/motion.cgi?enable=yes'
  entity: motion.camera_salon_on

I have this error :
Setup failed for tap_action: Integration not found.
Setup failed for type: Integration not found.

thanks for your help!

Flex
Try pasting this code into a blank card in the Lovelace UI, not in configuration.yaml. Let me know if you need help with that or it errors…

type: button
tap_action:
  action: url
  url_path: ‘http://192.168.XX.XX/config/motion.cgi?enable=yes’
entity: motion.camera_salon_on
1 Like

thanks you…

now it’s ok with the lovelace UI

type: button
tap_action:
  action: url
  url_path: 'http://192.168.0.XX/config/motion.cgi?enable=yes'
entity_id: motion.camera_salon_on

I have this information :

Visual editor is not supported for this configuration:

Key "entity_id" is not expected or not supported by the visual editor.

You can still edit your config in YAML.

the url open a new tab in firefox, is it possible to do the same operation withou open a new tab.
where i can find how to personnalize the button ? put a picture/name…

thanks you

Please take the time to learn how to format code on the forum. It’s the backtick button on your keyboard. For US keboards, it shares the same key as the tilda ~ button.

1 Like

You can’t add a picture. You can only change the name. That’s covered in the docs.

Great, thanks you. do you have an advise to don’t open a new tab in firefox?

No, it will always open a new window

I’m not sure if this works for that scenario, but you can navigate between Lovelace dashboards/views by using the navigate action instead of url:

tap_action:
  action: navigate
  navigation_path: /my-dashboard/history-graphs

I’m reviving the topic since this is one of the first results when looking up how to properly use a button for URL navigation. Definitely not obvious… as usual haha

2 Likes

Thank you so much was looking for nicer buttons to add a link on my dashbord to open an android app.
All the weblink explanations i found looked terrible.
With this code i was able to build nice buttons in an horizaontal stack.

type: horizontal-stack
cards:
  - show_name: true
    show_icon: true
    type: button
    name: Youtube
    icon: mdi:youtube
    tap_action:
      action: url
      url_path: app://com.google.android.youtube
  - show_name: true
    show_icon: true
    type: button
    name: Amazon Music
    icon: mdi:music
    tap_action:
      action: url
      url_path: app://com.amazon.mp3
  - show_name: true
    show_icon: true
    type: button
    name: Netflix
    icon: mdi:netflix
    color: yellow
    tap_action:
      action: url
      url_path: app://com.netflix.mediaclie

Thanx so muc, some new Icons and its perfect for the Android Wall Tablet in my Kitchen.