Oh wow, I just found one of my first posts from exactly one year ago and it never got an answer. I started with Home Assistant back then and I had no idea of its capabilities. Now - One year later with the past 6 months intensively using it, I can tell myself, that this is absolutely easy to pull off.
If anyone in the future sees this, this is me replying to my past self.
All you need is one automation, one script and a dropdown menu helper (input_select).
The Dropdown Menu Helper contains the list of podcasts / media items that you want to be able to start.
Since I don’t have a hue dimmer swithc left right now, I just created this in the UI for now:
All of the buttons have a tap action. Important are the first and the second one.
The first one has this action:
tap_action:
action: call-service
service: input_select.select_next
data: {}
target:
entity_id: input_select.bettmusikauswahl
Where “input_select.bettmusikauswahl” is the dropdown helper.
The second button has the following action:
tap_action:
action: call-service
service: script.podcast_auswahl
Now we need to create this script.
alias: 🎧Podcast Auswahl
sequence:
- choose:
- conditions:
- condition: state
entity_id: input_select.bettmusikauswahl
state: Podcast 1
sequence:
- service: spotcast.start
data:
entity_id: media_player.nest_schlafzimmer
uri: your podcast ID
random_song: true
shuffle: true
ignore_fully_played: true
- conditions:
- condition: state
entity_id: input_select.bettmusikauswahl
state: Podcast 2
sequence:
- service: spotcast.start
data:
entity_id: media_player.nest_schlafzimmer
uri: your podcast ID
random_song: true
shuffle: true
ignore_fully_played: true
- choose:
- conditions: [AND SO ON]
sequence:
default: []
mode: single
And finally you need an automation, that announces which podcast you choose.
alias: 🎧Podcast
trigger:
- platform: state
entity_id:
- input_select.bettmusikauswahl
condition: []
action:
- service: tts.cloud_say
data:
entity_id: media_player.nest_schlafzimmer
message: "{{ states('input_select.bettmusikauswahl') }}"
mode: single
Now, when you press button 1 X times, it will tell you which Podcast is selected. If you hear the one you want to listen to, it will start playing it by selecting the right URI from the Script.
Total time to build: 10 minutes.
It is interesting to see how much I learned in this year, even tho I see how much there still is.
So, thanks Home Assistant!