Core: No longer possible to specify hosts for multiple Google Cast devices

Created on 23 Jun 2018  Â·  21Comments  Â·  Source: home-assistant/core

Home Assistant release with the issue: 0.72.0

Last working Home Assistant release (if known): 0.71.0

Operating environment (Hass.io/Docker/Windows/etc.): Hass.io

Component/platform: https://www.home-assistant.io/components/cast/

Description of problem:

I have discovery disabled as it causes problems on my network and I want to configure two Google Cast devices. I've tried every possible YAML syntax and can't get multiple hosts configured. The platform will just continue to retry.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):
Old configuration:

media_player:
  - platform: cast
    host: Chromecast-LR.home.example.com
  - platform: cast
    host: Chromecast-BR.home.example.com

New configuration (broken):

cast:
  media_player:
    host:
      - Chromecast-BR.home.example.com
      - Chromecast-LR.home.example.com

Working new configuration with only one host:

cast:
  media_player:
    host: Chromecast-BR.home.example.com

Traceback (if applicable):

2018-06-22 23:51:31 WARNING (MainThread) [homeassistant.components.media_player] Platform cast not ready yet. Retrying in 30 seconds. 
2018-06-22 23:52:02 WARNING (MainThread) [homeassistant.components.media_player] Platform cast not ready yet. Retrying in 60 seconds.
2018-06-22 23:53:03 WARNING (MainThread) [homeassistant.components.media_player] Platform cast not ready yet. Retrying in 90 seconds.
…

Additional information:

Likely a regression from #14955

Most helpful comment

after enabled integration

cast:
  media_player:
  - host: 192.168.x.x
2018-06-23 23:35:01 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up platform cast
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/media_player/cast.py", line 205, in async_setup_entry
    async_add_devices, None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/media_player/cast.py", line 214, in _async_setup_platform
    pychromecast.IGNORE_CEC += config.get(CONF_IGNORE_CEC, [])
AttributeError: 'NodeListClass' object has no attribute 'get'

I had to go back to 0.71.. cant test further.. hope someone can debug further.

All 21 comments

You dont have to use discovery. Have you tried this?

Google Cast devices like Android TVs and Chromecasts will be automatically discovered if you enable the discovery component. 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.

It's working fine for me with 4 cast devices and discovery not enabled. I would say it's a progression :)

Yea, I enabled the integration. How are you specifying the hostnames? Are

you sure you’re using the new syntax?

Sent from my phone

If they are discovered through the integration you don't have to specify hostnames. But based on the docs, the media_player key accepts a list so it should be:

cast:
  media_player:
    - host: Chromecast-BR.home.example.com
    - host: Chromecast-LR.home.example.com

I have this and it does not work. no error shown, google device not shown 'dev-state'
I am using hassbian

cast:
  media_player:
  - host: 192.168.x.x
  - host: 192.168.x.x


cast:
  media_player:
  - host: 192.168.x.x

cast:
  media_player:

Neither of them works

Did you enable the integration?

after enabled integration

cast:
  media_player:
  - host: 192.168.x.x
2018-06-23 23:35:01 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up platform cast
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/media_player/cast.py", line 205, in async_setup_entry
    async_add_devices, None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/media_player/cast.py", line 214, in _async_setup_platform
    pychromecast.IGNORE_CEC += config.get(CONF_IGNORE_CEC, [])
AttributeError: 'NodeListClass' object has no attribute 'get'

I had to go back to 0.71.. cant test further.. hope someone can debug further.

Same here... :(

2018-06-23 17:49:23 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up platform cast
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/media_player/cast.py", line 205, in async_setup_entry
    async_add_devices, None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/media_player/cast.py", line 214, in _async_setup_platform
    pychromecast.IGNORE_CEC += config.get(CONF_IGNORE_CEC, [])
AttributeError: 'NodeListClass' object has no attribute 'get'

Having the same issue as well. Went through the integration and still can't specify the IPs of my 4 Google Home/Minis

I have theese devices:

  • 1x Google Home
  • 2x Google Home mini
  • 1x Google Chromecast
  • 1x Google Chromecast Ultra

Same issue here.
Triggering the integration gives me this

2018-06-23 21:22:58 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up platform cast
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/media_player/cast.py", line 205, in async_setup_entry
    async_add_devices, None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/media_player/cast.py", line 214, in _async_setup_platform
    pychromecast.IGNORE_CEC += config.get(CONF_IGNORE_CEC, [])
AttributeError: 'list' object has no attribute 'get'

Listed in UI as:

Google Cast: Google Cast
loaded – added by user

Config:

cast:
  media_player:
  - host: !secret chromecast_living_room_host
  - host: !secret chromecast_master_bedroom_host

General information:

Python 3.5.3
OS: Debian Stretch - Hassbian
Kernel: Linux 4.14.34-v7
Hardware: armv7l GNU/Linux - Raspberry Pi 3

I had the same issue/exception. Once I removed the explicit configuration with "cast" and let the discovery find it, the exception is gone and the chromecast appears on the overview panel.

I cant really understand why you want to specify hosts in config? It is not needed?

I don't want some cast devices in my queue plus it just works great by specifying devices. I also don't use discovery.

I need to specify the host in my config because they are all on a different subnet; discovery doesn't work.

the old configuration is still working :thinking:

media_player:
  - platform: cast
    host: 192.168.1.45
  - platform: cast
    host: 192.168.1.10

For me as well. I'm using that for now, but I'm assuming that functionality will eventually be removed.

same here for a hardcoded config..... but log says it will be depriciated

Opened a PR to fix it.

I'm on 0.72.1 and am still having this issue. This config works:

# Chromecast
media_player:
  - platform: cast
    host: IP1
  - platform: cast
    host: IP2
  - platform: cast
    host: IP3
  - platform: cast
    host: IP4
  - platform: cast
    host: IP5
  - platform: cast
    host: IP6
  - platform: cast
    host: IP7

And this one doesn't:

# Chromecast
cast:
  media_player:
    - host: IP1
    - host: IP2
    - host: IP3
    - host: IP4
    - host: IP5
    - host: IP6
    - host: IP7

Neither does this one:

# Chromecast
cast:
  media_player:
  - host: IP1
  - host: IP2
  - host: IP3
  - host: IP4
  - host: IP5
  - host: IP6
  - host: IP7

There are no errors or anything that looks relevant in the log files:

2018-07-05 11:14:42 INFO (MainThread) [homeassistant.setup] Setting up cast
2018-07-05 11:14:42 INFO (MainThread) [homeassistant.setup] Setup of domain cast took 0.0 seconds.
2018-07-05 11:14:42 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=cast>

And for comparison, the logs from the working config:

2018-07-05 11:16:17 INFO (MainThread) [homeassistant.setup] Setting up cast
2018-07-05 11:16:17 INFO (MainThread) [homeassistant.setup] Setup of domain cast took 0.0 seconds.
2018-07-05 11:16:17 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=cast>
2018-07-05 11:16:17 INFO (MainThread) [homeassistant.components.media_player] Setting up media_player.cast
2018-07-05 11:16:17 INFO (MainThread) [homeassistant.components.media_player] Setting up media_player.cast
2018-07-05 11:16:17 INFO (MainThread) [homeassistant.components.media_player] Setting up media_player.cast
2018-07-05 11:16:17 INFO (MainThread) [homeassistant.components.media_player] Setting up media_player.cast
2018-07-05 11:16:17 INFO (MainThread) [homeassistant.components.media_player] Setting up media_player.cast
2018-07-05 11:16:17 INFO (MainThread) [homeassistant.components.media_player] Setting up media_player.cast
2018-07-05 11:16:17 INFO (MainThread) [homeassistant.components.media_player] Setting up media_player.cast
2018-07-05 11:16:17 WARNING (MainThread) [homeassistant.components.media_player.cast] Setting configuration for Cast via platform is deprecated.
 Configure via Cast component instead.
2018-07-05 11:16:17 WARNING (MainThread) [homeassistant.components.media_player.cast] Setting configuration for Cast via platform is deprecated.
 Configure via Cast component instead.
2018-07-05 11:16:17 WARNING (MainThread) [homeassistant.components.media_player.cast] Setting configuration for Cast via platform is deprecated.
 Configure via Cast component instead.
2018-07-05 11:16:17 WARNING (MainThread) [homeassistant.components.media_player.cast] Setting configuration for Cast via platform is deprecated.
 Configure via Cast component instead.
2018-07-05 11:16:17 WARNING (MainThread) [homeassistant.components.media_player.cast] Setting configuration for Cast via platform is deprecated.
 Configure via Cast component instead.
2018-07-05 11:16:17 WARNING (MainThread) [homeassistant.components.media_player.cast] Setting configuration for Cast via platform is deprecated.
 Configure via Cast component instead.
2018-07-05 11:16:17 WARNING (MainThread) [homeassistant.components.media_player.cast] Setting configuration for Cast via platform is deprecated.
 Configure via Cast component instead.

@kmlucy Did you enable the integration as mentioned in https://github.com/home-assistant/home-assistant/issues/15097#issuecomment-399671736 ? I guess this should probably move to the discussion forums as it works for me.

That fixed it, my bad. Thanks for the help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bdraco picture bdraco  Â·  3Comments

arangates picture arangates  Â·  3Comments

neonandu picture neonandu  Â·  3Comments

coolriku picture coolriku  Â·  3Comments

piitaya picture piitaya  Â·  3Comments