iloveicedgreentea / jvc_homeassistant Goto Github PK
View Code? Open in Web Editor NEWJVC Integration for Home Assistant
JVC Integration for Home Assistant
The power status stopped working. The other functions work well.
Hello,
I use a JVC N5 projector in my home theater. Currently I have connected the projector via the FHEM Smart Home software. I would now like to switch to the Home Assistant component. Unfortunately, I am currently missing the following command in the Home Assistant component:
"Lens Control“
This command opens directly the focus menu without the need to enter it via the setup menu.
According to JVC documentation, the command can be called via the following remote code:
Hex Code: 21 89 01 52 43 37 33 33 30 0A
ASCII: 30
Source (Page 10)
In FHEM it is possible to send a specific remote code. I use the remote code 30 to execute the command.
Could this command also be implemented in the Home Assistant component?
Maybe you could integrate a command to send any ASCII remote code?
I have quite a lot of errors in HA.
Below is the debug of the connection. I guess you need add this model.
2023-08-25 15:23:29.813 DEBUG (SyncWorker_4) [custom_components.jvc_projectors.remote] Starting open connection
2023-08-25 15:23:29.813 INFO (SyncWorker_4) [custom_components.jvc_projectors.remote] Connecting to JVC Projector: 192.168.0.3:20554
2023-08-25 15:23:29.814 INFO (SyncWorker_4) [custom_components.jvc_projectors.remote] Connected to JVC Projector
2023-08-25 15:23:29.815 DEBUG (SyncWorker_4) [custom_components.jvc_projectors.remote] Handshaking
2023-08-25 15:23:29.815 DEBUG (SyncWorker_4) [custom_components.jvc_projectors.remote] b'PJ_OK'
2023-08-25 15:23:29.816 DEBUG (SyncWorker_4) [custom_components.jvc_projectors.remote] Handshake successful
2023-08-25 15:23:29.816 DEBUG (SyncWorker_4) [custom_components.jvc_projectors.remote] Command_type: b'?'
2023-08-25 15:23:29.817 DEBUG (SyncWorker_4) [custom_components.jvc_projectors.remote] Send command: b'?\x89\x01MD\n' is of type <class 'bytes'>
2023-08-25 15:23:29.817 DEBUG (SyncWorker_4) [custom_components.jvc_projectors.remote] Send ack: b'MD'
2023-08-25 15:23:29.817 DEBUG (SyncWorker_4) [custom_components.jvc_projectors.remote] do_command sending command: b'?\x89\x01MD\n'
2023-08-25 15:23:29.818 DEBUG (SyncWorker_4) [custom_components.jvc_projectors.remote] constructed ack_value: b'\x06\x89\x01MD\n'
2023-08-25 15:23:29.818 DEBUG (SyncWorker_4) [custom_components.jvc_projectors.remote] received msg from PJ: b'\x06\x89\x01MD\n'
2023-08-25 15:23:29.919 DEBUG (SyncWorker_4) [custom_components.jvc_projectors.remote] received message from PJ: b'@\x89\x01MDILAFPJ -- XHS1\n'
2023-08-25 15:23:29.919 DEBUG (SyncWorker_4) [custom_components.jvc_projectors.remote] MDILAFPJ -- XHS1
2023-08-25 15:23:29.919 DEBUG (SyncWorker_4) [custom_components.jvc_projectors.remote] Model code is Unsupported
2023-08-25 15:23:29.919 DEBUG (SyncWorker_4) [custom_components.jvc_projectors.remote] Handshake complete and we are connected
Hey, thank you for the updated script. The state pulling works perfectly. If you need me to test finished functions on an NZ8, let me know.
Hi - All was working fine until recent updates and i now get this error in home assistant any ideas?
2023-02-02 16:41:53.827 ERROR (MainThread) [homeassistant.components.remote] Error adding entities for domain remote with platform jvc_projectors
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 717, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 814, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 566, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 610, in _async_write_ha_state
attr.update(self.extra_state_attributes or {})
File "/config/custom_components/jvc_projectors/remote.py", line 121, in extra_state_attributes
if "NZ" in self._model_family:
TypeError: argument of type 'NoneType' is not iterable
I get this error:
Platform error remote.jvc_projectors - cannot import name 'GAMING_MODE_HDR_COMMAND' from 'custom_components.jvc_projectors.const' (/config/custom_components/jvc_projectors/const.py)
Using this in my configuration.yaml
file:
remote:
- platform: jvc_projectors
name: JVC Projector
password: abc123
host: 192.168.1.163
scan_interval: 15
This appears to be a regression introduced in version 2.0.6. If I downgrade to v2.0.5, I do not get this error when I run Check Configuration in HASS.
Hi all,
since the latest update the integration that has been setup through the HA UI seems to loose connection to my NZ8. (setup using yaml is not accepted anymore?)
All sensors showing unavailable and the remote is not able to turn on/off the device. Its only working after the initial setup (for a few seconds). At least its seems so...
Any Idea what i could/should check ?
BR
Add a config flow UI so the integration can be dynamically reloaded and set up without editing config
The laser_dim command as listed in the documentation does not work. It returns a “command not implemented” error. Looking at the code, this should be updated to laser_mode which does work to change the laser dimming mode (Dynamic CTRL in the JVC menu).
Hi,
Thanks for your great component and all of the work/time you put in it.
The JVC dla-np5 projector is turning on and off sometimes using this component, but a lot of errors appeared in the log, how to troubleshoot?
This error originated from a custom integration.
Logger: custom_components.jvc_projectors.remote
Source: custom_components/jvc_projectors/remote.py:149
Integration: jvc_projectors
First occurred: 09:46:15 (121 occurrences)
Last logged: 09:51:47
Connection timed out. Command b'?\x89\x01PMDC\n' is probably not allowed to run at this time.
Connecting failed, retrying in 2 seconds
retry count for running commands exceeded
This error originated from a custom integration.
Logger: homeassistant.helpers.entity
Source: custom_components/jvc_projectors/remote.py:149
Integration: jvc_projectors
First occurred: 09:46:37 (11 occurrences)
Last logged: 09:51:47
Update for remote.cinema_projector fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 527, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 730, in async_device_update
await task
File "/home/homeassistant/.homeassistant/custom_components/jvc_projectors/remote.py", line 149, in async_update
self._laser_mode = await self.jvc_client.async_get_laser_mode()
File "/srv/homeassistant/lib/python3.10/site-packages/jvc_projector/jvc_projector.py", line 469, in async_get_laser_mode
return LaserDimModes(state.replace(ACKs.picture_ack.value, b"")).name
TypeError: replace() argument 1 must be str, not bytes
This error originated from a custom integration.
Logger: homeassistant.helpers.entity
Source: custom_components/jvc_projectors/remote.py:146
Integration: jvc_projectors
First occurred: 09:51:52 (2 occurrences)
Last logged: 09:52:07
Update for remote.cinema_projector fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 527, in async_update_ha_state
await self.async_device_update()
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 722, in async_device_update
raise exc
File "/home/homeassistant/.homeassistant/custom_components/jvc_projectors/remote.py", line 146, in async_update
self._lowlatency_enabled = await self.jvc_client.async_get_low_latency_state()
File "/srv/homeassistant/lib/python3.10/site-packages/jvc_projector/jvc_projector.py", line 421, in async_get_low_latency_state
state, _ = await self._async_do_reference_op(
File "/srv/homeassistant/lib/python3.10/site-packages/jvc_projector/jvc_projector.py", line 400, in _async_do_reference_op
msg, success = await self._async_send_command(
File "/srv/homeassistant/lib/python3.10/site-packages/jvc_projector/jvc_projector.py", line 150, in _async_send_command
result, success = await self._async_do_command(
File "/srv/homeassistant/lib/python3.10/site-packages/jvc_projector/jvc_projector.py", line 225, in _async_do_command
received_ack = await asyncio.wait_for(
File "/usr/lib/python3.10/asyncio/tasks.py", line 447, in wait_for
return fut.result()
File "/usr/lib/python3.10/asyncio/streams.py", line 525, in readline
line = await self.readuntil(sep)
File "/usr/lib/python3.10/asyncio/streams.py", line 617, in readuntil
await self._wait_for_data('readuntil')
File "/usr/lib/python3.10/asyncio/streams.py", line 488, in _wait_for_data
raise RuntimeError(
RuntimeError: readuntil() called while another coroutine is already waiting for incoming data
This error originated from a custom integration.
Logger: custom_components.jvc_projectors.remote
Source: custom_components/jvc_projectors/remote.py:141
Integration: jvc_projectors
First occurred: 09:52:14 (19 occurrences)
Last logged: 09:52:44
Got a blank ack. Restarting connection
Connecting failed, retrying in 2 seconds
Projector did not reply with correct PJ_OK greeting: b''
Connection lost
retry count for running commands exceeded
This error originated from a custom integration.
Logger: custom_components.jvc_projectors.remote
Source: custom_components/jvc_projectors/remote.py:146
Integration: jvc_projectors
First occurred: 09:41:58 (249 occurrences)
Last logged: 09:59:05
Connection lost
Connecting failed, retrying in 2 seconds
Got a blank ack. Restarting connection
retry count for running commands exceeded
Connection timed out. Command b'?\x89\x01PMLL\n' is probably not allowed to run at this time.
I'm on homeassistant 2022.12.7 and am using v3.0.0 of your component.
How to troubleshoot/debug?
I get the exception below each time the scan_interval
is triggered (15s). I'm not sure what the issue is. I double checked my NZ7 password and IP address. I ensured that, on my projector, DHCP Client and Control4 SDDP are set to "On".
My configuration.yaml
currently has this:
remote:
- platform: jvc_projectors
name: nz7
password: snip
host: '192.168.1.163'
scan_interval: 15
Currently using v3.5.3 of JVC Projectors in HACS. My JVC NZ7 FW is at v2.0.
If there's further diagnostic I can provide, please let me know. Thank you.
This error originated from a custom integration.
Logger: homeassistant.helpers.entity
Source: custom_components/jvc_projectors/remote.py:217
Integration: jvc_projectors
First occurred: 4:24:28 PM (13 occurrences)
Last logged: 4:27:28 PM
Update for remote.nz7 fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 538, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 736, in async_device_update
raise exc
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/jvc_projectors/remote.py", line 217, in update
self.jvc_client.get_theater_optimizer_state()
File "/usr/local/lib/python3.10/site-packages/jvc_projector/jvc_projector.py", line 554, in get_theater_optimizer_state
state, _ = self._do_reference_op("theater_optimizer", ACKs.picture_ack)
File "/usr/local/lib/python3.10/site-packages/jvc_projector/jvc_projector.py", line 447, in _do_reference_op
msg, success = self._send_command(
File "/usr/local/lib/python3.10/site-packages/jvc_projector/jvc_projector.py", line 222, in _send_command
result, success = self._do_command(send_command, ack, command_type)
File "/usr/local/lib/python3.10/site-packages/jvc_projector/jvc_projector.py", line 330, in _do_command
message = self.client.recv(1000)
TimeoutError: timed out
I'm seeing about 25% higher than normal CPU usage that seems to go down when I disable this integration. Debug logs show the following:
2024-04-30 23:23:26.039 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Checking connection to JVC projector
2024-04-30 23:23:26.282 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Null command response: b'\x06\x89\x01\x00\x00\n'
2024-04-30 23:23:26.286 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Connection to JVC projector is OK
2024-04-30 23:23:31.545 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Checking connection to JVC projector
2024-04-30 23:23:31.736 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Null command response: b'\x06\x89\x01\x00\x00\n'
2024-04-30 23:23:31.736 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Connection to JVC projector is OK
2024-04-30 23:23:36.993 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Checking connection to JVC projector
2024-04-30 23:23:37.254 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Null command response: b'\x06\x89\x01\x00\x00\n'
2024-04-30 23:23:37.255 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Connection to JVC projector is OK
2024-04-30 23:23:42.513 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Checking connection to JVC projector
2024-04-30 23:23:42.779 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Null command response: b'\x06\x89\x01\x00\x00\n'
2024-04-30 23:23:42.779 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Connection to JVC projector is OK
2024-04-30 23:23:49.107 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Checking connection to JVC projector
2024-04-30 23:23:49.318 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Null command response: b'\x06\x89\x01\x00\x00\n'
2024-04-30 23:23:49.319 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Connection to JVC projector is OK
I usually see NP5 in the model field when it's working but now I'm not getting anything:
I'm running v4.4.09 on HA 2024.4.4
Currently causes a deadlock when async_update() runs
hangs on
try:
received_ack = await self.reader.read(len(ack_value))
which suggests the PJ was expecting a write. Possibly an issue with reading too much or something is not being written first
I recently upgraded from 3.7.3 to 4.1.1 and with that HA suggested I move to the config flow instead of YAML. I moved the config over and since then, HA is not connecting to my projector and I'm getting the following repeatedly in the logs:
Logger: homeassistant.helpers.entity
Source: helpers/entity.py:898
First occurred: February 18, 2024 at 4:53:21 PM (289 occurrences)
Last logged: February 18, 2024 at 11:06:01 PM
Update for remote.theater_projector fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 898, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1216, in async_device_update
await self.async_update()
File "/config/custom_components/jvc_projectors/remote.py", line 354, in async_update
attribute_getters.append(
TypeError: list.append() takes exactly one argument (2 given)
PS. To mitigate confusion, it might be helpful if the first and last fields in the config flow dialog were labelled so the user can clearly understand what information each box is looking for:
I noticed after adding my JVC NP5 to HA, while everything was working great, I went to run the JVC AutoCal software which connects to the projector over the network, and it was not able to connect. After commenting out the yaml config and restarting HA, the software was able to connect to the projector again. Is this a limitation of the projector or do you think something can be done in the integration to fix this?
Dear developer(s),
Apparently this integration has the ability to lock up the projector. I've had this in two instances. The projector wouldn't respond to any commands, not from the remote control, nor from the buttons on the back (nor from home assistant). The only way to shut the projector down and regain control, is by cutting the power. Perhaps it's a bug, perhaps the way I'm using the integration.
Details:
Current home assistant version: 2024.4.4 (although I've had the same issue a couple of weeks ago on an older version, stil running on a RP4)
Current integration version: pre-release 4.4.08
Projector: JVC NP5 (US: DLA-RS1100)
System: NUC with intel N100
My home cinema (with Denon receiver, JVC projector and Apple TV) is behind a Zigbee plug to cut down standby power usage. I've got an automation which stops and starts the integrations pertaining to the aforementioned devices). If I don't do it, my log's are filled with 'can't connect' errors.
Attached is my entire log file for the JVC integration but I'll quote some lines from it. Might be different issues.
On start up (and than repeat):
2024-04-24 13:29:44.960 ERROR (MainThread) [custom_components.jvc_projectors.remote] Attribute not found - b'00FD' is not a valid ResolutionModes
2024-04-24 13:29:44.960 ERROR (MainThread) [custom_components.jvc_projectors.remote] ValueError in handle_queue: b'00FD' is not a valid ResolutionModes
2024-04-24 13:29:45.764 ERROR (MainThread) [custom_components.jvc_projectors.remote] Attribute not found - b'IF0300PJ' is not a valid ColorSpaceModes
2024-04-24 13:29:45.765 ERROR (MainThread) [custom_components.jvc_projectors.remote] ValueError in handle_queue: b'IF0300PJ' is not a valid ColorSpaceModes
2024-04-24 13:29:46.168 ERROR (MainThread) [custom_components.jvc_projectors.remote] Attribute not found - b'IS0' is not a valid PowerModes
2024-04-24 13:29:46.169 ERROR (MainThread) [custom_components.jvc_projectors.remote] ValueError in handle_queue: b'IS0' is not a valid PowerModes
2024-04-24 13:29:46.570 ERROR (MainThread) [custom_components.jvc_projectors.remote] Attribute not found - b'PW1' is not a valid SourceStatuses
2024-04-24 13:29:46.570 ERROR (MainThread) [custom_components.jvc_projectors.remote] ValueError in handle_queue: b'PW1' is not a valid SourceStatuses
2024-04-24 13:29:46.972 ERROR (MainThread) [custom_components.jvc_projectors.remote] Attribute not found - b'SC1' is not a valid AnamorphicModes
2024-04-24 13:29:46.973 ERROR (MainThread) [custom_components.jvc_projectors.remote] ValueError in handle_queue: b'SC1' is not a valid AnamorphicModes
2024-04-24 13:29:47.374 ERROR (MainThread) [custom_components.jvc_projectors.remote] Attribute not found - b'IN0' is not a valid InputLevel
2024-04-24 13:29:47.374 ERROR (MainThread) [custom_components.jvc_projectors.remote] ValueError in handle_queue: b'IN0' is not a valid InputLevel
2024-04-24 13:29:47.775 ERROR (MainThread) [custom_components.jvc_projectors.remote] Attribute not found - b'3' is not a valid MaskModes
2024-04-24 13:29:47.775 ERROR (MainThread) [custom_components.jvc_projectors.remote] ValueError in handle_queue: b'3' is not a valid MaskModes
2024-04-24 13:29:48.176 ERROR (MainThread) [custom_components.jvc_projectors.remote] Attribute not found - b'IS2' is not a valid ContentTypes
2024-04-24 13:29:48.177 ERROR (MainThread) [custom_components.jvc_projectors.remote] ValueError in handle_queue: b'IS2' is not a valid ContentTypes
2024-04-24 13:29:48.979 ERROR (MainThread) [custom_components.jvc_projectors.remote] Attribute not found - b'PM0' is not a valid InputModes
2024-04-24 13:29:48.979 ERROR (MainThread) [custom_components.jvc_projectors.remote] ValueError in handle_queue: b'PM0' is not a valid InputModes
2024-04-24 13:29:49.382 ERROR (MainThread) [custom_components.jvc_projectors.remote] Attribute not found - b'IP6' is not a valid PictureModes
2024-04-24 13:29:49.382 ERROR (MainThread) [custom_components.jvc_projectors.remote] ValueError in handle_queue: b'IP6' is not a valid PictureModes
2024-04-24 13:29:53.358 ERROR (MainThread) [custom_components.jvc_projectors.remote] Attribute not found - b'PM03' is not a valid AspectRatioModes
2024-04-24 13:29:53.359 ERROR (MainThread) [custom_components.jvc_projectors.remote] ValueError in handle_queue: b'PM03' is not a valid AspectRatioModes
2024-04-24 13:29:53.761 ERROR (MainThread) [custom_components.jvc_projectors.remote] Attribute not found - b'IS3' is not a valid ContentTypeTrans
2024-04-24 13:29:53.762 ERROR (MainThread) [custom_components.jvc_projectors.remote] ValueError in handle_queue: b'IS3' is not a valid ContentTypeTrans
2024-04-24 13:29:54.162 ERROR (MainThread) [custom_components.jvc_projectors.remote] Attribute not found - b'PM1' is not a valid InstallationModes
2024-04-24 13:29:54.163 ERROR (MainThread) [custom_components.jvc_projectors.remote] ValueError in handle_queue: b'PM1' is not a valid InstallationModes
2024-04-24 13:29:54.564 ERROR (MainThread) [custom_components.jvc_projectors.remote] ValueError in handle_queue: invalid literal for int() with base 16: b'IN0'
Then there is:
2024-04-24 17:56:18.567 WARNING (MainThread) [asyncio] socket.send() raised exception. (x200 or so)
After which I noticed that the projector had locked up/crashed and was unresponsive. Cut the power en shut down the JVC add-on. Might be unrelated as I see errors in my scripts as well.
Is there a way to research and troubleshoot this issue?
Logger: homeassistant.components.remote
Source: custom_components/jvc_projectors/remote.py:49
Integration: Remote (documentation, issues)
First occurred: 12:43:30 (1 occurrences)
Last logged: 12:43:30
Error while setting up jvc_projectors platform for remote
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 289, 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 "/home/homeassistant/.homeassistant/custom_components/jvc_projectors/remote.py", line 49, in setup_platform
jvc_client.open_connection()
File "/srv/homeassistant/lib/python3.10/site-packages/jvc_projector/jvc_projector.py", line 60, in open_connection
msg, success = self.reconnect()
File "/srv/homeassistant/lib/python3.10/site-packages/jvc_projector/jvc_projector.py", line 75, in reconnect
self.client.settimeout(self.connect_timeout)
TypeError: 'str' object cannot be interpreted as an integer
Hi, I'm trying to set buttons for recalling lens memory in Home Assistant, but can't figure out what commands to use.
"memory,memory1", "memory,memory2" used to work in older versions, but it's no longer working. I list of commands would be very useful. Thank you. George
None of the four services work:
I get an error when I push the buttons on the remote you have in your README. For example, this button:
- type: button
tap_action:
action: call-service
service: jvc_projectors.gaming_mode_hdr
service_data: {}
target:
entity_id: remote.jvc_projector
show_icon: false
show_name: true
hold_action:
action: none
name: Game HDR
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.