question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Google Cast Integration doesn't detect paused state when cast from HA

See original GitHub issue

The problem

HomeAssistant doesn’t detect when something cast to a Google Nest Hub (gen 2) as paused when initiated from Home Assistant.

Replicate:

  • Cast dashboard to screen
  • Media State updates to playing (correct)
  • Swipe away dashboard, still “playing” (should be “paused”)

Expected behavior:

  • Cast youtube/etc to device from phone/etc
  • Media state updates to playing (correct)
  • Swipe content away on screen, media state updates to “paused”, (correct)

Not sure why but when casting from HA, it doesn’t detect paused state (see screenshot) - is this intended behavior? I attached the affected script I’m using, but affects anything else that is relying on state not being “playing” when it’s not.

image

What version of Home Assistant Core has the issue?

core-2022.4.7

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Google Cast

Link to integration documentation on our website

https://www.home-assistant.io/integrations/cast/

Diagnostics information

No response

Example YAML snippet

trigger:
  - platform: state
    entity_id: media_player.nesthub51a4
    to: 'off'
    for: '00:00:20'
  - platform: state
    entity_id: media_player.nesthub51a4
    to: paused
    for: '00:00:20'
  - platform: time_pattern
    minutes: /9
  - platform: time_pattern
    minutes: '0'
action:
  - choose:
      - conditions:
          - condition: or
            conditions:
              - condition: state
                entity_id: media_player.nesthub51a4
                state: 'off'
              - condition: state
                entity_id: media_player.nesthub51a4
                state: paused
                for: '00:00:20'
        sequence:
          - service: media_player.volume_mute
            data:
              is_volume_muted: true
              entity_id: media_player.nesthub51a4
          - service: media_player.turn_off
            data:
              entity_id: media_player.nesthub51a4
          - delay:
              seconds: 2
          - service: media_player.turn_on
            data:
              entity_id: media_player.nesthub51a4
          - service: cast.show_lovelace_view
            data:
              view_path: dining-room
              dashboard_path: lovelace
              entity_id: media_player.nesthub51a4
          - service: cast.show_lovelace_view
            data:
              view_path: dining-room
              dashboard_path: lovelace
              entity_id: media_player.nesthub51a4
          - delay:
              seconds: 10
          - service: media_player.volume_mute
            data:
              is_volume_muted: false
              entity_id: media_player.nesthub51a4
id: '1650506777972'
alias: Cast Dashboard to Dining Room Nest
description: ''

Anything in the logs that might be useful for us?

ha.logs.log

Additional information

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:3
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
DanDixoncommented, Jun 4, 2022

I have a Google Nest Hub v2 and can confirm that Home Assistant does not show the cast Lovelace/dashboard as paused when you swipe away.

1reaction
emontnemerycommented, May 5, 2022

Home Assistant relies on the chrome cast device signalling that it’s been paused.

Please enable the logs below, then share a log file where the problem is reproduced.

logger:        
  default: info
  logs:
     homeassistant.components.cast: debug             
     homeassistant.components.cast.media_player: debug
     pychromecast: debug                              
     pychromecast.dial: debug                         
     pychromecast.discovery: info                     
     pychromecast.controllers.media: debug            
     pychromecast.socket_client: debug                
     homeassistant.components.zeroconf: debug         
     zeroconf: info                                   
Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Cast stopped working within the last couple of weeks
As the Lovelace cast app will have a paused state now instead of idle. I stopped the automation and was simply trying from...
Read more >
Chromecast state doesn't update when playing Netflix - Reddit
If Netflix doesn't update the state of the Chromecast, is it possible to check some other option/state/attribute to determine the play/pause ...
Read more >
Cast and re-cast a lovelace view to a Google Hub - Blueprints ...
Small automation that casts a lovelace view to a Google Hub (or any ... Google Cast Integration doesn't detect paused state when cast...
Read more >
No Cast destination found - Android - Chromecast Help
Unplug the power cable from the Chromecast device and wait a few seconds, then plug it back in. Wait a couple of minutes....
Read more >
Casting Home Assistant Dashboards to Google Nest Hub 2nd ...
remove Remove a video from the queue (YouTube only). restore Return Chromecast to saved state. rewind Rewind a video by TIME duration. save...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found