Onkyo Zone 2

Other than a feature request for TTS on an Onkyo zone 2 I don’t see any mention of it. I would like to power on zone 2 and switch inputs when a Chromecast audio starts. Is that possible now? Thanks in advance.

1 Like

I entered the feature request. As far as i can see, it is not implemented in HASS right now. However, the zone 2 options are mentioned in the python library linked in this thread:

Unfortunately i lack the knowledge to implement it. I believe some people are already working on something related here, although with a different purpose in mind. Perhaps contact them…

Thanks for the info. I’ll play around with the library when I get a chance. +1 vote for zone 2 control from me. Keep up the great work everyone!

Anyone have any luck getting the Zone 2 controls to work?

Sorry I never got around to playing with it. I will at some point and I’ll report back when I do.

I would like to see Zone 2 included also.

me too :slight_smile:

Anyone get this working?

I did manage to send some eiscp commands from hass to the Onkyo. So i was able to make a on/off switch for zone 2.

But i lack the knowledge to make a component, or implement feedback.

hi

how did you configure the eiscp commands please in HA? have you an example?

thanks

I used the following shell commands to turn it on and off:

shell_command:
  onkyo_zone2_on: 'onkyo zone2.power=on'
  onkyo_zone2_off: 'onkyo zone2.power=standby'

I see my zone2 suddenly popup…(0.71) (also a non-existing zone3)
There is no adjusted explanation how to config on the components page (yet)

Zone 2 support came with v0.68.0, thought with very little announcement (it’s buried down the full list of changes)

This is where it was mentioned:
Add additional receiver for Onkyo zone 2 (@koolsb - #13551) (media_player.onkyo docs)

To enable zone 2 you need to add zone2: true to your config under the Onkyo definition:

  - platform: onkyo
    host: 192.168.0.26
    name: Onkyo TX-NR656
    sources:
      video6: 'Main PC'
      bluray: 'Blu-Ray'
      video2: 'Sky'
      network: 'ChromeCast'
      tv: 'TV'
      strm-box: 'Stream-Box'
    zone2: true

Hello everyone,
So it looks like i am not the only one who want to automate Zone2. So I have my zone 2 speakers in the backyard. I was able to turn it on and off and set to Network but I am wanting to play Pandora through these speakers. I can do it with the Onkyo app so i know it can be done. Any one have any luck getting it to work with HomeAssistant/HASSIO? I follow the previous post and it worked. But now i need to get Pandora to play.

As I don’t want to leave my Onkyo in standby mode but keep it powered off completely when not in use instead, I was looking for a decent solution.
The problem with the Onkyo Home Assistant integration is, that the Onkyo’s zone2 entity is being removed from the entity list after the Onkyo receiver is powered off for a while. Only a Home Assistant reboot is bringing the entity back which is not very desirable.

As it is not possible to install onkyo-eiscp from GitHub source on HAOS directly (well, maybe it is possible somehow but at least I was not aware on how to do this), I decided to install onkyo-eiscp on a remote SSH-enabled Debian 11 VM within the same IP-subnet as HA and let HA execute the according commands on the Debian VM via SSH remotely. Which works perfectly now.
The only thing to be aware of is that it takes about 20 seconds until the Onkyo receiver’s LAN interface is ready after powering on the Onkyo receiver, at least for my Onkyo TX-NR6100 receiver. Which results in having to add a delay of 20 seconds to all of my according automation steps before launching the first command to the Onkyo receiver after powering on the Onkyo device.

So on the Debian VM the installation process was the following:

Set up SSH:

Install SSH server and nano editor packages:
sudo apt update && sudo apt install openssh-server nano

Enable SSH public key authentication on the Debian VM by editing the following file…
sudo nano /etc/ssh/sshd_config
…uncomment the following line…
PubkeyAuthentication yes
…quit the editor and save the file and finally restarting the SSH service:
sudo service sshd restart

Then, on the HA terminal, add the public authentication key to the Debian VM by executing (confirm every step by pressing “enter” and insert the according password where necessary.):
ssh-copy-id <my_user>@<my_Debian_VM_IP_address>
If it does not work, check your router’s or the Debian’s native firewall settings and then repeat the step above.

Now HA should be able to connect remotely and passwordless to the Debian VM.
Test it by executing:
ssh <my_user>@<my_Debian_VM_IP_address>

If it works, follow the steps below.

“onkyo-eiscp” package installation on Debian 11:

EDIT (14.08.2023): Debian 12 (and upwards) installation process is different from Debian 11 installation process. For Debian 12 and upwards package installations please scroll down to the according edited part)

Install python3-pip along with all its dependencies and additional tools:
sudo apt update && sudo apt install python3-pip

Install onkyo-eiscp:
python3 -m pip install onkyo-eiscp

Set up communication between HA and your Onkyo receiver on Debian 11:

You can now execute the according Onkyo commands remotely from the HA terminal to the Debian VM, for example by executing the following command to discover the Onkyo receiver device (make sure your Onkyo receiver is powered (it does not matter if it’s on or off, it just has to have current) and connected to the network):
ssh -i /config/.ssh/id_rsa -o 'StrictHostKeyChecking=no' <my_user>@<my_Debian_VM_IP_address> '/home/$USER/.local/bin/onkyo --discover'

The device should show up after a few seconds similiar to this (If not, make sure the receiver’s network interface is really within the same IP-subnet as the device you are executing the command from!):
TX-NR6100 192.168.100.20:60128 0008Y0F6BB09

The last 12-digit number (0008Y0F6BB09 in this case) is a unique id, every single Onkyo receiver has its own number. In fact it’s the device’s network interface’s MAC address. If you have multiple Onkyo receivers within your network, you can use this number to send commands to a specific device (as always, check the official onkyo-eiscp documentation for more information).

To power on zone2, execute:
ssh -i /config/.ssh/id_rsa -o 'StrictHostKeyChecking=no' <my_user>@<my_Debian_VM_IP_address> '/home/$USER/.local/bin/onkyo -i <device_unique_id> zone2.power=on'

To power off zone2, execute:
ssh -i /config/.ssh/id_rsa -o 'StrictHostKeyChecking=no' <my_user>@<my_Debian_VM_IP_address> '/home/$USER/.local/bin/onkyo -i <device_unique_id> zone2.power=standby'

For additional commands just check the official onkyo-eiscp documentation.

For HA automation purposes you can now create the according shell scripts by using the HA shell_command integration according to your requirements.
Here’s an example shell_command out if my configuration.yaml file:

shell_command:
  debian01_onkyotxnr6100_01_zone2poweroff: ssh -i /config/.ssh/id_rsa -o 'StrictHostKeyChecking=no' user@debian '/home/$USER/.local/bin/onkyo -i 0008Y0F6BB09 zone2.power=standby' > /dev/null 2>&1 &

Hope this helps someone.

EDIT (14.08.2023):

Package installation on Debian 12 (and upwards):

My tutorial from above is based on Debian 11. If you are using Debian 12 or upwards, then by default Debian will not let you install the onkyo-eiscp python package as described above. You will receive the following error instead when trying to install the onkyo-eiscp package:

error: externally-managed-environment
This environment is externally managed...

This is due to Debian developers are preventing to mix package installations from apt repositories and pip respositories by default form now on, which absolutely makes sense.
However, there indeed do exist ways to bypass this limitation so you can get back the previous behaviour as in Debian 11, but I will not cover this here.
Instead I will show you the recommended way to set up a virtual pip environment as follows, which keeps you pip package installations abstracted from apt package installations in Debian 12 and upwards.

“onkyo-eiscp” package installation on Debian 12:

Install the following python virtual environment package along with all its dependencies and additional tools:
sudo apt update && sudo apt install python3.11-venv python3-pip

Navigate to your user’s home directory:
cd ~

Set up the python virtual environment within the user’s home directory:
python3 -m venv .venv

Enter (activate) the python virtual environment for the according user:
source .venv/bin/activate

Now you will be able to install the onkyo-eiscp package for the python virtual environment:
python3 -m pip install onkyo-eiscp

Set up communication between HA and your Onkyo receiver on Debian 12 (and upwards):

You can now execute the according Onkyo commands remotely from the HA terminal to the Debian VM, for example by executing the following command to discover the Onkyo receiver device (make sure your Onkyo receiver is powered (it does not matter if it’s on or off, it just has to have current) and connected to the network):
ssh -i /config/.ssh/id_rsa -o 'StrictHostKeyChecking=no' <my_user>@<my_Debian_VM_IP_address> '/home/$USER/.venv/bin/onkyo --discover'

The device should show up after a few seconds similiar to this (If not, make sure the receiver’s network interface is really within the same IP-subnet as the device you are executing the command from!):
TX-NR6100 192.168.100.20:60128 0008Y0F6BB09

The last 12-digit number (0008Y0F6BB09 in this case) is a unique id, every single Onkyo receiver has its own number. In fact it’s the device’s network interface’s MAC address. If you have multiple Onkyo receivers within your network, you can use this number to send commands to a specific device (as always, check the official onkyo-eiscp documentation for more information).

To power on zone2, execute:
ssh -i /config/.ssh/id_rsa -o 'StrictHostKeyChecking=no' <my_user>@<my_Debian_VM_IP_address> '/home/$USER/.venv/bin/onkyo -i <device_unique_id> zone2.power=on'

To power off zone2, execute:
ssh -i /config/.ssh/id_rsa -o 'StrictHostKeyChecking=no' <my_user>@<my_Debian_VM_IP_address> '/home/$USER/.venv/bin/onkyo -i <device_unique_id> zone2.power=standby'

For additional commands just check the official onkyo-eiscp documentation.

For HA automation purposes you can now create the according shell scripts by using the HA shell_command integration according to your requirements.
Here’s an example shell_command out if my configuration.yaml file:

shell_command:
  debian01_onkyotxnr6100_01_zone2poweroff: ssh -i /config/.ssh/id_rsa -o 'StrictHostKeyChecking=no' user@debian '/home/$USER/.venv/bin/onkyo -i 0008Y0F6BB09 zone2.power=standby' > /dev/null 2>&1 &

Sidenote: Please be aware that compared to the Debian 11 example from above, you will have to enter the abstracted python virtual environment everytime first before you can use the according onkyo-eiscp commands globally. In other words: Everytime you start a new command line session on your Debian VM and you want to use the onkyo-eiscp commands globally, you will have to execute the following command first:
source .venv/bin/activate
Alternatively you could also add the /home/$USER/.venv/bin path to your user’s environment variables.

Beware: I also mentioned in some cases it can happen that controlling the Onkyo receiver via its MAC-address does not work because it does not get detected (must have something to do with Layer2 discovery issues) where on the other hand it was indeed possible to control the Onkyo receiver via its IP-address as desribed on the official documentation on GitHub already linked above. You should definitely give that a try if connecting via MAC-address does not work, in my case it worked via IP-address then!

Hope this updated post helps someone.

Yes, it helped me. Thanks a bunch for posting these detailed instructions.
I got this to work on a Raspberry Pi 2 that I set up to replace an ageing Logitech Harmony hub.