JVC Projector Component

I have released v2.0.0a3. It should greatly improve compatibility with newer projectors, among other bugfixes. Please give it a go and report back, there aren’t many users with the newest models that I know of.

If you are able to use this component without issues, I am inclined to push out the final v2.0.0 and start preparing for v3.0.0 which will allow web interface configuration and settings tweaks and hopefully bring the component up to the latest homeassistant standards.

1 Like

Wow that was fast :slight_smile: Just saw it. I will check it later on and let you know!

Update: looks better now:

 Logger: custom_components.jvcprojector.remote
Source: custom_components/jvcprojector/remote.py:105
Integration: jvcprojector (documentation)
First occurred: 17:33:17 (78 occurrences)
Last logged: 18:11:47
Couldn't connect to the projector at the specified address: 10.2.0.50:20554. Ensure the configuration is correct.

I will check again when i have turned on the projector later on.

Looks good, but i had to restart HA after turning the projector on before it worked out.

Let me know what you need me to test! :slight_smile:

Is there a way/command to control CMD, eShift and graphics mode as well?

but i had to restart HA after turning the projector on before it worked out.

Yes, I find that this is often the case. Unfortunately it is quite a pain to debug and optimise the communications as JVCs protocol is not great and has many quirks. Given how long the projector takes to restart, you can imagine how frustrating debugging these things can get. Hopefully writing v3 with web ui config flow will give me an opportunity to refactor some of the communications code.

Let me know what you need me to test!

Just go through the attributes in that list and make sure that they are working. Put it through regular usage and check the logs reasonably often, let me know if any weird warnings/error messages appear.

Is there a way/command to control CMD, eShift and graphics mode as well?

Not yet, but I try to add extra commands whenever I update the python library, so I’ll put them on the list.

Everything worked out well so far! Attributes where showing corresponding states. It might be even faster then the original remote which really sucks.

Is there a way to get the attribute states into a separate entity (like a status entity)? I am not a coder but please let me know if i can be of any help :slight_smile:

Is there a way to get the attribute states into a separate entity (like a status entity)?

Maybe try a markdown card.

Thanks for the hint. I have figured out how to use a template sensor like:

platform: template
sensors:
  nz8_power_state:
    value_template: "{{ state_attr('remote.nz8', 'power_state') }}"
    friendly_name: NZ8 Powerstate
    icon_template: mdi:power

Hi everyone, I have released v2.0.0 (stable) of the addon. No big changes from the alpha releases, except a bugfix for the annoying issue where the remote in homeassistant would briefly toggle back to ‘off’ when turning the projector on from the dashboard. This will be the last release that is configured through configuration.yaml

The current master branch contains a mostly working implementation of the component with a config flow based setup, which will be the v2.1.0 release. I aim to have it set up as a JVC projector device, with many entities:

  • the remote entity that we all know and love (same extra state attributes, etc so all existing automations work fine)
  • lots of (configurable) sensors allowing you to expose many of the projector attributes. This really needs to be configurable, as the projector I own (x5900) has issues with trying to access many things in quick succession. See my note below.

Once the config flow system is stable and well documented, I will start the push to integrate it into homeassistant core with all of the required clean up that will go along with that.

Note: if you have an NZ series projector, reduce the delay parameter in your configuration.yaml for the component and let me know the lowest value before the component starts misbehaving. On my projector, the limit approx 600-700ms before I start getting connection errors.

1 Like

Hi @bezmi ,

thanks for the update! i can check the delay setting for my NZ8 and let you know.

Update: set it to 450 yesterday and could not recognize issues while switching lasermode…

Hey @bezmi ,

Saw that I’m supposed to post here instead of as an issue on Github(I opened it before I saw that comment :-X )

I had this working for months, disabled it to troubleshoot something, and now it won’t re-enable :frowning:

Here’s the error showing up in HASS logs:

Error while setting up jvcprojector platform for remote
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/jvc_projector_remote/jvccommands.py", line 109, in __verify_ack
    ACK = sock.recv(COM_ACK_LENGTH)
TimeoutError: timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/jvcprojector/remote.py", line 40, in setup_platform
    JVCRemote(name, host, password, port, delay, timeout, retries),
  File "/config/custom_components/jvcprojector/remote.py", line 72, in __init__
    self._jvc = JVCProjector(self._conf_host, self._conf_password, self._conf_port, self._conf_delay, self._conf_timeout, self._conf_retries)
  File "/usr/local/lib/python3.10/site-packages/jvc_projector_remote/jvcprojector.py", line 55, in __init__
    self.validate_connection()
  File "/usr/local/lib/python3.10/site-packages/jvc_projector_remote/jvcprojector.py", line 174, in validate_connection
    self._send_command(Commands.nullcmd)
  File "/usr/local/lib/python3.10/site-packages/jvc_projector_remote/jvcprojector.py", line 153, in _send_command
    command.write(jvc_sock)
  File "/usr/local/lib/python3.10/site-packages/jvc_projector_remote/jvccommands.py", line 173, in write
    self.__verify_ack(sock, command)
  File "/usr/local/lib/python3.10/site-packages/jvc_projector_remote/jvccommands.py", line 127, in __verify_ack
    raise JVCCommunicationError(
jvc_projector_remote.jvccommands.JVCCommunicationError: Timeout when waiting for the specified ACK: `b'\x06\x89\x01\x00\x00\n'` for command: `nullcmd` with bytes: `b'!\x89\x01\x00\x00\n'`

Any ideas? Thank you! Love this addon!

EDIT: Just installed v1.0.2 and that seems to work. I have an NX7 projector. I’ll continue messing around with stuff. Or at least, the projector shows up with no errors. Seems like 1.0.2 slows down my HASS install a ton, and takes upwards of 45 seconds to load pages like HACS. Couldn’t really test.

EDIT 2: Ok, looking at HASS backups from early November(definitely working), I was on 2.0.0a3. Reinstalled that and get same error.

I’ve just released my integration to read the status:
JVC DILA sensor - Third party integrations - Home Assistant Community (home-assistant.io)

For anyone else who might have this issue, Check out the issue on github for a fix that works. The issue is still open, as I’m working on refactoring communications to be more reliable.

1 Like

Any reason why you’re not using this component with helper entities to read the attributes? I think we can be more productive and create a better user experience if we work together on a singular codebase, so if you have any issues/suggestions/criticisms, then let me know.

FYI, with version 2.1.0, I will be releasing sensor entities which hold some of the state variables, as well as improving communications so they’re more reliable.

1 Like

@bezmi in reality I searched for a component multiple times… and did not found yours :(… so I decided to develop my own… and when I published it I discovered yours :slight_smile:
super happy to work together.
Mine is super simple compared to yours that is very complete and nice.
My objective was to have only the status of the projector, not to act on it (to avoid issues)… also I wanted to avoid external dependancies.
What I was planning to do was to add a config:flow and see if I was able to go for async to get platinum level integration badge :slight_smile: but I’m not (yet) that good in python (is my first program in it :))

I’m checking your component and is very nice. The major difference I found so far that I consider a timeout as a PowerOff and I added a binary sensor (on - off) to make my automations easier.

@bezmi for your info I get this " This entity (‘remote.jvc_dila_x30’) does not have a unique ID, therefore its settings cannot be managed from the UI. See the documentation for more detail."
It would be great you add an unique id to avoid the error

Although avoiding external dependencies is entirely possible, decoupling the control logic in a standalone python library from the homeassistant component has proven to be very useful. I have seen some instances where people have used my python library to write plugins for other (non-home assistant) automation systems.

FYI, Unique ID is in the current master branch, along with config flow setup via the UI. It mostly works, but is still actively worked on and could break any time. There are plans to improve the communications in the python library and add status items as sensors to the homeassistant integration, similar to what you have done, before releasing v2.1.0.

@bezmi it is very good! I was thinking the same and trying to use the library
to be honest with you I would suggest to do 2 components, one with status/actions - that is yours.
One with only status - that is mine.
As in my case I do not want to have any possibility to issue an action (even by mistake) as it would mess up with the projector. I really want a components that “reads” only the status.
For my scenario the only relevan one is on/off (the binary sensor) but it could be great to have even the other ones, maybe it should be a configuration on which entities to create as if there are to many info the projector can get banged by too many requests… as there should be some time between one and the other (0.6s) it could create quite a gap between the checks (i.e. 10 properties = 10*0.6 + handshake > 8 secs :))

does this make sense?

Is anyone also having troubles to read certain attributes? For me it was working but it somehow seems to be broken… for example: lasermode and latency

platform: template
sensors:
  nz8_latency_state:
    value_template: "{{ state_attr('remote.nz8_remote', 'low_latency') }}"
    friendly_name: NZ8 Latency Mode
    #icon_template: mdi:power
    unique_id: 240cf4e1-7eac-454f-a751-ecf65c054e1d
platform: template
sensors:
  nz8_laser_mode:
    value_template: "{{ state_attr('remote.nz8_remote', 'lamp') }}"
    friendly_name: NZ8 Lasermode
    #icon_template: mdi:power
    unique_id: 7fe97b28-75ce-48bc-814a-8d774df6c838

Picture Mode for example is still working fine:

platform: template
sensors:
  nz8_picture_mode:
    value_template: "{{ state_attr('remote.nz8_remote', 'picture_mode') }}"
    friendly_name: NZ8 Picturemode
    #icon_template: mdi:power
    unique_id: dcf20ff1-2d2d-45fb-9ff4-a610e110dbc7

Can you please post an issue on the github repository with any relevant error messages so I may test?

EDIT: resolved here. Basically, only some things are valid state_attr and in order to retrieve something that isn’t one of those, you must send it as a command and then look at the last_commands_response attribute.

Done that… to be honest i am not sure if its an addon issue or my fault :slight_smile: