-
-
Notifications
You must be signed in to change notification settings - Fork 692
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
Allow notification media player controls #1009
Comments
Not quite a notification but #1005 would allow you to create home screen widgets, one for each media player. |
Guide on how it could be done: https://developer.android.com/guide/topics/media/media-controls. The PR that @dshokouhi mentioned has the service calls needed to hook up to the interface. The entities could be selected in the settings menus but I'm not sure how we would resurface the media player after it was dismissed. |
I'd like to have it settings menu independend, so you provide the media_player entities as the data that will get send together with notification. Just like a picture notification, only now, a mediaplayer notification.
You mean that when you swipe the notification away, how it comes back? Well, in my mind that should be done by a HomeAssistant automation, which pushes the notification to the device. |
Using the notification system is an interesting idea. That seems like a decent way to remove the need for more settings and a good way to resurface the media player. |
The only thing, is that when a user is streaming from the phone, to the media player, a media player notification for the same context gets shown twice. |
Has this been implemented, or being considered? |
the enhancement request is still open so it has not been implemented yet, anyone who wants to implement it can pick it up |
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. |
Any chance this will ever be implemented? I want this so badly |
Same it would be a game changer if possible |
Would be awesome |
In lieu of native android media controls, I created an automation for this using regular notifications. You may need to tweak based on the behavior of your media player alias: Desk Speakers Media Remote
description: ""
trigger:
- id: media_on
platform: state
entity_id:
- media_player.desk_speakers
from:
- "off"
- standby
- idle
to:
- "on"
- paused
- playing
- buffering
- id: media_pause
platform: state
entity_id:
- media_player.desk_speakers
from:
- playing
- buffering
to: paused
- id: media_off
platform: state
entity_id:
- media_player.desk_speakers
to:
- "off"
- standby
- idle
- id: media_play
platform: state
entity_id:
- media_player.desk_speakers
from: paused
to:
- playing
- buffering
- platform: event
event_type: mobile_app_notification_action
event_data:
action: PLAY_PAUSE_DESK_SPEAKERS
id: action_play_pause
- platform: event
event_type: mobile_app_notification_action
event_data:
action: NEXT_DESK_SPEAKERS
id: action_next
- platform: event
event_type: mobile_app_notification_action
event_data:
action: TURN_OFF_DESK_SPEAKERS
id: action_turn_off
- platform: state
entity_id:
- media_player.desk_speakers
attribute: media_title
id: media_change
condition: []
action:
- choose:
- conditions:
- condition: trigger
id:
- media_on
- media_play
sequence:
- service: notify.mobile_app_pixel_8
metadata: {}
data:
title: >
{{ state_attr('media_player.desk_speakers','media_title') }} -
{{ state_attr('media_player.desk_speakers','media_artist') }}
message: >
Desk Speakers -
{{state_attr('media_player.desk_speakers','source')}}
data:
persistent: true
sticky: true
tag: desk_speakers_media
notification_icon: mdi:speaker
channel: Media
importance: max
image: >
{{ state_attr('media_player.desk_speakers','entity_picture')
}}
actions:
- action: PLAY_PAUSE_DESK_SPEAKERS
title: Play/Pause
- action: NEXT_DESK_SPEAKERS
title: Next
- action: TURN_OFF_DESK_SPEAKERS
title: Stop
- conditions:
- condition: trigger
id:
- media_off
sequence:
- service: notify.mobile_app_pixel_8
metadata: {}
data:
message: clear_notification
data:
tag: desk_speakers_media
- conditions:
- condition: trigger
id:
- action_play_pause
sequence:
- service: media_player.media_play_pause
target:
entity_id:
- media_player.desk_speakers
data: {}
- conditions:
- condition: trigger
id:
- action_next
sequence:
- service: media_player.media_next_track
target:
entity_id:
- media_player.desk_speakers
data: {}
- conditions:
- condition: trigger
id:
- action_turn_off
sequence:
- service: media_player.media_stop
target:
entity_id:
- media_player.desk_speakers
data: {}
- conditions:
- condition: trigger
id:
- media_pause
- condition: not
conditions:
- condition: template
value_template: >-
{{ state_attr('media_player.desk_speakers','media_title') is
none }}
sequence:
- service: notify.mobile_app_pixel_8
metadata: {}
data:
title: >
{{ state_attr('media_player.desk_speakers','media_title') }} -
{{ state_attr('media_player.desk_speakers','media_artist') }}
message: >
Desk Speakers -
{{state_attr('media_player.desk_speakers','source')}}
data:
persistent: true
sticky: true
tag: desk_speakers_media
notification_icon: mdi:speaker-pause
channel: Media
importance: max
image: >
{{ state_attr('media_player.desk_speakers','entity_picture')
}}
actions:
- action: PLAY_PAUSE_DESK_SPEAKERS
title: Play
- action: NEXT_DESK_SPEAKERS
title: Next
- action: TURN_OFF_DESK_SPEAKERS
title: Stop
- conditions:
- condition: trigger
id:
- media_change
- condition: not
conditions:
- condition: template
value_template: >-
{{ state_attr('media_player.desk_speakers','media_title') is
none }}
sequence:
- service: notify.mobile_app_pixel_8
metadata: {}
data:
title: >
{{ state_attr('media_player.desk_speakers','media_title') }} -
{{ state_attr('media_player.desk_speakers','media_artist') }}
message: >
Desk Speakers -
{{state_attr('media_player.desk_speakers','source')}}
data:
persistent: true
sticky: true
tag: desk_speakers_media
notification_icon: mdi:speaker
channel: Media
importance: max
image: >
{{ state_attr('media_player.desk_speakers','entity_picture')
}}
actions:
- action: PLAY_PAUSE_DESK_SPEAKERS
title: Play/Pause
- action: NEXT_DESK_SPEAKERS
title: Next
- action: TURN_OFF_DESK_SPEAKERS
title: Stop
mode: queued
max: 10
|
Is your feature request related to a problem? Please describe.
No it is not related to a problem, I was just wondering about how I could integrate contextual locations/rooms into Home Assistant.
In order to realise this, a few other things are needed, one of them is this feature request.
It would be nice if a notify service call could make an media player notification show up on a device, and with that, specifying which media_player component should handle the play/pause back/next controls and which media_player component should handle the volume controls (which I think should replace the thumbs on the image below)
Describe the solution you'd like
HomeAssistant should integrate the mediaplayer controls as seen in the image below, but then for specific media_player entities, one used for playback control and another one used for volume control.
Describe alternatives you've considered, if any
None.
Additional context
The text was updated successfully, but these errors were encountered: