Sonos & Cast

This commit is contained in:
Paulus Schoutsen 2018-06-22 11:22:52 -04:00
parent 40d98e0b76
commit 895e74b44b
2 changed files with 56 additions and 57 deletions

View File

@ -12,31 +12,27 @@ ha_category: Media Player
featured: true
ha_release: pre 0.7
ha_iot_class: "Local Polling"
redirect_from: /components/media_player.cast/
---
Google Cast devices like Android TVs and Chromecasts will be automatically discovered if you enable [the discovery component]({{site_root}}/components/discovery/). There is an issue where Chromecasts can only be discovered if your device is connected to the same subnet as your Chromecast.
Google Cast devices like Android TVs and Chromecasts will be automatically discovered if you enable [the discovery component]({{site_root}}/components/discovery/). If you don't have the discovery component enabled, you can enable the Cast component by going to the Integrations page inside the config panel.
## {% linkable_title Advanced use %}
The Cast component has some extra configuration options available for advanced users. You will still need to create a config entry to initialize the Cast component.
For example, Cast devices can only be discovered if they are on the same subnet as Home Assistant. If this is not the case, you want to configure the IP address of the Cast device directly:
The Chromecast platform can also be forced to load by adding the following lines to your `configuration.yaml`:
```yaml
# Example configuration.yaml entry
media_player:
- platform: cast
cast:
media_player:
- host: 192.168.1.10
```
Configuration variables:
- **host** (*Optional*): Use only if you don't want to scan for devices.
- **ignore_cec** (*Optional*) 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)
## {% linkable_title Example %}
By setting `host:` you can specify the Chromecast to use.
```yaml
# Example configuration.yaml entry
media_player:
- platform: cast
host: 192.168.1.10
```

View File

@ -12,48 +12,16 @@ ha_category: Media Player
featured: true
ha_release: 0.7.3
ha_iot_class: "Local Polling"
redirect_from: /components/media_player.sonos/
---
The `sonos` platform allows you to control your [Sonos](http://www.sonos.com) HiFi wireless speakers and audio components from Home Assistant. By default it supports auto-discovery provided by Home Assistant, and you don't need to add anything to your `configuration.yaml`. Alternatively, there are some manual configuration options, listed as follows:
The `sonos` component allows you to control your [Sonos](http://www.sonos.com) HiFi wireless speakers and audio components from Home Assistant. By default it supports auto-discovery provided by Home Assistant, and you don't need to add anything to your `configuration.yaml`.
To add your Sonos components to your installation, add the following to your `configuration.yaml` file. It will perform Sonos auto-discovery of your connected speakers.
If you don't have the discovery component enabled, you can configure the Sonos component by going to the integrations page inside the config panel.
```yaml
# Example configuration.yaml entry using Sonos discovery
media_player:
- platform: sonos
```
## {% linkable_title Services %}
If you have multiple network devices, you can provide the IP address of the device that should be used for Sonos auto-discovery.
```yaml
# Example configuration.yaml entry using Sonos discovery on a specific interface
media_player:
- platform: sonos
interface_addr: 192.0.2.1
```
You can also specify one or more hosts to connect to if they cannot be found with Sonos auto-discovery.
```yaml
# Example configuration.yaml entry with manually specified addresses
media_player:
- platform: sonos
hosts: 192.0.2.25
```
or, for multiple hosts:
```yaml
# Example configuration.yaml entry with manually specified addresses
media_player:
- platform: sonos
hosts:
- 192.0.2.25
- 192.0.2.26
- 192.0.2.27
```
Sonos makes various services available to allow configuring groups. They are currently registered under the media player component.
### {% linkable_title Service `sonos_snapshot` %}
@ -93,7 +61,7 @@ Remove one or more speakers from a group of speakers. If no `entity_id` is provi
### {% linkable_title Service `sonos_set_sleep_timer` %}
Sets a timer that will turn off a speaker by tapering the volume down to 0 after a certain amount of time. Protip: If you set the sleep_time value to 0, then the speaker will immediately start tapering the volume down.
| Service data attribute | Optional | Description |
| ---------------------- | -------- | ----------- |
| `entity_id` | no | String or list of `entity_id`s that will have their timers set. Must be a coordinator speaker.
@ -102,7 +70,7 @@ Sets a timer that will turn off a speaker by tapering the volume down to 0 after
### {% linkable_title Service `sonos_clear_sleep_timer` %}
Clear the sleep timer on a speaker, if one is set.
| Service data attribute | Optional | Description |
| ---------------------- | -------- | ----------- |
| `entity_id` | no | String or list of `entity_id`s that will have their timers cleared. Must be a coordinator speaker.
@ -110,7 +78,7 @@ Clear the sleep timer on a speaker, if one is set.
### {% linkable_title Service `sonos_update_alarm` %}
Update an existing Sonos alarm.
| Service data attribute | Optional | Description |
| ---------------------- | -------- | ----------- |
| `entity_id` | no | String or list of `entity_id`s that will have their timers cleared. Must be a coordinator speaker.
@ -118,16 +86,51 @@ Update an existing Sonos alarm.
| `time` | yes | Time to set the alarm.
| `volume` | yes | Float for volume level.
| `enabled` | yes | Boolean for whether or not to enable this alarm.
| `include_linked_zones` | yes | Boolean that defines if the alarm also plays on grouped players.
| `include_linked_zones` | yes | Boolean that defines if the alarm also plays on grouped players.
### {% linkable_title Service `sonos_set_option` %}
Set Sonos speaker options.
Night Sound and Speech Enhancement modes are only supported on Sonos PLAYBAR and PLAYBASE speakers when playing from the TV source. Other speaker types will ignore these options.
| Service data attribute | Optional | Description |
| ---------------------- | -------- | ----------- |
| `entity_id` | no | String or list of `entity_id`s that will have their options set.
| `night_sound` | yes | Boolean to control Night Sound mode.
| `speech_enhance` | yes | Boolean to control Speech Enhancement mode.
## {% linkable_title Advanced use %}
For advancved uses, there are some manual configuration options available.
If you have multiple network devices, you can provide the IP address of the device that should be used for Sonos auto-discovery.
```yaml
# Example configuration.yaml entry using Sonos discovery on a specific interface
sonos:
media_player:
interface_addr: 192.0.2.1
```
You can also specify one or more hosts to connect to if they cannot be found with Sonos auto-discovery.
```yaml
# Example configuration.yaml entry with manually specified addresses
sonos:
media_player:
hosts: 192.0.2.25
```
or, for multiple hosts:
```yaml
# Example configuration.yaml entry with manually specified addresses
sonos:
media_player:
hosts:
- 192.0.2.25
- 192.0.2.26
- 192.0.2.27
```