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

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

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 5
  • Comments: 24 (1 by maintainers)

Most upvoted comments

This is still an issue

Seems to be fixed as of 2024.3.1. Can anyone else confirm? EDIT: Nope. I was just being stupid 🤦

This is still an issue on the latest version

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.

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