JVC Projector Component

bezmi,

I tried this, none of the commands worked, I tried with and without quotes on the command itself as well as the leader (command).

The errors in the logs are

2020-01-03 10:23:55 ERROR (MainThread) [homeassistant.helpers.entity] Update for remote.rs6710 fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 281, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 461, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/jvcprojector/remote.py", line 44, in update
    self._state = self._jvc.is_on()
  File "/usr/local/lib/python3.7/site-packages/jvc_projector/__init__.py", line 116, in is_on
    message = self._send_command(Commands.power_status.value, ack = ACKs.power_ack.value)
  File "/usr/local/lib/python3.7/site-packages/jvc_projector/__init__.py", line 68, in _send_command
    jvc_sock.connect((self.host, self.port)) # connect to projector
ConnectionRefusedError: [Errno 111] Connection refused

That is very strange. Before proceeding further, just make sure that the IP address of the projector is correct from the settings menu. If you haven’t set it to static in your router, the IP may be reassigned. At the very least, I’d expect the power commands to work as you’re able to power on and off using the toggle in homeassistant, which is treated the same by the code that actually sends commands to the projector.

I’d like to confirm that the underlying code is working with your projector outside of the homeassistant environment. Here are the instructions for windows:

Installing Python and Pip on Windows

  1. Install the latest version of python 3.8.1 at this time. Make sure you select the “add python 3.8 to PATH” option. If you forget, the most straightforward way is to uninstall and reinstall python, remembering to check the box.
  2. Save this get-pip.py script to your Desktop
  3. Open Command Prompt and type cd Desktop and press enter.
  4. Now type python get-pip.py and press enter. It should output some stuff and finish with “Successfully installed pip-xx.x.x”.

Installing and using jvc-projector-remote

  1. In cmd, type pip install jvc_projector_remote and press enter.
  2. Launch IDLE, the python interpreter from your start menu.
  3. You should be at the python command line now.
  4. Type each of the following lines into the interpreter, followed by the enter key, assuming your projector is at IP 192.168.1.37:
from jvc_projector import JVCProjector
host = "192.168.1.37"
projector = JVCProjector(host)
  1. You’re set up to send commands. Try the following in the interpreter:
projector.power_on()

Your device should power on. Now try

projector.is_on()

which should return True.
6. Now try:

projector.command("hdmi2")

The values can be anything we discussed above in my previous post. Let me know how this goes.

Bezmi,

The ip address is correct in the configuration.yaml, is there anywhere else it needs to be input?

From the developer tools I can turn the projector on and off with the remote.turn_on or remote.turn_off commands and entity_id: remote.rs6710

from developer tools the remote.send_command

entity_id: remote.rs6710
command: power_off

this does not work


Mon Jan 06 2020 10:22:59 GMT-0600 (Central Standard Time)
Error handling message: expected dict for dictionary value @ data['service_data']. Got 'entity_id":"remote.rs6710 command:power_off'

I get the above error.

using the python module on my windows pc and your instructions. That does work I can turn the power on and off, get true or false indications on power status. Change hdmi input and lens memories it all works.

Okay, thanks for bringing this to my attention! Turns out I was a bit behind on more recent changes to homeassistant which made my code incompatible. I’ve quickly tested and pushed the change (literally adding one word to function definitions) to the repository. After re-installing the component, you should now be able to send a command from the developer tools by selecting the remote.send_command service with the service data YAML:

entity_id: remote.rs6710
command: power_on

Or any relevant command. Let me know how it goes. Apologies for not picking up on this earlier.

I haven’t yet tested the input_select configuration examples with the working code, so let me know if you get stuck on that.

Bezmi,

Now all of the commands work from the developer tools menu using the remote.send_command.

I tested Projector Input, projector memory and on / off. They all worked.

Now the only issue is it’s not working from the overview screen using the automation. I am sure I did something wrong but I can’t tell what it is. The configuration and automations yaml files are posted above.

Any ideas?

Thanks so much for the help.

hass is on the latest 103.6 update

If you copy and paste the example from here, adjusting the entity_id for your projector, does it not work? I will have to spend some time testing and updating the documentation if this is the case.

Bezmi,

Yes I used the example from Git, I posted my configuration and automations.yaml, the only thing I can see is the case difference. rs6710 vs RS6710 for the entity. Could that be the problem? Currently it doesn’t work.

Hi Bezmi,

Thanks creating and continuing to support this control. Even though I’m pretty new to HomeAssistant I managed to get it installed through HACS and sort of got it working last night with my JVC x790b. Just to confirm, 2 seperate cards end up getting created in lovelace… one for powering on/off and the other for hdmi/lens memory select ?

I have a few automations that i’ve created through the GUI which i see in the automations.yaml file
My problem is i cannot seem to get the JVC automations to co-exist with the existing automations.
When i check configuration under server controls, it complains about the automations.yaml and the controls do not work:

Configuration invalid

Error loading /config/configuration.yaml: while parsing a block mapping in “/config/automations.yaml”, line 57, column 3 (which isnt even JVC, it’s another ID of another automation)

I’ve tried pasting the JVC lines to automations.yaml at both the beginning and end of the file. It only seems to work for me if i remove all of the automations created in the gui, and ONLY include the JVC lines to automations.yaml - but that isn’t ideal.

My endgame plan is having tautulli provide a webhook to home assistant based on aspect ratio. That will trigger lens memory select in your component and also trigger a shelly 2.5 to open/close some motorized curtains for screen masking. If i create a new automation based on that webhook trigger, can it call the JVC lens memory automation?

Thanks!

Just trying to get the integration installed and running under HA for my JVC Projector. I installed via HACS easily enough and I’ve added the basic info to configuration.yaml. HA sees the entity but I am unable to call it from developer tools. I’ve tried remote.turn_on, remote.power_on, turn_on, power_on but nothing seems to work. Are there any other configurations needed or packages required get it up and going? As a side not I have installed and tested the connection to the projector from the Windows JVC remote command line app and it works fine. thx for any help :slight_smile:

Thanks for sharing this! I got this running for my JVC DLA NX7 and it works great.

Did you install the module too? From the HA terminal:

pip install jvc-projector-remote

Hi David, if you still haven’t got this sorted, see my response here for some troubleshooting steps: Controlling JVC projector via LAN

Thx for the reply bezmi. I think my issue is I don’t have the jvc-projector-remote python module installed and can’t figure out how to install it under hassos as there is no pip at the command line. Is there a way to install the python module under hassos?

Provided you installed the custom component, the python library should get pulled automatically as it’s listed as a requirement. I am doing some tests and there appears to be an issue with the remote.turn_on command (but not remote.turn_off). I have tried with a generic remote.send_command service call with data this shouldn’t be an issue anymore, see my reply below

entity_id: remote.your_projector_name
command: power_on

and this works fine for me. Could you please try this and let me know if it works for you? In the meantime I’ll try to troubleshoot why the dedicated turn_on command is not working.

There was a small bug in the function definition for turn_on. I’ve updated the github custom_component page so if this was causing your problems, then they should be resolved.

I know this is old, but I just went through a couple days trying to get this to work and finally did. I have a DLA-RS400 (same as DLA-X550), so that can be added to the working list. Here are some notes for users new to HA:

  1. If you are running HAOS, then you can use the Terminal & SSH addon to install PIP like so:

    apk add python3 py3-pip

  2. Install the Visual Studio Code addon and use it to edit your configuration.yaml file to add your projector.

remote:
  - platform: jvcprojector
    name: Theater Room Projector
    host: !secret jvc_ip
    scan_interval: 30
  1. Use Visual Studio Code to add to your automations.yaml file to add triggers and actions. Make sure the entity_id matches your projector. You can use Developer Tools under Services using the Remote:Turn On service to select the entity. Use GO TO YAML MODE and you can see the entity_id you should use.
  - alias: projector input
    trigger:
      platform: state
      entity_id: input_select.jvc_projector_input
    condition:
        - condition: state
          entity_id: remote.theater_room_projector
          state: 'on'
    action:
      service: remote.send_command
      data_template:
        entity_id: remote.theater_room_projector
        command: >-
            {% if is_state('input_select.jvc_projector_input', 'HDMI 1') %}
              hdmi1
            {% elif is_state('input_select.jvc_projector_input', 'HDMI 2') %}
              hdmi2
            {% endif %}
  1. You can add an Entities card to your dashboard to control it. Make sure the projector input switch stays on so you can switch your inputs with the Inputs drop down.
    image

  2. In your projector settings, you must make sure that the Control4 setting is turned OFF under Network options. While this is on, the projector will not expose port 20554, which means this integration won’t work.

I hope this helps others get started a lot quicker.

Man @OtisPresley thanks so much for this. (and of course to @bezmi as well for creating this) I was unable to get this working until I read thru this thread and got to the end. I am also on Hassio so the apk was the missing link for me. Thanks for saving me some troubleshooting time.

This works SO well with my JVC DLA-RS1000 (same as NX5). So much more reliable for on/off than my Harmony Remote using IR. Actually have it working through Emulated Roku + Harmony Remote to ensure the device properly powers on/off.

I see the remote entity in Home Assistant and within the attributes it shows last state, but I haven’t yet figured out how to get that information to surface elsewhere in HA. e.g. I’d like to show the status of the projector on/off within a lovelace card. Is this possible? Not sure if I missed this detail somewhere…

Good to hear it is working well for you. You should be able to do this with an entities card. See the “Special row elements” section for information on how to display an attribute.

1 Like

Hey All, just a quick note to say a BIG thank you to @bezmi and @OtisPresley for the integration and details. I have this working and at last the projector behalves the way it should and its power is integrated to all the other AV kit in our movie room. Thanks Guys :clap:

1 Like