Command_webview only opens home screen

Hi,

I’m trying to use the command_webview in the home assistant developer tools > service dev tool. The app starts correctly but only shows the home screen (or the last screen that I opened).

I would like to open a certain view (which exists) using a path as follows:

service: notify.mobile_app_gsm_ronald
data:
  message: command_webview
  data:
    command: "/lovelace/3"

I’m on 2022.8 and I also tried the below:

service: notify.mobile_app_gsm_ronald
data:
  message: command_webview
  data:
    title: "/lovelace/3"

Anybody knows what I’m doing wrong? I also tried replacing /lovelace/3 with /energy but that didn’t work neither.

1 Like

See here Introduction | Home Assistant Companion Docs

Thanks @nickrout , but this is something different. See the following link: Notification Commands | Home Assistant Companion Docs

In your case, I would still need to open the notification and click on it where in my case this is done automatically (so no interaction required with the device).

I’ve read the docs is the companion app also 3 times so I’m not sure what I’m doing wrong.

Are you sure the URL on that page ends with a 3 and not some other name/ID?

Yes, i copied the URL from my dashboard in chrome.

I am unable to reproduce on my pixel 6 pro, I have a settings screen where I set the ID manually

service: notify.mobile_app_dannys_pixel_6_pro
data:
  message: command_webview
  data:
    command: "/lovelace/settings"
1 Like

I’m running on a pixel 6 on version 2022.8.0-full.

I’ll try to name my views and report back.

1 Like

Sorry for not understanding your problem, and thanks for referring me to those docs. Wonderful.

It works here though.

2 Likes

It works by providing a path for the views. If you don’t give a path and just use the index of the views, it doesn’t work apparently.

Thanks for the support!

2 Likes

FWIW I checked the docs to see if we need to update anything to make it more clear but I do see path mentioned and linked to in several places including for the command specifically :slight_smile:

2 Likes

Hi @dshokouhi , thanks for that - I think it’s a great idea. In my eyes, path has a different meaning here: the path you provide to the command.

I would not have expected that the path needed to be configured in Lovelace as it was always working fine without (my setup is already 7 years old and I only do the bare minimum upgrades for the moment due to lack of time). I’ll see whether I can open a PR to the docs.

1 Like

See my issue is that path is a link that takes you to the variable that needs to be set. In some cases it’s best for users to update the docs with their own experiences as it can be difficult for a dev to account for it all lol.

I think it is pretty clear what is required here, the path to the dashboard or view that you want to open in the companion app, and the example removes any doubts (IMHO of course, some users, particularly no native English speakers, may have different experiences or expectations.)