Sony Projector PJLink Error

I’m trying to setup a Sony VPL-PWZ10 Projector with PJLink. Here’s what I have in /config/configuration.yaml

media_player:
 - platform: pjlink
   host: 10.0.12.20
   password: thisisnotmypassword

I’m getting this error.

Error while setting up platform pjlink
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/pjlink/media_player.py", line 50, in setup_platform
    device = PjLinkDevice(host, port, name, encoding, password)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/pjlink/media_player.py", line 75, in __init__
    self._name = projector.get_name()
  File "/usr/local/lib/python3.7/site-packages/pypjlink/projector.py", line 227, in get_name
    param = self.get('NAME')
  File "/usr/local/lib/python3.7/site-packages/pypjlink/projector.py", line 130, in get
    success, response = protocol.send_command(self.f, body, '?', self.encoding)
  File "/usr/local/lib/python3.7/site-packages/pypjlink/protocol.py", line 71, in send_command
    resp_body, resp_param = parse_response(f, encoding)
  File "/usr/local/lib/python3.7/site-packages/pypjlink/protocol.py", line 29, in parse_response
    header = data[0]
IndexError: string index out of range

I think the main part is the “string index out of range”. I have PJLink enabled in the Sony Projector through the web and I have the password set. I tried without a password and disabled the password in the Sony web interface, but Home Assistant gave an error that a password was required.


I ran a port scan and that shows port 4352 open, which is the default port for PJLink.

I had a similar error going on my Canon projector along with some other errors. I changed the default name of my projector from “Canon Projector” to “4k600z” (the model number) and it started working. I have a feeling removing spaces from the name might have been what fixed it.