EPSON projector via the serial port

Mind posting your config so we can see how you implemented pypjlink?

Sure. Not home now, but I can try tomorrow :+1:

I installed the pypjlink as described and just use this config:

switch:
  - platform: command_line
    switches:
      projector_status_command_line:
        command_on: '/srv/homeassistant/bin/pjlink -p PROJECTOR_IP power on'
        command_off: '/srv/homeassistant/bin/pjlink -p PROJECTOR_IP power off'
        command_state: '/srv/homeassistant/bin/pjlink -p PROJECTOR_IP power'
        value_template: '{{ value == "on" }}'
        friendly_name: Prosjektor

I’m trying to do the same with my UHD51A, could you please explain how to install the pjlink script into HA? Thanks.

I just followed this page to install: https://blog.flowblok.id.au/2012-11/controlling-projectors-with-pjlink.html

I don’t use this anymore because they made the pjlink media player platform work. If none of them work for you, maybe you can’t connect to you projector? Have you tried tried the commands? Do you have web access? ping reply?

Thanks for answering. My Home Assistant is in a VM environment (Hyper-V), so I’m not sure I can use pip install to get Pjlink installed. I’ve tried the official Pjlink platform but somehow the projector (UHD51A) is not found. Other Pjlink software apps are able to find it and control it, so I’m a little lost here. I also get access to the web control page. If you have any ideas or suggestions, please let me know. Here’s the log when I try the Pjlink component. Thanks again!

Error while setting up platform pjlink
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, 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/src/homeassistant/homeassistant/components/pjlink/media_player.py", line 61, in setup_platform
    device = PjLinkDevice(host, port, name, encoding, password)
  File "/usr/src/homeassistant/homeassistant/components/pjlink/media_player.py", line 84, in __init__
    with self.projector() as projector:
  File "/usr/src/homeassistant/homeassistant/components/pjlink/media_player.py", line 96, in projector
    projector.authenticate(self._password)
  File "/usr/local/lib/python3.7/site-packages/pypjlink/projector.py", line 83, in authenticate
    assert data[:7] == 'PJLINK '
AssertionError

what is your config?

Pretty simple:

media_player:
  - platform: pjlink
    host: 10.10.12.41
    port: 4352
    name: UHD51A

Update: Other Pjlink software, scripts and apps do work with the projector

If you dont have pjlink, you can easily send rs232 commands with an esp8266 https://blog.lewys.eu/?p=765

If the IP and port is correct I have no idea, sorry. If other scripts work, couldn’t you just use those with the command_line switch I pasted above?

Wish I could, but my Home Assistant is in VM so I cannot install pypjlink. I guess my only option is going back in time and use telnet commands…

Here’s what I ended up doing, in case someone ends up in the same situation as me (Pjlink official component not recognizing my Optoma UHD51A). With this command line switch you can use the same Pjlink protocol:

  - platform: command_line
    scan_interval: 10
    switches:
      optoma:
        friendly_name: "Optoma UHD51A 4K"
        command_on: echo -e "%1POWR 1\r" | nc 10.10.12.41 4352
        command_off: echo -e "%1POWR 0\r" | nc 10.10.12.41 4352
        command_state: echo -e "%1POWR ?\r" | nc 10.10.12.41 4352 | tr '\r' '\n'
        value_template: '{{ value == "pjlink 0\n%1powr=1" }}'

My projector returns power state in the form of

pjlink 0
%1powr=1

so I had to add \n in the middle to make value_template work.

Now the only issue has to do with how command_state works: when I switch the projector on, the state of the switch goes ON for one second, then OFF for like 20 seconds and finally ON. That’s because my projector takes 20 seconds to go from %1powr 0 to %1powr 1 when turned ON, and viceversa when turned OFF. It’s mostly a visual inconvenience, but I wonder if someone can think of a way to delay command_state check for 20 seconds after the switch has been turned on or off.

Nice👌
I had a 20 sec startup too, but was never a problem so didn’t try to fix.

Just out of curiosity, with the official Pjlink component, do you have the same 20-sec delay?

Hi all, sorry for bumping this up. I’m a newbie to HA and I’m trying to change the lens zoom settings in my Epson 6050UB. I can connect to it via pjlink media player integration, but I have not been able to figure out how to send it commands outside of the media_player command list. I have the command I want from the Epson ESC/VP21 but just don’t know the format for pjlink. Can someone share a script or automation file showing how to actually send commands through the pjlink media player integration?