Closed hashtag8 closed 2 years ago
Thanks, good catch. I already handle the error in the python library, so a small change to this component should be able to catch the JVCCommunicationError and output a nice message.
This should be implemented in the commit referenced above. If needed ASAP, then install the 'master' branch instead of a specific version. Otherwise, it will be included in the next release for v2.0.0.
PJ: DLA-X30 Version: v2.0.0a2 installed from HACS
When there is no signal to the pj the script seems to fail when attempting to determine the picture mode attribute . This also impacts the ability to capture attribute states until the pj has HDMI signal again or when the next scan interval occurs AND there is HDMI signal. Example: switched to HDMI 2 w/ no signal and script repeated the error. However when there is a signal on the active hdmi input the script completes.
Providing both sets of logs (with and w/o errors). Having some additional logic may help remedy this. Thanks for the great work!
Logs for no signal on the active HDMI input 2022-08-20 13:10:00.193 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] Attempting handshake 2022-08-20 13:10:00.204 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] Handshake successful 2022-08-20 13:10:00.204 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] sending write_only operation: n͟u͟l͟l͟c͟m͟d 2022-08-20 13:10:00.314 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] command sent successfully 2022-08-20 13:10:03.406 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] Attempting handshake 2022-08-20 13:10:03.443 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] Handshake successful 2022-08-20 13:10:03.443 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] reading from command group: p͟o͟w͟e͟r 2022-08-20 13:10:03.566 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] command sent successfully 2022-08-20 13:10:03.568 DEBUG (SyncWorker_4) [jvc_projectorremote.jvcprojector] the state of command group: p͟o͟w͟e͟r is: l͟a͟m͟p͟͟o͟n 2022-08-20 13:10:07.675 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] Attempting handshake 2022-08-20 13:10:07.686 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] Handshake successful 2022-08-20 13:10:07.687 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] reading from command group: p͟o͟w͟e͟r 2022-08-20 13:10:07.813 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] command sent successfully 2022-08-20 13:10:07.813 DEBUG (SyncWorker_4) [jvc_projectorremote.jvcprojector] the state of command group: p͟o͟w͟e͟r is: l͟a͟m͟p͟͟o͟n 2022-08-20 13:10:10.900 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] Attempting handshake 2022-08-20 13:10:10.910 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] Handshake successful 2022-08-20 13:10:10.910 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] reading from command group: s͟i͟g͟n͟a͟l 2022-08-20 13:10:11.013 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] command sent successfully 2022-08-20 13:10:11.013 DEBUG (SyncWorker_4) [jvc_projectorremote.jvcprojector] the state of command group: s͟i͟g͟n͟a͟l is: n͟o͟͟s͟i͟g͟n͟a͟l 2022-08-20 13:10:14.129 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] Attempting handshake 2022-08-20 13:10:14.144 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] Handshake successful 2022-08-20 13:10:14.145 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] reading from command group: p͟o͟w͟e͟r 2022-08-20 13:10:14.264 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] command sent successfully 2022-08-20 13:10:14.264 DEBUG (SyncWorker_4) [jvc_projectorremote.jvcprojector] the state of command group: p͟o͟w͟e͟r is: l͟a͟m͟p͟͟o͟n 2022-08-20 13:10:17.361 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] Attempting handshake 2022-08-20 13:10:17.370 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] Handshake successful 2022-08-20 13:10:17.371 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] reading from command group: i͟n͟p͟u͟t 2022-08-20 13:10:17.463 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] command sent successfully 2022-08-20 13:10:17.464 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] the state of command group: i͟n͟p͟u͟t is: h͟d͟m͟i͟1 2022-08-20 13:10:20.576 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] Attempting handshake 2022-08-20 13:10:20.585 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] Handshake successful 2022-08-20 13:10:20.585 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] reading from command group: p͟o͟w͟e͟r 2022-08-20 13:10:20.715 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] command sent successfully 2022-08-20 13:10:20.716 DEBUG (SyncWorker_4) [jvc_projectorremote.jvcprojector] the state of command group: p͟o͟w͟e͟r is: l͟a͟m͟p͟͟o͟n 2022-08-20 13:10:23.804 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] Attempting handshake 2022-08-20 13:10:23.817 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] Handshake successful 2022-08-20 13:10:23.817 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] reading from command group: l͟a͟m͟p 2022-08-20 13:10:23.914 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] command sent successfully 2022-08-20 13:10:23.915 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] the state of command group: l͟a͟m͟p is: l͟o͟w 2022-08-20 13:10:27.009 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] Attempting handshake 2022-08-20 13:10:27.026 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] Handshake successful 2022-08-20 13:10:27.026 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] reading from command group: p͟o͟w͟e͟r 2022-08-20 13:10:27.116 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] command sent successfully 2022-08-20 13:10:27.116 DEBUG (SyncWorker_4) [jvc_projectorremote.jvcprojector] the state of command group: p͟o͟w͟e͟r is: l͟a͟m͟p͟͟o͟n 2022-08-20 13:10:30.203 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] Attempting handshake 2022-08-20 13:10:30.215 DEBUG (SyncWorker_4) [jvc_projector_remote.jvcprojector] Handshake successful 2022-08-20 13:10:30.215 DEBUG (SyncWorker_4) [jvc_projectorremote.jvcprojector] reading from command group: p͟i͟c͟t͟u͟r͟e͟͟m͟o͟d͟e2022-08-20 12:46:30.018 ERROR (MainThread) [homeassistant.components.remote] 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 107, 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 36, in setup_platform JVCRemote(name, host, password, port, delay, timeout, retries), File "/config/custom_components/jvcprojector/remote.py", line 71, in init "unknown" if not self._state else self._jvc.command("picture_mode") File "/usr/local/lib/python3.10/site-packages/jvc_projector_remote/jvcprojector.py", line 202, in command return self._send_command(getattr(Commands, commandl[0])) File "/usr/local/lib/python3.10/site-packages/jvc_projector_remote/jvcprojector.py", line 167, in _send_command result = command.read(jvc_sock) File "/usr/local/lib/python3.10/site-packages/jvc_projector_remote/jvccommands.py", line 184, in read self.verify_ack(sock, command) File "/usr/local/lib/python3.10/site-packages/jvc_projector_remote/jvccommands.py", line 125, in __verify_ack raise JVCCommunicationError( jvc_projector_remote.jvccommands.JVCCommunicationError: Timeout when waiting for the specified ACK:
b'\x06\x89\x01PM\n'
for command:picture_mode
with bytes:b'?\x89\x01PMPM\n'
Logs when there is a signal on the active HDMI input 2022-08-20 14:14:08.514 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] initialising JVCProjector with host=XXXXXXX, password=, port=20554, delay=600.0, connect_timeout=10, max_retries=10 2022-08-20 14:14:08.514 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] Sending nullcmd to XXXXX:͟2͟0͟5͟5͟4 to verify connection 2022-08-20 14:14:08.524 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] Attempting handshake 2022-08-20 14:14:08.553 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] Handshake successful 2022-08-20 14:14:08.553 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] sending write_only operation: n͟u͟l͟l͟c͟m͟d 2022-08-20 14:14:08.674 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] command sent successfully 2022-08-20 14:14:09.347 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] Attempting handshake 2022-08-20 14:14:09.358 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] Handshake successful 2022-08-20 14:14:09.358 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] reading from command group: p͟o͟w͟e͟r 2022-08-20 14:14:09.644 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] command sent successfully 2022-08-20 14:14:09.644 DEBUG (SyncWorker_3) [jvc_projectorremote.jvcprojector] the state of command group: p͟o͟w͟e͟r is: l͟a͟m͟p͟͟o͟n 2022-08-20 14:14:10.314 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] Attempting handshake 2022-08-20 14:14:10.328 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] Handshake successful 2022-08-20 14:14:10.328 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] reading from command group: p͟o͟w͟e͟r 2022-08-20 14:14:10.438 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] command sent successfully 2022-08-20 14:14:10.439 DEBUG (SyncWorker_3) [jvc_projectorremote.jvcprojector] the state of command group: p͟o͟w͟e͟r is: l͟a͟m͟p͟͟o͟n 2022-08-20 14:14:11.114 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] Attempting handshake 2022-08-20 14:14:11.129 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] Handshake successful 2022-08-20 14:14:11.129 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] reading from command group: s͟i͟g͟n͟a͟l 2022-08-20 14:14:11.224 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] command sent successfully 2022-08-20 14:14:11.224 DEBUG (SyncWorker_3) [jvc_projectorremote.jvcprojector] the state of command group: s͟i͟g͟n͟a͟l is: a͟c͟t͟i͟v͟e͟͟s͟i͟g͟n͟a͟l 2022-08-20 14:14:11.908 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] Attempting handshake 2022-08-20 14:14:11.924 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] Handshake successful 2022-08-20 14:14:11.924 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] reading from command group: p͟o͟w͟e͟r 2022-08-20 14:14:12.030 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] command sent successfully 2022-08-20 14:14:12.031 DEBUG (SyncWorker_3) [jvc_projectorremote.jvcprojector] the state of command group: p͟o͟w͟e͟r is: l͟a͟m͟p͟͟o͟n 2022-08-20 14:14:12.746 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] Attempting handshake 2022-08-20 14:14:12.774 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] Handshake successful 2022-08-20 14:14:12.775 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] reading from command group: i͟n͟p͟u͟t 2022-08-20 14:14:12.939 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] command sent successfully 2022-08-20 14:14:12.939 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] the state of command group: i͟n͟p͟u͟t is: h͟d͟m͟i͟1 2022-08-20 14:14:13.611 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] Attempting handshake 2022-08-20 14:14:13.618 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] Handshake successful 2022-08-20 14:14:13.618 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] reading from command group: p͟o͟w͟e͟r 2022-08-20 14:14:13.729 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] command sent successfully 2022-08-20 14:14:13.729 DEBUG (SyncWorker_3) [jvc_projectorremote.jvcprojector] the state of command group: p͟o͟w͟e͟r is: l͟a͟m͟p͟͟o͟n 2022-08-20 14:14:14.533 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] Attempting handshake 2022-08-20 14:14:14.562 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] Handshake successful 2022-08-20 14:14:14.562 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] reading from command group: l͟a͟m͟p 2022-08-20 14:14:14.692 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] command sent successfully 2022-08-20 14:14:14.692 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] the state of command group: l͟a͟m͟p is: l͟o͟w 2022-08-20 14:14:15.371 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] Attempting handshake 2022-08-20 14:14:15.383 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] Handshake successful 2022-08-20 14:14:15.383 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] reading from command group: p͟o͟w͟e͟r 2022-08-20 14:14:15.543 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] command sent successfully 2022-08-20 14:14:15.543 DEBUG (SyncWorker_3) [jvc_projectorremote.jvcprojector] the state of command group: p͟o͟w͟e͟r is: l͟a͟m͟p͟͟o͟n 2022-08-20 14:14:16.218 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] Attempting handshake 2022-08-20 14:14:16.227 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] Handshake successful 2022-08-20 14:14:16.227 DEBUG (SyncWorker_3) [jvc_projectorremote.jvcprojector] reading from command group: p͟i͟c͟t͟u͟r͟e͟͟m͟o͟d͟e 2022-08-20 14:14:16.375 DEBUG (SyncWorker_3) [jvc_projector_remote.jvcprojector] command sent successfully 2022-08-20 14:14:16.376 DEBUG (SyncWorker_3) [jvc_projectorremote.jvcprojector] the state of command group: p͟i͟c͟t͟u͟r͟e͟͟m͟o͟d͟e is: u͟s͟e͟r͟1