Cannot connect/configure Pioneer VSX 1022-K

nop, still broken. From the log:

Pioneer Office AV Receiver (Pioneer VSX-1022K) refused connection
11:14:34 PM – pioneer (WARNING)

From notification:

image

my configuration.yaml:

############################################################
#
# Custom components
#
############################################################

smartir:
pioneer_avr:

Under custom components, I have a directory names pioneer_avr.

In that directory, I have two files, the first: __init__.py with the following content:

"""pioneer_avr custom component."""

the second is media_player.py

@jjhtpc Is yours still working w/115.1? Anything changed w/custom components?

Yes on 115.2 and this is still working. You may want to remove the components and reinstall. I haven’t had any problems though. I think I’m my router I did set a static ip for the receiver. Did your ip address change by any chance?

@friendodevil, @MattP , @tzyang I moved about 6 months ago and just setup this receiver again and found out that the integration is broken. The other pioneer integration out there does work, but it does not consistently discover and turn on the receiver. This one does a much better job. I have updated the code and it is out on the repo. https://github.com/jjhtpc/Pioneer-vsx-1022

1 Like

Thanks haha honestly I gave up on the receiver the network connection itself is really buggy, I just set it up with CEC connected to a smart tv and just control that instead

Thanks for this - I will try it out.

In case anyone finds this interesting - I have achieved much greater reliability over the last few years by taking advantage of the 2nd telnet port that is available on my unit. I use docker, so I use that to replace the component in the docker image with a modified file, which persists when I update the docker image.

I believe this helps while multiple simultaneous connections are made, but I am not sure. Logging indicates that the secondary port is used successfully often enough after initial failure.

First I added the ‘self._altport = 23’:

   def __init__(self, name, host, port, timeout, sources):
        """Initialize the Pioneer device."""
        self._name = name
        self._host = host
        self._port = 8102
        self._altport = 23 # addition here
        self._timeout = timeout
        self._pwstate = "PWR1"
        self._volume = 0
        self._muted = False
        self._selected_source = ""
        self._source_name_to_number = sources
        self._source_number_to_name = dict((v, k) for k, v in sources.items())

Then added a second try/except to use the ‘self._altport’ if the first is refused:

    def telnet_command(self, command):
        """Establish a telnet connection and sends command."""
        try:
            try:
                telnet = telnetlib.Telnet(self._host, self._port, self._timeout)
            except (ConnectionRefusedError, OSError):
                _LOGGER.warning("AVR %s refused connection on main port - %s", self._name, self._port)
                try:  # addition start
                    telnet = telnetlib.Telnet(self._host, self._altport, self._timeout)
                except (ConnectionRefusedError, OSError):
                    _LOGGER.error("AVR %s also refused connection on alt port %s", self._name, self._altport)
                    return
                _LOGGER.warning("Successful connection made to AVR on alt port %s", self._altport) # addition end
            telnet.write(command.encode("ASCII") + b"\r")
            telnet.read_very_eager()  # skip response
            telnet.close()
        except telnetlib.socket.timeout:
            _LOGGER.error("AVR %s - command %s - timed out", self._name, command)

@jjhtpc I’m hoping that you or one of the other contributors to the thread could help me out.

Firstly I’m new to HA so I’m stumbling about a bit here…

I’m trying to setup and old Onkyo NR-808, I know old… I’ve :

  • Created a pioneer_avr folder is custom_components
  • Copied the github code from Jun’22 post above into the folder
  • Restarted HA Services
  • Added the following into the configuration.yaml
  - platform: pioneer_avr 
    host: 192.168.0.219
  • Restarted HA Services

I then get the following in the Logs.

10:56:17.904 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration pioneer_avr: No setup or config entry setup function defined.

I haven’t put any parameters under the IP address in the config file as I (naively) thought that I would get a config popup when the integration was loaded ?

Thanks in advance !

media_player:
  - platform: pioneer_avr
    name: 'patio receiver'
    host: 10.0.0.39
    port: 8102

That is how it appears in my yaml, if course your ip will be the ip of the receiver.

Folder structure should be /config/custom_components/pioneer_avr/

With files:
init.py
manifest.json
media_player.py

Other than that this should work for any pioneer receiver that uses port8102.

I found the Pioneer platform less stable. For my three Pioneer receivers I’ve transitioned and use the Onkyo platform

- platform: onkyo
    host: <your receiver's local IP address>
    name: Living Room AV Receiver (Pioneer VSX-933)
    sources:
      video2: 'CBL/SAT'
      dvd: 'BD/DVD'
      usb: 'USB'
      network: 'INTERNET'
      strm-box: 'STRMBOX'

Hey, Thank you both for the responses.

Firstly I realised that I hadn’t removed the ‘_’ values from init.py. did that, restarted, un hashed the pioneer_avr section of configuration.yaml, restarted and the receiver entity entity was created. Unfortunately when executing an ‘On’ command the connection was refused. Which is pretty much the same error on the standard supported HA Onkyo and Pioneer Integrations…

2023-01-30 14:59:01.001 WARNING (SyncWorker_2) [custom_components.pioneer_avr.media_player] Pioneer Onkyo refused connection in command

One thing I did do on the day of posting my message was trying to see what ports are open on the amp using Telnet, but it doesn’t seem that 23 or 8102 provide any response.

The only port that I can easily find responding is 60128 which seems to be the correct port for sending the eiscp commands to the reciever. GitHub - miracle2k/onkyo-eiscp: Control Onkyo A/V receivers over the network; usuable as a script, or as a Python library.

I would like to point some basic on/off commands at the receiver using Telnet, but I can’t install / transfer the repository to the underlying HA set up as I’m running VM HA OS and it’s locked down for me to install onto.

I’m not sure what port the Onkyo / Integra Android apps communicate to though as the pre 2016 apps do work. I’ve taken a long shot and emailed 11 Trading Company who produce the Apps and seem to be part of the Onkyo / Pioneer stable to see what ports may be open on the 2010 model…

Onward and forward !

I fixed my issue… And I’m stupid…

I have a Unifi installation with a separate VLAN for all of my Home Automation. Weirdly I have never been able to get the TX-NR808 into that VLAN no matter how much a try to.

So I set up a direct route between the HA Server and the Onkyo Amp.

Yesterday I was trying to move some Docker Containers to the HA VLAN and rebuilt the Unifi Firewall Rules, but in the process realised that the Onkyo Rule was sitting below the Block across VLAN Rule.

Re-order the rules and hey presto Onkyo connects to HA and entities created…

Mmmmmm…