Skip to content

media_player.play_media with Announce=True no longer plays at the same time since last update #849

@warheat1990

Description

@warheat1990

I've this script and it's working fine until yesterday when I updated my HomeAssistant along with pyscript from few months ago to recent version. input_text.cs is all of my ceiling speakers entity_id, previously it will play to all speakers at the same time but now it will play one by one. Anyone know what changes? I checked the changelog and can't seem to find anything related to media_player or Announce

class DoorAutomation:
    wk2kc_door_open_sound_is_playing = False

    @state_trigger("binary_sensor.ds_wk2kc_contact == 'on'")
    def wk2kc_door_open_sound():
        if DoorAutomation.wk2kc_door_open_sound_is_playing:
            log.info('wk2kc_door_open_sound is playing, aborted')
            return

        DoorAutomation.wk2kc_door_open_sound_is_playing = True

        for media_player_eid in input_text.cs.split(','):
            media_player.play_media(
                entity_id = 'media_player.' + media_player_eid.strip(),
                media_content_id = "media-source://media_source/local/FamilyMart Chime.mp3",
                media_content_type = "music",
                announce = True,
                extra = {
                    "announce_volume" : 0.5
                }
            )

        task.sleep(6)
        DoorAutomation.wk2kc_door_open_sound_is_playing = False

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions