Play News Podcasts (Google Home News update replacement)

Create a Script to play (multiple) Podcasts one after the other

  • find the rss url: google “{newsprovider} podcast rss”
    (e.g. heise online (german): kurz informiert by heise online)

  • add scrape sensors for each podcast (Link to Integrations: add integration – My Home Assistant)

    • Resource: {rss url}
    • NEXT
    • Name: a name for the podcast url sensor
    • Select: enclosure (might differ for you, but it was the same for 5 podcasts for me)
    • Index: 0 (latest episode)
    • Attribute: url (might also differ for you, but it was also the same for all for me)
    • SUBMIT
  • create a new Script (Link to Scripts – My Home Assistant)

    • 3 dots top right → Edit in Yaml
    • replace everything with this:
      alias: Newsupdate
      sequence:
        # set volume for mediaplayer
        - service: media_player.volume_set
          metadata: {}
          data:
            volume_level: 0.5 # <-- set your volume level
          target:
            entity_id: media_player.CHANGEME # <-- change this to your mediaplayer
        # play 1st podast
        - service: media_player.play_media
          data:
            media_content_id: "{{ states.sensor.podcast_url1.state }}" # <-- change this to your first podcast scrape sensor
            media_content_type: episode
          target:
            entity_id: media_player.CHANGEME # <-- change this to your mediaplayer
        # wait for 1st podast to finish
        - wait_for_trigger:
            - platform: state
              entity_id:
                - media_player.CHANGEME # <-- change this to your mediaplayer
              from: playing
              to: idle
          continue_on_timeout: false
          timeout:
            minutes: 30
        # play 2nd podast
        - service: media_player.play_media
          data:
            media_content_id: "{{ states.sensor.podcast_url2.state }}" # <-- change this to your second podcast scrape sensor
            media_content_type: episode
          target:
            entity_id: media_player.CHANGEME # <-- change this to your mediaplayer
        # (optional) add wait for 2nd and play 3rd (and so on)
      mode: restart
      icon: mdi:newspaper
      
    • (optional) if you prefer the visual editor got back: 3 dots top right → Edit in Visual Editor
    • change media_player.CHANGEME to your media player or group
    • change volume level
    • change media content id (get id from scrape sensor) "{{ states.sensor.SCRAPE_SENSOR_ID.state }}"
    • duplicate call service media player to add more podcasts
      (remember to also keep the wait trigger between each service call to wait for the last podcast to finish)

Integration (for e.g. an action in an automation):

  • Start/Play/Pause script
    choose:
      - conditions:
      # if playing -> pause
          - condition: state
            entity_id: media_player.CHANGEME 
            state: playing
        sequence:
          - service: media_player.media_pause
            target:
              entity_id: media_player.CHANGEME 
            data: {}
      - conditions:
      # if paused -> play
          - condition: state
            entity_id: media_player.CHANGEME 
            state: paused
        sequence:
          - service: media_player.media_play
            target:
              entity_id: media_player.CHANGEME 
            data: {}
      - conditions: []
      # else -> start newsupdate
        sequence:
          - service: script.newsupdate # your script id might differ
            data: {}
    
  • Stop/Next script
    # if playing and stopped -> wait for condition is triggered -> Next Podcast
    # if paused and stopped -> Nothing (media player changes to idle)
    service: media_player.media_stop
    metadata: {}
    data: {}
    target:
      entity_id: media_player.CHANGEME 
    
    
  • Skip 30 Seconds
    # set media position to current_position+30
    sequence:
      - service: media_player.media_seek
        metadata: {}
        data:
          seek_position: "{{ state_attr('media_player.CHANGEME ', 'media_position') + 30 }}" # change 30 to the amount of seconds to skip
        target:
          entity_id: media_player.CHANGEME 
    


Feel free to post your additions/tweaks to this setup :)

5 Likes

Is it possible play on phone?

My favourite podcast not start using google assistant and i’m thinking this solution

I don’t think so yet: Companion App as Media Player (not solved)

Maybe an automation with Tasker could solve your problem

Thank you very much!

Using it for
https://subscribers.transistor.fm/ae1fcf378c3e35
So I can play my news on my local smart speaker every day (Google Home Mini) while Music Assistant doesn’t support podcasts yet.

Once it’s playing I can enqueue more episodes and control playback via Music Assistant!

Nice! Glad you like it :slight_smile:

Scrape does not seem to work if the RSS feed has this format:

<enclosure length="xyz" type="audio/mpeg" url="https://xyz/default.mp3?aid=rss_feed&awCollectionId=b4b9795f-4b37-4d4f-bbfe-62b735703af8&awEpisodeId=e592205f-8fdd-471d-953c-527f9848aeed&feed=Xtqjn37O"/>

source: Was jetzt?

How to solve it?

Could you elaborate how to use your integrations?