thank you for sharing all this, it help me a lot.
I also share my solution :
for the internet radio :
I set a generic onkyo command into the shell_command (replace the IP)
onkyo_command: onkyo -v -t <IP> {{ cmd }}
then I created a input_select list (format ’ - ') :
{
"name": "Internet radio",
"options": [
"01 - nrj",
"02 - nostalgie",
"03 - RTL",
"04 - Rire et chansons",
"05 - Chérie FM",
"06 - RTL 2",
"07 - Fun Radio",
"08 - Europe 1",
"09 - Virgin Radio",
"10 - Radio Gazelle",
"11 - RMC",
"12 - BFM Business",
"13 - France Info",
"14 - France Inter",
"15 - France Culture",
"16 - Mouv'",
"17 - Oui FM",
"18 - RFM"
],
"icon": "mdi:radio-tower",
"initial": "02 - nostalgie",
"id": "iradio_station"
}
finally, in the automation I parse the selected entry to extract the preset number :
alias: Onkyo_Internet_Radio
description: ''
trigger:
- platform: state
entity_id: input_select.internet_radio
condition: []
action:
- service: media_player.select_source
data:
source: INTERNET
entity_id: media_player.onkyo
- service_template: shell_command.onkyo_command
data:
cmd: listening-mode=all-ch-stereo
- service_template: shell_command.onkyo_command
data:
cmd: >-
dock.internet-radio-preset={{
states.input_select.internet_radio.state.split("-")[0] | int }}
mode: single
for the FM, this is almost the same :
don’t know why I the generic command above do not work, must be because there is more than one argument. anyway I have created an other command to get it work (replace the IP):
onkyo_command_freq: onkyo -v -t <IP> main.tuning=direct {%- for item in states.input_select.fm_radio_freq.state.split("-")[1] | replace ('.', '') | trim | list() %} main.tuning={{ item }}-in-direct-mode{% endfor %}
I set the frequency into the input_select (format ’ - '), don’t forget the ‘0’ at the end :
{
"name": "FM radio freq",
"options": [
"NOSTALGIE - 98.30",
"MARITIMA - 93.80",
"RIRE ET CHANSONS - 95.50",
"BEUR FM - 92.60",
"CHERIE FM - 100.10",
"FRANCE INFO - 105.30",
"FUN RADIO - 99.70",
"LE MOUV' - 96.40",
"NRJ - 106.40",
"RADIO FG - 93.4",
"RADIO GAZELLE - 98.00",
"RADIO STAR - 92.30",
"RMC - 104.30",
"RTL - 101.40",
"SKYROCK - 90.00",
"SUD RADIO - 95.10",
"VIRGIN RADIO - 102.30",
"VITAMINE - 107.20"
],
"icon": "mdi:radio",
"initial": "NOSTALGIE - 98.30",
"id": "radio_station_freq"
},
finally, in the automation nothing special, the shell command is doing everything :
alias: Onkyo_fm_Radio_freq
description: ''
trigger:
- platform: state
entity_id: input_select.fm_radio_freq
condition: []
action:
- service: media_player.select_source
data:
source: FM
entity_id: media_player.onkyo
- service_template: shell_command.onkyo_command_freq
mode: single
this allow me to manage the changes directly by the input_select
hope it help.