OK. So the devs have located my Squeezebox, given me an interface card allowing me to view album covers, artist, and title, change tracks, etc. Nice tease. So I’ve spent the last few days trying to expand controls to allow changing of source to one of several tunein radio stations with no success. I’ve looked through discussions, examples, and lots of trial and even more error.
I’m on a RPi3 running Hass.io 0.87.0. The LMS v.7.9.0 is running on a separate Pi (Ovation Solo). I can navigate from the LMS web interface. I’ve got the mysqueezebox and tunein accounts created and linked, if necessary. It’s likely I don’t understand exactly how to get this to work. I can do an Lovelace IFrame card, but experience problems on the iOS client 1.5 when i do. IFrame card works as expected on the Mozilla PC-based browser.
Based on the examples I attempted to follow, I created an input_select list and supporting automatons. I’d welcome
In the configuration file:
- platform: squeezebox
host: !secret oms_IP
name: Ovation
In the input_selects file:
station_select:
name: Radio Stations
options:
- Asterisk
- HD Radio
- Tunein Classic
initial: Asterisk
icon: mdi:radio
I made two attempts at automatons. First this:
- id: 'ovation_asterisk'
alias: Asterisk
initial_state: 'on'
trigger:
- platform: state
entity_id: input_select.radio_select
to: "Asterisk"
action:
- service: media_player.media_play
data:
entity_id: media_player.ovation
media_content_id: http://opml.radiotime.com/Tune.ashx?id=s188877&formats=aac,ogg,mp3&partnerId=16&serial=5db1cfdebfec48be64648ce4a793aa41
media_content_type: 'music'
- id: 'ovation_hd'
alias: HD Radio
initial_state: 'on'
trigger:
- platform: state
entity_id: input_select.radio_select
to: "HD Radio"
action:
- service: media_player.media_play
data:
entity_id: media_player.ovation
media_content_id: http://opml.radiotime.com/Tune.ashx?id=s281107&formats=aac,ogg,mp3&partnerId=16&serial=5db1cfdebfec48be64648ce4a793aa41
media_content_type: 'music'
- id: 'ovation_classic'
alias: Tunein Classic
initial_state: 'on'
trigger:
- platform: state
entity_id: input_select.radio_select
to: "Tunein Classic"
action:
- service: media_player.media_play
data:
entity_id: media_player.ovation
media_content_id: http://opml.radiotime.com/Tune.ashx?id=s249994&formats=aac,ogg,mp3&partnerId=16&serial=5db1cfdebfec48be64648ce4a793aa41
media_content_type: 'music'
then this:
- alias: Stream Radio - Template
trigger:
- platform: state
entity_id: input_select.radio_select
action:
- service: media_player.play_media
data_template:
entity_id: >
{% if is_state("input_select.radio_select", "Asterisk") %}
media_player.ovation
{%-elif is_state("input_select.radio_select", "HD Radio") %}
media_player.ovation
{%-elif is_state("input_select.radio_select", "Tunein Classic") %}
media_player.ovation
{% else %}
none
{% endif %}
media_content_id: >
{% if is_state("input_select.radio_station", "Asterisk") %}
http://opml.radiotime.com/Tune.ashx?id=s188877&formats=aac,ogg,mp3&partnerId=16&serial=5db1cfdebfec48be64648ce4a793aa41
{%-elif is_state("input_select.radio_station", "HD Radio") %}
http://opml.radiotime.com/Tune.ashx?id=s281107&formats=aac,ogg,mp3&partnerId=16&serial=5db1cfdebfec48be64648ce4a793aa41
{%-elif is_state("input_select.radio_station", "Tunein Classic") %}
http://opml.radiotime.com/Tune.ashx?id=s249994&formats=aac,ogg,mp3&partnerId=16&serial=5db1cfdebfec48be64648ce4a793aa41
{% else %}
none
{% endif %}
media_content_type: 'music'
My understanding is that scripts aren’t needed. No errors are reported to the log and no effect on the LMS when attempting to switch from music to radio or switch radio stations. I haven’t figured out how to switch input sources. I started a scripts, but didn’t know how to proceed.
media_player_select_source_radio:
alias: Radio Source
sequence:
- service: media_player.select_source
data:
entity_id: media_player.ovation
source: Radio
Maybe a companion to switch back to music?