home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.

Home Page:https://www.home-assistant.io

Github PK Tool:Github PK Tool

Repository from Github https://github.com/home-assistant/coreRepository from Github https://github.com/home-assistant/core

WebSocket API error when trying to call service cast.show_lovelace_view on chromecast device

Pho3niX90 opened this issue · 2 comments

The problem

I am trying to cast lovelace to a device, from nodered, however it fails to cast.

I have tried all of the recommendations on the web, below is my internal/external URLs, which I tried setting in the UI, restarted HA several times. I then tried hardcoding it into the config as well without success.

image

Here is the config window of nodered

What is version of Home Assistant Core has the issue?

core-2021.4.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

No response

Link to integration documentation on our website

No response

Example YAML snippet

{
   "dashboard_path": "lovelace-cast",
   "view_path": "default_view"
}

Anything in the logs that might be useful for us?

Logger: homeassistant.components.websocket_api.http.connection
Source: helpers/network.py:116
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 19:17:41 (14 occurrences)
Last logged: 19:24:11

[139830742086560]
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 143, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1515, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 719, in admin_handler
    await result
  File "/usr/src/homeassistant/homeassistant/components/cast/home_assistant_cast.py", line 44, in handle_show_view
    hass_url = get_url(hass, require_ssl=True, prefer_external=True)
  File "/usr/src/homeassistant/homeassistant/helpers/network.py", line 116, in get_url
    raise NoURLAvailableError
homeassistant.helpers.network.NoURLAvailableError

Just for completeness, this is the error when running the service straight from HA, developer tools, service

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/connection.py:131
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 20:04:13 (1 occurrences)
Last logged: 20:04:13

[139830685552848] Error handling message:
Logger: homeassistant.helpers.script.websocket_api_script
Source: helpers/script.py:1310
First occurred: 20:04:13 (1 occurrences)
Last logged: 20:04:13

websocket_api script: Error executing script. Error for call_service at pos 1:

image

It seems like I did not read the part where the external url has to be https. Solved.