Improve Google Cast documentation (#17361)

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Erik Montnemery 2021-04-12 09:40:48 +02:00 committed by GitHub
parent 1c3f7cdc95
commit 9f1189325f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 42 deletions

View File

@ -0,0 +1,11 @@
{% capture name %}{{ include.name | default: page.title }}{% endcapture %}
## Options
Options for {{ name }} can be set via the user interface, by taking the following steps:
- Browse to your Home Assistant instance.
- In the sidebar click on _**{% my config icon %}**_.
- From the configuration menu select: _**{% my integrations icon %}**_.
- If multiple instances of {{ name }} are configured, choose the instance you want to configure.
- Click on _**"Options"**_.

View File

@ -13,12 +13,21 @@ ha_codeowners:
ha_zeroconf: true ha_zeroconf: true
--- ---
You can enable the Cast integration by going to the Integrations page inside the configuration panel. {% include integrations/config_flow.md %}
## Setup
Support for mDNS discovery in your local network is mandatory. Make sure that your router has this feature enabled. This is even required if you entered the IP addresses of the Cast devices are manually in the configuration as mentioned below. Support for mDNS discovery in your local network is mandatory. Make sure that your router has this feature enabled. This is even required if you entered the IP addresses of the Cast devices are manually in the configuration as mentioned below.
{% include integrations/option_flow.md %}
{% configuration_basic %}
Known hosts:
description: "A comma-separated list of hostnames or IP-addresses of cast devices, use if mDNS discovery is not working"
Allowed UUIDs:
description: A comma-separated list of UUIDs of Cast devices to add to Home Assistant. **Use only if you don't want to add all available devices.** The device won't be added until discovered through either mDNS or if it's included in the list of known hosts. In order to find the UUID for your device use a mDNS browser or advanced users can use the following Python command (adjust friendly names as required) - `python3 -c "import pychromecast; print(pychromecast.get_listed_chromecasts(friendly_names=['Living Room TV', 'Bedroom TV', 'Office Chromecast']))`. This option is only visible if advanced mode is enabled in your user profile.
Ignore CEC:
description: A comma-separated list of Chromecasts that should ignore CEC data for determining the
active input. [See the upstream documentation for more information.](https://github.com/balloob/pychromecast#ignoring-cec-data). This option is only visible if advanced mode is enabled in your user profile.
{% endconfiguration_basic %}
## Home Assistant Cast ## Home Assistant Cast
Home Assistant has its own Cast application to show the Home Assistant UI on any Chromecast device. You can use it by adding the [Cast entity row](/lovelace/entities/#cast) to your Lovelace UI, or by calling the `cast.show_lovelace_view` service. The service takes the path of a Lovelace view and an entity ID of a Cast device to show the view on. A `path` has to be defined in your Lovelace YAML for each view, as outlined in the [views documentation](/lovelace/views/#path). The `dashboard_path` is the part of the Lovelace UI URL that follows the defined `base_url` Typically "lovelace". The following is a full configuration for a script that starts casting the `downstairs` tab of the `lovelace-cast` path (note that `entity_id` is specified under `data` and not for the service call): Home Assistant has its own Cast application to show the Home Assistant UI on any Chromecast device. You can use it by adding the [Cast entity row](/lovelace/entities/#cast) to your Lovelace UI, or by calling the `cast.show_lovelace_view` service. The service takes the path of a Lovelace view and an entity ID of a Cast device to show the view on. A `path` has to be defined in your Lovelace YAML for each view, as outlined in the [views documentation](/lovelace/views/#path). The `dashboard_path` is the part of the Lovelace UI URL that follows the defined `base_url` Typically "lovelace". The following is a full configuration for a script that starts casting the `downstairs` tab of the `lovelace-cast` path (note that `entity_id` is specified under `data` and not for the service call):
@ -173,46 +182,12 @@ data:
- url: "https://tilos.hu/images/kockalogo.png" - url: "https://tilos.hu/images/kockalogo.png"
``` ```
## Advanced use ## Cast devices and Home Assistant on different subnets
### Manual configuration
By default, any discovered Cast device is added to Home Assistant. This can be restricted by supplying a list of allowed chrome casts.
```yaml
# Example configuration.yaml entry
cast:
media_player:
- uuid: "ae3be716-b011-4b88-a75d-21478f4f0822"
```
{% configuration %}
media_player:
description: A list that contains advanced configuration options.
required: false
type: list
keys:
uuid:
description: UUID of a Cast device to add to Home Assistant. Use only if you don't want to add all available devices. The device won't be added until discovered through mDNS. In order to find the UUID for your device use a mDNS browser or advanced users can use the following Python command (adjust friendly names as required) - `python3 -c "import pychromecast; print(pychromecast.get_listed_chromecasts(friendly_names=['Living Room TV', 'Bedroom TV', 'Office Chromecast']))"`
required: false
type: string
ignore_cec:
description: >
A list of Chromecasts that should ignore CEC data for determining the
active input. [See the upstream documentation for more information.](https://github.com/balloob/pychromecast#ignoring-cec-data)
required: false
type: list
{% endconfiguration %}
### Docker and Cast devices and Home Assistant on different subnets
Cast devices can only be discovered and connected to if they are on the same subnet as Home Assistant.
When running Home Assistant Core in a [Docker container](/docs/installation/docker/), the command line option `--net=host` or the compose file equivalent `network_mode: host` must be used to put it on the host's network, otherwise the Home Assistant Core will not be able to connect to any Cast device.
Cast devices can only be automatically discovered if they are on the same subnet as Home Assistant.
Setups with cast devices on a different subnet than Home Assistant are not recommended and not supported. Setups with cast devices on a different subnet than Home Assistant are not recommended and not supported.
If this is not possible, it's necessary to either enable mDNS forwarding between the subnets or to provide a list of known hosts.
If this is not possible, it's necessary to: ### Home Assistant Container
- Enable mDNS forwarding between the subnets. When running the [Home Assistant Container](/installation/linux#install-home-assistant-container) in Docker, make sure it is running with host network mode. Running without it is not supported by the Home Assistant project, and will cause this integration to be unable to discover to your Cast devices.
- Enable source NAT to make requests from Home Assistant to the Chromecast appear to come from the same subnet as the Chromecast.