I’ve done a search here and via Google but can’t figure this out. I added my Onkyo receiver (wired) to HA via the recommended code in configurations.yaml
- service: media_player.play_media
entity_id: media_player.YourOnkyo
data:
media_content_id: 1
media_content_type: radio
Check out my solution to select presets from menu. This is not very convinient in programming but quite convinient in GUI:
media_player:
- platform: onkyo
host: !secret onkyo_ip
name: Onkyo Receiver
sources:
fm: 'FM Radio'
input_select:
radio_station:
name: FM radio
options:
- Europa Plus
- Retro FM
- Radio 7
- Studio21
- Novoe Radio
- Dorognoe Radio
- Love Radio
- NRJ
- DFM
- Mayak
initial: Europa Plus
icon: mdi:radio
…and the script corresponding input_select radoiostation title to Onkyo preset:
Thank you very much for the fast reply and the cleaner setup (I was going to use buttons for each preset).
One question and one issue.
How would you turn on both the main and Zone 2 for the above?
I put in the following in configuration.yaml but am getting an error that reads:
Invalid config for [input_select]: initial state Onkyo radio is not part of the options: Kiss 108,Magic 106-7,Mix 104-1,Amp 103-3,WZLX 100-7,Classical 99-5,Hot 96-9 for dictionary value @ data[‘input_select’][‘radio_station’]. Got OrderedDict([(‘name’, ‘FM radio’), (‘options’, [‘Kiss 108’, ‘Magic 106-7’, ‘Mix 104-1’, ‘Amp 103-3’, ‘WZLX 100-7’, ‘Classical 99-5’, ‘Hot 96-9’]), (‘initial’, ‘Onkyo radio’), (‘icon’, ‘mdi:radio’)]). (See /config/configuration.yaml, line 162).
This is my section of configuration.yaml
# Onkyo
media_player:
- platform: onkyo
host: 192.168.1.31
name: Onkyo
sources:
fm: 'FM Radio'
input_select:
radio_station:
name: FM radio
options:
- Kiss 108
- Magic 106-7
- Mix 104-1
- Amp 103-3
- WZLX 100-7
- Classical 99-5
- Hot 96-9
initial: Onkyo radio
icon: mdi:radio
However Zone 2 is a separate mediaplayer so you need to apply all the same to media_player.onkyo_receiver_zone_2, just make a second script and add second action to automation (which fires up this second script).
There’s an error in input_select:
your input_select.radio_station have 7 optional values (from Kiss to Hot), but you don’t have initial value “Onkyo radio” in this list. Change this value to “Kiss 108” and voila.
D’oh! Didn’t understand what Initial meant and now very obvious.
I have it working and this is awesome. So clean. Thank you!
Now to get a little fancier if you will:
What card are you using? I chose Entity Card and pulled input_select.radio_station but this is clunky as I need to click the name of the radio station and then, in the popup, pull down the one I want.
Is it possible to add power off?
Possible to adjust volume?
Assuming a Zone 2, how would you cleanly select both from one card (or is that even possible)?
There’s a tricky trick for volume. You need not only pass volume value from GUI slider to Onkyo but also set slider value as you change volume on Onkyo by remote or volume dial on front panel. So here we are:
entities:
- entity: media_player.onkyo
- entity: media_player.onkyo_zone_2
- entity: input_select.radio_station
- entity: input_select.radio_station2
title: FM Radio
type: entities
So I ended up with Zone 1 power, zone 2 power and drop down for station preset.
When I pull down to get a station, power turns on for main zone and, magically, a volume appears! If I click on Zone 2, I get another volume option and, by default, it plays the same source
About NET (TuneIn, Pandora etc): I tried to figure out once but I didn’t find a convinient way to manage TuneIn presets inside Onkyo without HDMI-display and IR-controler. I thought http://onkyo.local/station.cgi page is useless for saving/editing presets so I just left it.