As has been discussed in forums, a simple Action to open a webpage on the client device would be very useful. I myself, would like to open an Octoprint client in a new tab on the client device.
Sorry if I was not clear. I do not wish to open the webpage within a Lovelace card, I need to open the URL in a new tab on the client. Additionally, the method you show opens the URL on the host machine not the client ( I tried that). I am running a Raspi host and accessing HA and Octoprint from my Mac.
Clicking on the card I created opens a new tab for me on desktop or my browser when used from the official companion app on mobile.
What exactly is the host machine for you? The Pi yourāe running HA on? My HA is running in a VM on Proxmox and I access it from any client by browser with the expected behaviour described above.
I am not sure why we got different results. My HA host is a Raspberry Pi 4. My Octopi host is a Raspberry Pi 3b. I tried using other methods like Tap Action and Service Calls, and one, which I cannot remember, clearly stated that the URL was āNot Foundā so I am sure it was looking on the HA host, not the Octopi host. I am not well-skilled in these areas, so I may not explain things accurately. Perhaps the fact that you are running HA on a VM makes a difference? Although this is only a minor convenience having this feature, I kind of got intrigued with tying to make it work. People like us must solve problems it seems
Ah I think I know the problem that you have. I assume the way I went does open a new tab for you too? If so, you should check the url you enter. It needs to start with http:// or https:// as far as I know. Also, you need to make sure you select āURLā as tap action and not āNavigateā by accident (which would indeed try to navigate within HA).
What card is that?
Yes, I did set the URL to include http:// along with my local IP address for the Octopi Raspi server. I also did select āURLā as the Tap Action.
This is the built in button card.
@anthony420 I tested it with an ip Adress just now to make sure there is no difference. Works as expected for me.
Thanks so much for trying to help. I think this is one of those strange ones. Iām sure at some point it will get sorted out but for me it was a minor convenience and nothing critical so I can certainly live without it.
Anthony
Is it possible to share the yaml config of the card, that gives a clearer view of how you configured it.
The button itself should be the culprit, the config however can be a bit cluncky when a type exists.
just to check, if you copy the url youāve entered in the card and paste it into your adress bar manually, it opens fine?
For reasons I will never understand, the button suddenly does what I want. Up to this point, it opened a new instance of the HA home page. Today, it opens Octoprint. In any case, here is the yaml code:
show_name: true
show_icon: true
type: button
tap_action:
action: url
url_path: http://192.168.2.45/
name: Call Octoprint CR-10
icon: mdi:button-pointer
And yes, the URL was, at all times, working from my browser of course.
thanks for your help,
Anthony
Donāt know how long you are already fighting with itā¦
I sometimes remember myself, after being sure that I have edited something, to give my browser a full refresh of the page maybe something in the cache not rendering well.