Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media control in Lovelace UI can not stop HEOS device from playing #39106

Closed
olalid opened this issue Aug 21, 2020 · 16 comments
Closed

Media control in Lovelace UI can not stop HEOS device from playing #39106

olalid opened this issue Aug 21, 2020 · 16 comments

Comments

@olalid
Copy link

olalid commented Aug 21, 2020

The problem

When using the stop button in a "media-control" UI element in Lovelace for a HEOS device, nothing happens. The HEOS device continues to play.
However, when calling the service media_player.media_stop from an automation it works fine to stop playing.
It is not a completely new problem, it occurred several months ago I think. Unfortunately I do not know exactly when.

Environment

arch | x86_64
dev | false
docker | false
hassio | false
installation_type | Home Assistant Core
os_name | Linux
os_version | 4.15.0-101-generic
python_version | 3.7.5
timezone | Europe/Stockholm
version | 0.114.2
virtualenv | true

  • Home Assistant Core release with the issue: 0.114.2
  • Last working Home Assistant Core release (if known):
  • Operating environment (OS/Container/Supervised/Core): Linux
  • Integration causing this issue: heos
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/heos/

Problem-relevant configuration.yaml

Lovelace config:
"entity": "media_player.h_kok",
"type": "media-control"

Traceback/Error logs

Nothing happens in log when pressing stop button.

Additional information

@probot-home-assistant
Copy link

Hey there @andrewsayre, mind taking a look at this issue as its been labeled with an integration (heos) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@andrewsayre
Copy link
Member

Hmm, I'm not able to reproduce this problem. Can you share what kind of media is playing at the time (source and type)? I've also found many HEOS issues go away after a cold power reset of the device.

@olalid
Copy link
Author

olalid commented Sep 5, 2020

I do not think it matters what or how I started playing the media, this is very consistent in my environment. Stop button in lovelace does not work on any of my HEOS devices (I have 9 of them), but it does work on other media players controlled by the same type of Lovelace element.
For the sake of argument I can provide the example that I select one of the favourites in the dropdown in the lovelace media-control, the device starts playing but I can not stop the media with the stop button in the same media-control.
But if I run the service service media_player.media_stop from the developer menu or from a script/automation on the same device it works fine.
Perhaps I should try and enable maximum logging to see if I can catch anything... I'll get back to you on that.

@rchovan
Copy link

rchovan commented Sep 7, 2020

Hi,
I'm following this issue for several days, I have same problem with my Heos 1. Stop button from Lovelace does not work. I can play favorite radios from HA, but can't stop them from media player card. Only pause is working.

2020-09-07 08:49:49 DEBUG (MainThread) [pyheos.connection] Command executed 'heos://system/heart_beat?sequence=151': '{'command': 'system/heart_beat', 'result': 'success', 'message': ''}'
2020-09-07 08:49:59 DEBUG (MainThread) [pyheos.connection] Command executed 'heos://system/heart_beat?sequence=152': '{'command': 'system/heart_beat', 'result': 'success', 'message': ''}'
2020-09-07 08:50:00 DEBUG (MainThread) [pyheos.connection] Command executed 'heos://player/get_now_playing_media?sequence=153&pid=1842510932': '{'command': 'player/get_now_playing_media', 'result': 'success', 'message': 'sequence=153&pid=1842510932'}'
2020-09-07 08:50:00 DEBUG (MainThread) [pyheos.connection] Event received for player {Kitchen (HEOS 1)}: {'command': 'event/player_now_playing_changed', 'message': 'pid=1842510932'}
2020-09-07 08:50:00 DEBUG (MainThread) [pyheos.connection] Event received for player {Kitchen (HEOS 1)}: {'command': 'event/player_state_changed', 'message': 'pid=1842510932&state=play'}
2020-09-07 08:50:00 DEBUG (MainThread) [pyheos.connection] Command executed 'heos://player/get_now_playing_media?sequence=154&pid=1842510932': '{'command': 'player/get_now_playing_media', 'result': 'success', 'message': 'sequence=154&pid=1842510932'}'
2020-09-07 08:50:00 DEBUG (MainThread) [pyheos.connection] Event received for player {Kitchen (HEOS 1)}: {'command': 'event/player_now_playing_changed', 'message': 'pid=1842510932'}
2020-09-07 08:50:01 DEBUG (MainThread) [pyheos.connection] Event received for player {Kitchen (HEOS 1)}: {'command': 'event/player_now_playing_progress', 'message': 'pid=1842510932&cur_pos=1000&duration=0'}
2020-09-07 08:50:01 DEBUG (MainThread) [pyheos.connection] Command executed 'heos://player/get_now_playing_media?sequence=155&pid=1842510932': '{'command': 'player/get_now_playing_media', 'result': 'success', 'message': 'sequence=155&pid=1842510932'}'
2020-09-07 08:50:01 DEBUG (MainThread) [pyheos.connection] Event received for player {Kitchen (HEOS 1)}: {'command': 'event/player_now_playing_changed', 'message': 'pid=1842510932'}
2020-09-07 08:50:03 DEBUG (MainThread) [pyheos.connection] Event received for player {Kitchen (HEOS 1)}: {'command': 'event/player_now_playing_progress', 'message': 'pid=1842510932&cur_pos=3000&duration=0'}
2020-09-07 08:50:03 DEBUG (MainThread) [pyheos.connection] Command executed 'heos://player/get_now_playing_media?sequence=156&pid=1842510932': '{'command': 'player/get_now_playing_media', 'result': 'success', 'message': 'sequence=156&pid=1842510932'}'
2020-09-07 08:50:03 DEBUG (MainThread) [pyheos.connection] Event received for player {Kitchen (HEOS 1)}: {'command': 'event/player_now_playing_changed', 'message': 'pid=1842510932'}
2020-09-07 08:50:05 DEBUG (MainThread) [pyheos.connection] Event received for player {Kitchen (HEOS 1)}: {'command': 'event/player_now_playing_progress', 'message': 'pid=1842510932&cur_pos=5000&duration=0'}
2020-09-07 08:50:05 DEBUG (MainThread) [pyheos.connection] Command executed 'heos://player/get_now_playing_media?sequence=157&pid=1842510932': '{'command': 'player/get_now_playing_media', 'result': 'success', 'message': 'sequence=157&pid=1842510932'}'
2020-09-07 08:50:05 DEBUG (MainThread) [pyheos.connection] Event received for player {Kitchen (HEOS 1)}: {'command': 'event/player_now_playing_changed', 'message': 'pid=1842510932'}
2020-09-07 08:50:08 DEBUG (MainThread) [pyheos.connection] Event received for player {Kitchen (HEOS 1)}: {'command': 'event/player_now_playing_progress', 'message': 'pid=1842510932&cur_pos=8000&duration=0'}
2020-09-07 08:50:11 DEBUG (MainThread) [pyheos.connection] Command executed 'heos://player/get_now_playing_media?sequence=158&pid=1842510932': '{'command': 'player/get_now_playing_media', 'result': 'success', 'message': 'sequence=158&pid=1842510932'}'
2020-09-07 08:50:11 DEBUG (MainThread) [pyheos.connection] Event received for player {Kitchen (HEOS 1)}: {'command': 'event/player_now_playing_changed', 'message': 'pid=1842510932'}
2020-09-07 08:50:13 DEBUG (MainThread) [pyheos.connection] Event received for player {Kitchen (HEOS 1)}: {'command': 'event/player_now_playing_progress', 'message': 'pid=1842510932&cur_pos=13000&duration=0'}

but with calling service media_player.media_stop it is working:

2020-09-07 08:51:09 DEBUG (MainThread) [pyheos.connection] Command executed 'heos://player/set_play_state?state=stop&sequence=159&pid=1842510932': '{'command': 'player/set_play_state', 'result': 'success', 'message': 'state=stop&sequence=159&pid=1842510932'}'
2020-09-07 08:51:09 DEBUG (MainThread) [pyheos.connection] Command executed 'heos://player/get_now_playing_media?sequence=160&pid=1842510932': '{'command': 'player/get_now_playing_media', 'result': 'success', 'message': 'sequence=160&pid=1842510932'}'
2020-09-07 08:51:09 DEBUG (MainThread) [pyheos.connection] Event received for player {Kitchen (HEOS 1)}: {'command': 'event/player_now_playing_changed', 'message': 'pid=1842510932'}
2020-09-07 08:51:10 DEBUG (MainThread) [pyheos.connection] Event received for player {Kitchen (HEOS 1)}: {'command': 'event/player_state_changed', 'message': 'pid=1842510932&state=stop'}


@andrewsayre
Copy link
Member

  1. Can you clarify whether the stop button is displayed (and not disabled) in the UI? Please provide a screen shot.
  2. The type of media playing does matter because not all sources support the same controls and it's possible the wrong UI metadata is being provided, so please provide the requested information if you want further help with this issue.

This may be a UI issue given the stop service is working. The HEOS integration doesn't control how the media control card works. Let's rule out a UI metadata issue first and go from there.

@rchovan
Copy link

rchovan commented Sep 9, 2020

Hi,
here is short video.
2020-09-07_08-16-15

And if it helps, here are metadata for media:

[
    [{
        "attributes": {
            "entity_picture_local": null,
            "friendly_name": "Kitchen",
            "is_volume_muted": false,
            "media_album_id": "s109796",
            "media_album_name": "",
            "media_artist": "",
            "media_content_id": "http://stream.antenarock.sk/antena-hi.mp3",
            "media_content_type": "music",
            "media_queue_id": 1,
            "media_source_id": 3,
            "media_station": "R\u00e1dio Ant\u00e9na Rock",
            "media_title": "128 kbps mp3",
            "media_type": "station",
            "shuffle": false,
            "source": "R\u00e1dio Ant\u00e9na Rock",
            "source_list": ["Fun Radio Live 94.3 (Top 40 and Pop Music)", "R\u00e1dio Ant\u00e9na Rock", "RTVS R Slovensko 102.4 (US News)", "RTVS Radio FM 91.8 (Euro Hits)", "AH.FM - Leading Trance Radio", "SmoothJazz.com Global Radio (KJAZ.db) (US)", "Chocolat Radio", "Frontinus Radio 104.6 (Adult Hits)", "Jemn\u00e9 Mel\u00f3die 96.3 (Adult Hits)", "Costa Del Mar - Chillout (Spain)", "Midnight Cafe Radio (US)", "Relax Electronic (Russia)", "FM 98.5 of Vocal Trance Live (Trance)", "http://radio.vocaltrance.fm/vocaltrance_128.m3u", "http://radio.vocaltrance.fm/positive_128.m3u", "http://radio.vocaltrance.fm/vocalchillout_128.m3u", "http://radio.vocaltrance.fm/uplifting_128.m3u", "http://radio.vocaltrance.fm/deep_128.m3u", "http://radio.vocaltrance.fm/vocalchillout_128.m3u", "Fun Radio 80 - 90 Roky", "Kitchen - AUX In"],
            "supported_features": 65036,
            "volume_level": 0.2
        },
        "entity_id": "media_player.kitchen",
        "last_changed": "2020-09-08T06:31:39.755000+00:00",
        "last_updated": "2020-09-08T06:31:39.755000+00:00",
        "state": "idle"
    }, {
        "last_changed": "2020-09-08T12:14:53.562359+00:00",
        "state": "unavailable"
    }, {
        "last_changed": "2020-09-09T04:19:44.015195+00:00",
        "state": "playing"
    }, {
        "last_changed": "2020-09-09T05:43:16.421005+00:00",
        "state": "idle"
    }, {
        "attributes": {
            "entity_picture_local": null,
            "friendly_name": "Kitchen",
            "is_volume_muted": false,
            "media_album_id": "s109796",
            "media_album_name": "",
            "media_artist": "",
            "media_content_id": "http://stream.antenarock.sk/antena-hi.mp3",
            "media_content_type": "music",
            "media_queue_id": 1,
            "media_source_id": 3,
            "media_station": "Radio Antena Rock",
            "media_title": "",
            "media_type": "station",
            "shuffle": false,
            "source_list": ["Kitchen - AUX In"],
            "supported_features": 65036,
            "volume_level": 0.26
        },
        "entity_id": "media_player.kitchen",
        "last_changed": "2020-09-09T06:25:03.636099+00:00",
        "last_updated": "2020-09-09T06:25:03.636099+00:00",
        "state": "playing"
    }]
]

@olalid
Copy link
Author

olalid commented Sep 9, 2020

I created a video too, here: http://olal.se/ha/Screen%20Recording%202020-09-09%20at%2009.10.48.mp4

Can you explain how to find the media meta-data?

/Ola

@olalid
Copy link
Author

olalid commented Sep 9, 2020

Oh, yes, btw, I realised that playing Spoitfy media it does not have this issue. There is then instead of a stop button a pause ans skip fwd button that both works.

@rchovan
Copy link

rchovan commented Sep 9, 2020

@olalid

browser web console (F12),

  1. switch to network tab

  2. filter to media

  3. select source

  4. find appropriate request

  5. look for response

image

@olalid
Copy link
Author

olalid commented Sep 9, 2020

Ok, both of these have the issue.

[[{
    "attributes": {
        "entity_picture": "http://cdn-radiotime-logos.tunein.com/s25681d.png",
        "entity_picture_local": "/api/media_player_proxy/media_player.h_hobbyrum?token=f4bde9d739d3ab227c0b771b37bab77ee2a7f6f89989e801202d835e3f51bdd8&cache=893a6a260bfda575",
        "friendly_name": "H_Hobbyrum",
        "is_volume_muted": false,
        "media_album_id": "s25681",
        "media_album_name": "",
        "media_artist": "",
        "media_content_id": "http://sverigesradio.se/topsy/direkt/164-hi-aac.m3u",
        "media_content_type": "music",
        "media_duration": 0.0,
        "media_queue_id": 1,
        "media_source_id": 3,
        "media_station": "P3",
        "media_title": "",
        "media_type": "station",
        "shuffle": false,
        "source": "P3 (Stockholm)",
        "source_list": ["P1", "P2 Musik (Stockholm)", "P3 (Stockholm)", "P4 \u00d6sterg\u00f6tland (Norrk\u00f6ping)", "Pinguin Radio", "RIX FM", "NRJ", "Mix Megapol", "Bandit Rock 101.9 (Rock Music)", "Rocket FM 95.3 (Alternative Rock)", "Pinguin On The Rocks", "Pinguin Classics", "Pinguin Aardschok", "IndyCar Radio", "H_Vardagsrum - AUX In", "H_Vardagsrum - Line In", "H_Vardagsrum - Optical In", "H_K\u00f6k - AUX In", "H_Hobbyrum - AUX In", "H_Uterum - AUX In", "H_G\u00e4strum - AUX In", "H_G\u00e4strum - Optical In", "H_G\u00e4strum - Coaxial In", "H_G\u00e4strum - HDMI Arc", "H_G\u00e4strum - HDMI In", "H_Bjorn - AUX In", "H_K\u00e4llare - AUX In", "H_Ive - AUX In", "H_Syrum - AUX In"],
        "supported_features": 65036,
        "volume_level": 0.21
    },
    "entity_id": "media_player.h_hobbyrum",
    "last_changed": "2020-09-09T08:14:25+00:00",
    "last_updated": "2020-09-09T08:14:25+00:00",
    "state": "idle"
}, {
    "attributes": {
        "entity_picture_local": null,
        "friendly_name": "H_Hobbyrum",
        "is_volume_muted": false,
        "media_album_id": "s45142",
        "media_album_name": "",
        "media_artist": "",
        "media_content_id": "http://streams.pinguinradio.com/PinguinRadio320.mp3",
        "media_content_type": "music",
        "media_queue_id": 1,
        "media_source_id": 3,
        "media_station": "Pinguin Indie",
        "media_title": "",
        "media_type": "station",
        "shuffle": false,
        "source": "Pinguin Radio",
        "source_list": ["P1", "P2 Musik (Stockholm)", "P3 (Stockholm)", "P4 \u00d6sterg\u00f6tland (Norrk\u00f6ping)", "Pinguin Radio", "RIX FM", "NRJ", "Mix Megapol", "Bandit Rock 101.9 (Rock Music)", "Rocket FM 95.3 (Alternative Rock)", "Pinguin On The Rocks", "Pinguin Classics", "Pinguin Aardschok", "IndyCar Radio", "H_Vardagsrum - AUX In", "H_Vardagsrum - Line In", "H_Vardagsrum - Optical In", "H_K\u00f6k - AUX In", "H_Hobbyrum - AUX In", "H_Uterum - AUX In", "H_G\u00e4strum - AUX In", "H_G\u00e4strum - Optical In", "H_G\u00e4strum - Coaxial In", "H_G\u00e4strum - HDMI Arc", "H_G\u00e4strum - HDMI In", "H_Bjorn - AUX In", "H_K\u00e4llare - AUX In", "H_Ive - AUX In", "H_Syrum - AUX In"],
        "supported_features": 65036,
        "volume_level": 0.21
    },
    "entity_id": "media_player.h_hobbyrum",
    "last_changed": "2020-09-09T08:14:27+00:00",
    "last_updated": "2020-09-09T08:14:27+00:00",
    "state": "playing"
}]]

@mvdwetering
Copy link
Contributor

Maybe this is related to this issue home-assistant/frontend#6097
It seems the frontend call play_pause instead of stop.

I just noticed it got stale, I might need a bump then.

@olalid
Copy link
Author

olalid commented Sep 12, 2020

Maybe this is related to this issue home-assistant/frontend#6097
It seems the frontend call play_pause instead of stop.

I just noticed it got stale, I might need a bump then.

Sounds like the same thing.
But it was never assigned to anyone, so I guess nobody is looking at it.

@rchovan
Copy link

rchovan commented Sep 21, 2020

@andrewsayre Hi, could you please notify someone, who can check and posibly fix this issue ?

@quizzical86
Copy link

quizzical86 commented Jan 6, 2021

I have the same problem on my HEOS 1. I resorted to creating a dedicated stop button in lovelace...

@olalid
Copy link
Author

olalid commented Jan 11, 2021

Actually this works for me now. I am currently running version 2020.12.2. I do not know when it started working exactly.

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants