Add config flow to Onkyo (#35399)

* Add config flow to Onkyo

* Fix formatting
This commit is contained in:
Artur Pragacz 2024-10-28 08:29:28 +01:00 committed by GitHub
parent 828a66bd80
commit c32e72dda8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,93 +3,51 @@ title: Onkyo
description: Instructions on how to integrate Onkyo and some Pioneer receivers into Home Assistant. description: Instructions on how to integrate Onkyo and some Pioneer receivers into Home Assistant.
ha_category: ha_category:
- Media player - Media player
ha_release: 0.17 ha_codeowners:
ha_iot_class: Local Push - '@arturpragacz'
ha_config_flow: true
ha_domain: onkyo ha_domain: onkyo
ha_integration_type: integration
ha_iot_class: Local Push
ha_platforms: ha_platforms:
- media_player - media_player
ha_integration_type: integration ha_release: 0.17
related: related:
- docs: /docs/configuration/ - docs: /docs/configuration/
title: Configuration file title: Configuration file
ha_codeowners:
- '@arturpragacz'
--- ---
The `onkyo` {% term integration %} allows you to control a [Onkyo](https://www.onkyo.com), [Integra](http://www.integrahometheater.com) The `onkyo` {% term integration %} allows you to control a [Onkyo](https://www.onkyo.com), [Integra](http://www.integrahometheater.com)
and some recent [Pioneer](https://www.pioneerelectronics.com) receivers from Home Assistant. and some recent [Pioneer](https://www.pioneerelectronics.com) receivers from Home Assistant.
Please be aware that you need to enable "Network Standby" for this integration to work in your Hardware. Please be aware that you need to enable "Network Standby" for this integration to work in your Hardware.
## Configuration {% include integrations/config_flow.md %}
To add an Onkyo or Pioneer receiver to your installation, add the following to your {% term "`configuration.yaml`" %} file. If your receiver has second or third zone available, they are displayed as additional media players with the same functionality as the main zone.
{% include integrations/restart_ha_after_config_inclusion.md %}
```yaml {% configuration_basic %}
# Example configuration.yaml entry Host:
media_player: description: Hostname or IP address of the device, for example:`192.168.1.2`.
- platform: onkyo
host: 192.168.1.2
name: receiver
sources:
pc: "HTPC"
```
If your receiver has second or third zones available, they are displayed as additional media players with the same functionality as the main zone.
{% configuration %}
host:
description: IP address of the device. Example:`192.168.1.2`. If not specified, the platform will load any discovered receivers.
required: false
type: string type: string
name: Volume Resolution:
description: Name of the device. (*Required if host is specified*) description: Number of steps it takes for the receiver to go from the lowest to the highest possible volume. Possible values are 50, 80, 100, 200. For older Onkyo receivers, this typically is 80; newer Onkyo receivers use 200.
required: false type: integer
type: string Input sources:
max_volume: description: List of input sources supported by the receiver.
description: Maximum volume as a percentage. Often the maximum volume of the receiver is far too loud. Setting this will set Home Assistant's 100% volume to be this setting on the amp. i.e., if you set this to 50% when you set Home Assistant to be 100% then your receiver will be set to 50% of its maximum volume. type: list
required: false {% endconfiguration_basic %}
{% include integrations/option_flow.md %}
{% configuration_basic %}
Max Volume:
description: Maximum volume limit as a percentage. Often the maximum volume of the receiver is far too loud. Setting this will set Home Assistant's 100% volume to be this setting on the amp, i.e., if you set this to 50%, when you set Home Assistant to be 100%, then your receiver will be set to 50% of its maximum volume.
default: 100 default: 100
type: integer type: integer
receiver_max_volume: Input sources:
description: The number of steps it takes for the receiver to go from the lowest to the highest possible volume. Possible values are 50, 80, 100, 200. For older Onkyo receivers, this typically is 80; newer Onkyo receivers use 200. description: Mappings of input sources to their names.
required: false
default: 80
type: integer
sources:
description: A list of mappings from source to source name. Valid sources can be found below. A default list will be used if no source mapping is specified.
required: false
type: list type: list
{% endconfiguration %} {% endconfiguration_basic %}
List of source names:
- `video1`
- `video2`
- `video3`
- `video4`
- `video5`
- `video6`
- `video7`
- `dvd`
- `bd-dvd`
- `tape1`
- `tv-tape`
- `tape2`
- `phono`
- `cd`
- `tv-cd`
- `fm`
- `am`
- `tuner`
- `dlna`
- `internet-radio`
- `usb`
- `network`
- `universal-port`
- `multi-ch`
- `xm`
- `sirius`
### Action `onkyo_select_hdmi_output` ### Action `onkyo_select_hdmi_output`
@ -105,6 +63,21 @@ Accepted values are:
which one to use seems to vary depending on model so you will have to try them out. which one to use seems to vary depending on model so you will have to try them out.
( For model TX-NR676E it seems to be 'out' for main, 'out-sub' for sub, and 'sub' for both ) ( For model TX-NR676E it seems to be 'out' for main, 'out-sub' for sub, and 'sub' for both )
### Example `onkyo_select_hdmi_output` script
```yaml
# Example onkyo_select_hdmi_output script
#
script:
hdmi_sub:
alias: "Hdmi out projector"
sequence:
- action: media_player.onkyo_select_hdmi_output
data:
entity_id: media_player.onkyo
hdmi_output: out-sub
```
### Example `play_media` script ### Example `play_media` script
The `play_media` function can be used in script to play radio station by preset number. The `play_media` function can be used in script to play radio station by preset number.
@ -114,7 +87,7 @@ Not working for NET radio.
# Example play_media script # Example play_media script
# #
script: script:
radio1: radio1:
alias: "Radio 1" alias: "Radio 1"
sequence: sequence:
- action: media_player.turn_on - action: media_player.turn_on
@ -127,18 +100,3 @@ script:
media_content_type: "radio" media_content_type: "radio"
media_content_id: "1" media_content_id: "1"
``` ```
### Example `onkyo_select_hdmi_output` script
```yaml
# Example onkyo_select_hdmi_output script
#
script:
hdmi_sub:
alias: "Hdmi out projector"
sequence:
- action: media_player.onkyo_select_hdmi_output
data:
entity_id: media_player.onkyo
hdmi_output: out-sub
```