rrooggiieerr / homeassistant-benqprojector

Home Assistant integration for BenQ projectors over the serial (and network?) interface.
Apache License 2.0
25 stars 2 forks source link

Error when trying to configure my projector #12

Closed Shiftane closed 9 months ago

Shiftane commented 9 months ago

Hello, When trying to install my projector, I got this error. I use a usb-serial converter pl2303.

Core 2023.12.3 Supervisor 2023.11.6 Operating System 11.2 Interface utilisateur 20231208.2

First time I report a bug, let me know what you need.

Cheers

Logger: custom_components.benqprojector.config_flow
Source: custom_components/benqprojector/config_flow.py:65
Integration: BenQ Projector (documentation, issues)
First occurred: 22:34:48 (2 occurrences)
Last logged: 22:36:11

Unexpected exception: ('modelname', '?')
Traceback (most recent call last):
  File "/config/custom_components/benqprojector/config_flow.py", line 65, in async_step_setup_serial
    info = await self.validate_input_setup_serial(user_input, errors)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/benqprojector/config_flow.py", line 114, in validate_input_setup_serial
    projector.connect()
  File "/usr/local/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 169, in connect
    model = self._send_command("modelname")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 305, in _send_command
    raise EmptyResponseError(command, action)
benqprojector.benqprojector.EmptyResponseError: ('modelname', '?')
rrooggiieerr commented 9 months ago

What's your projector model?

Shiftane commented 9 months ago

W1070

Le lun. 18 déc. 2023, 22:45, rrooggiieerr @.***> a écrit :

What's your projector model?

— Reply to this email directly, view it on GitHub https://github.com/rrooggiieerr/homeassistant-benqprojector/issues/12#issuecomment-1861732683, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2FABA7QF6D5WNQ3YWDXXLYKC2OJAVCNFSM6AAAAABA2FSIBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRRG4ZTENRYGM . You are receiving this because you authored the thread.Message ID: @.***>

wasspoca commented 9 months ago

Hi, It's also my first time reporting a bug. I have the same model (W1070) and almost the same error as @Shiftane, so I thought I'd chime in as well. Thank you.

Core 2023.12.1 Supervisor 2023.12.0 Operating System 11.2 Interface utilisateur 20231208.2

Source: custom_components/benqprojector/config_flow.py:64
Integration: BenQ Projector (documentation, issues)
First occurred: 17:59:37 (1 occurrences)
Last logged: 17:59:37

Unexpected exception: ('modelname', '?')
Traceback (most recent call last):
  File "/config/custom_components/benqprojector/config_flow.py", line 64, in async_step_setup_serial
    info = await self.validate_input_setup_serial(user_input, errors)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/benqprojector/config_flow.py", line 113, in validate_input_setup_serial
    projector.connect()
  File "/usr/local/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 210, in connect
    model = self._send_command("modelname")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 374, in _send_command
    return self._parse_response(command, action, _command, response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 424, in _parse_response
    raise BlockedItemError(command, action)
benqprojector.benqprojector.BlockedItemError: ('modelname', '?')
rrooggiieerr commented 9 months ago

Could you both try to connect over serial to the projector using a terminal program and enter the following command:

*modelname=?#

And let me know the results?

wasspoca commented 9 months ago

With minicom, I get this (I also tried *pow=?# to test if the projector was answering correctly):

Welcome to minicom 2.9

OPTIONS: I18n 
Compiled on Sep 23 2023, 13:50:21.
Port /dev/ttyUSB0, 23:29:38

Press CTRL-A Z for help on special keys

>*modelname=?#
*Block item#
>*pow=?#
*POW=OFF#
wasspoca commented 9 months ago

Little update, I sent the *pow=on# command to first turn on the projector. Now I can get the model name but I have a different error when trying to add the integration.

>*pow=on#                                                                       
*POW=ON#                                                                                                                                               
>*modelname=?#                                                                  
*MODELNAME=W1070/W1250#  

The new error:

Unexpected exception: Failed to retrieve projector model
Traceback (most recent call last):
  File "/config/custom_components/benqprojector/config_flow.py", line 64, in async_step_setup_serial
    info = await self.validate_input_setup_serial(user_input, errors)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/benqprojector/config_flow.py", line 113, in validate_input_setup_serial
    projector.connect()
  File "/usr/local/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 211, in connect
    assert model is not None, "Failed to retrieve projector model"
           ^^^^^^^^^^^^^^^^^
AssertionError: Failed to retrieve projector model
Shiftane commented 9 months ago

On my side, I've connected my raspberry pi3 with home assistant os and install minicom in terminal app directly on the web. After configuring minicom with 9600 (changed on my videoprojector) and 8N1, I run minicom and still OFFLINE on my side. My USB-Serial converter use a ship Prolific pl2303. Any idea ?

rrooggiieerr commented 9 months ago

Thanks for your feedback, I'm actually not very sure if the projector needs to be on when adding. I didn't add anything about it in the documentation and have to check the behaviour of my own projector to find out.

I notice the modelname has a forward slash in it, it could be that this is also not supported yet, and that's why it fails. Again `i have to check te source code.

I wil look into this further over the holidays, so please be patient

rrooggiieerr commented 9 months ago

@Shiftane, try to connect from your regular PC

wasspoca commented 9 months ago

I wil look into this further over the holidays, so please be patient

Thanks a lot!

rrooggiieerr commented 9 months ago

Just a quick update: My own projector als returns it's model name when off, so that's why nothing specific is is mentioned in the installation instructions. Apparently in case of your model of projector it needs to be on to be detected. I need to update the integration to handle this behaviour.

rrooggiieerr commented 9 months ago

I have released a new version of the integration. It doesn't directly include fixes for your problems, but contains changes that I had been working on in the past. Nevertheless I'm curious to know if it makes any difference in your situation, let me know.

wasspoca commented 9 months ago

I've updated the integration to the 0.0.10 version, the installation is now showing the success message prompt but when I check the device it says the configuration has failed.

I tried several times to remove then add again the integration and I always have those two errors at the same exact time:

Logger: homeassistant
Source: /usr/src/homeassistant/homeassistant/runner.py:145
First occurred: 22:37:45 (4 occurrences)
Last logged: 22:43:42

Error doing job: Future exception was never retrieved
TimeoutError: Timeout while waiting for prompt
Logger: homeassistant.config_entries
Source: config_entries.py:402
First occurred: 22:37:45 (4 occurrences)
Last logged: 22:43:42

Error setting up entry BenQ None /dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller_A_CCb10CD20-if00-port0 for benqprojector
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/benqprojector/__init__.py", line 279, in async_setup_entry
    if not await hass.async_add_executor_job(projector.connect):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TimeoutError: Timeout while waiting for prompt
rrooggiieerr commented 9 months ago

The projector is on, not in standby? What happens when you reload the integration? Or restart HA?

wasspoca commented 9 months ago

Projector is on. I've restarted HA then reloaded the integration. After the restart and after the reload as well I got this error (same as before but without the other error):

Logger: homeassistant.config_entries
Source: config_entries.py:402
First occurred: 23:36:26 (2 occurrences)
Last logged: 23:37:16

Error setting up entry BenQ None /dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller_A_CCb10CD20-if00-port0 for benqprojector
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/benqprojector/__init__.py", line 279, in async_setup_entry
    if not await hass.async_add_executor_job(projector.connect):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TimeoutError: Timeout while waiting for prompt
rrooggiieerr commented 9 months ago

Can you connect to your projector using a serial terminal program and get a prompt >?

wasspoca commented 9 months ago

Is minicom okay? If so, yes I can connect and I see the > prompt, it's what I used previously to send commands like *pow=on# and *modelname=?*#. If not, do you have a recommandation for a serial terminal program I can use via ssh on home assistant?

rrooggiieerr commented 9 months ago

O, yes, you did that before too.

Maybe you can try using the benqprojector CLI and see it that's able to make a connection

https://github.com/rrooggiieerr/benqprojector.py

wasspoca commented 9 months ago

Thanks, here's the result:

➜  ~ python3 -m benqprojector serial /dev/ttyUSB0 115200 status
Unable to retrieve projector model, is projector powering down?
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/lib/python3.11/site-packages/benqprojector/__main__.py", line 50, in <module>
    if not projector.connect():
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 218, in connect
    model = self._send_command("modelname")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 368, in _send_command
    return self._parse_response(command, action, _command, response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 454, in _parse_response
    raise BlockedItemError(command, action)
benqprojector.benqprojector.BlockedItemError: ('modelname', '?')
rrooggiieerr commented 9 months ago

So *modelname=?# is always blocked, also when your projector is turned on?

wasspoca commented 9 months ago

Sorry, I forgot to turn on my projector. It works perfectly when it's on:

➜  ~ python3 -m benqprojector serial /dev/ttyUSB0 115200 status
Device on /dev/ttyUSB0 available
Model: w1070/w1250
Position: fc
Power on
Direct power on  : False
Lamp time        : 2470 hours
3D               : None
Picture mode     : None
Aspect ratio     : None
Brilliant color  : False
Blank            : False
Brightness       : None
Color value      : None
Contrast         : None
Color temperature: None
High altitude    : False
Lamp mode        : lnor
Quick auto search: False
Sharpness        : None
Video Source     : hdmi
Volume           : 0
Muted            : False
Supported video sources: ['dp', 'dvia', 'dvid', 'hdbaset', 'hdmi', 'hdmi2', 'network', 'rgb', 'rgb2', 'rgb3', 'svid', 'usbdisplay', 'usbreader', 'vid', 'wireless', 'ypbr', 'ypbr2', 'smartsystem']
rrooggiieerr commented 9 months ago

Well, that makes all the difference. Maybe the integration also works when the projector is turned on?

wasspoca commented 9 months ago

Yes you're right, the integration also works! Thanks a lot :)

There's still an issue, I turned off the projector via the integration (it worked) but now it's been 5 minutes and it's shown as unavailable ("indisponible" in french) and I can't turn it back on via the integration.

I'll test it more after sleep as it's almost 1AM here.

Capture d’écran 2023-12-23 à 00 49 50
wasspoca commented 9 months ago

It took half an hour for the integration to see the projector after turning it off but it worked! (See screenshot below)

Thank you so much @rrooggiieerr for this integration and for looking at this issue, and happy holidays!

@Shiftane , version 0.0.10 worked perfectly for me, with the projector turned on during the installation.

Screenshot_2023-12-23-09-38-12-143_io homeassistant companion android-edit

Shiftane commented 9 months ago

Hi, noce work. Will Try this Afternoon but it looks on m'y Side maybe the Wire is not good cause i cannot have minicom working on ha and my Macbook. Let you know later

Le ven. 22 déc. 2023, 22:45, wasspoca @.***> a écrit :

I've updated the integration to 0.0.10 version, the installation is now showing the success message prompt but when I check the device it says the configuration has failed.

I tried several times to remove then add again the integration and I always have those two errors at the same exact time:

Logger: homeassistant Source: /usr/src/homeassistant/homeassistant/runner.py:145 First occurred: 22:37:45 (4 occurrences) Last logged: 22:43:42

Error doing job: Future exception was never retrieved TimeoutError: Timeout while waiting for prompt

Logger: homeassistant.config_entries Source: config_entries.py:402 First occurred: 22:37:45 (4 occurrences) Last logged: 22:43:42

Error setting up entry BenQ None /dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller_A_CCb10CD20-if00-port0 for benqprojector Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/benqprojector/init.py", line 279, in async_setup_entry if not await hass.async_add_executor_job(projector.connect): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TimeoutError: Timeout while waiting for prompt

— Reply to this email directly, view it on GitHub https://github.com/rrooggiieerr/homeassistant-benqprojector/issues/12#issuecomment-1868088457, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2FABCZ2ZRNTDTH4OQHLK3YKX5P3AVCNFSM6AAAAABA2FSIBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRYGA4DQNBVG4 . You are receiving this because you were mentioned.Message ID: @.***>

wasspoca commented 9 months ago

maybe the Wire is not good cause i cannot have minicom working on ha and my Macbook.

If you need to change your cable, here's the one I use (same setup with ssh on ha and a MacBook), I've had it for two years now and it works well and it's not expensive: https://www.amazon.fr/dp/B00VBODA0G/

rrooggiieerr commented 9 months ago

@wasspoca good to hear it works for you! And also thank you for your donation to support my work :-) Still I'd like to get a bit better understanding what's going on and under which conditions your projector is detected and when not. So I've got some things I like you to try...

Shiftane commented 9 months ago

Thanks for the new release. The result is that logs : Logger: homeassistant.config_entries Source: config_entries.py:402 First occurred: 13:54:11 (3 occurrences) Last logged: 13:55:20

Error setting up entry BenQ None /dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller_BECAb11A922-if00-port0 for benqprojector
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/benqprojector/__init__.py", line 283, in async_setup_entry
    if not await hass.async_add_executor_job(projector.connect):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 218, in connect
    model = self._send_command("modelname")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 317, in _send_command
    self._send_raw_command(_command)
  File "/usr/local/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 430, in _send_raw_command
    self._wait_for_prompt()
  File "/usr/local/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 397, in _wait_for_prompt
    raise ResponseTimeoutError("Timeout while waiting for prompt")
benqprojector.benqprojector.ResponseTimeoutError

And this one

Logger: homeassistant
Source: /usr/src/homeassistant/homeassistant/runner.py:145
First occurred: 13:54:11 (2 occurrences)
Last logged: 13:55:20

Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 218, in connect
    model = self._send_command("modelname")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 317, in _send_command
    self._send_raw_command(_command)
  File "/usr/local/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 430, in _send_raw_command
    self._wait_for_prompt()
  File "/usr/local/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 397, in _wait_for_prompt
    raise ResponseTimeoutError("Timeout while waiting for prompt")
benqprojector.benqprojector.ResponseTimeoutError

It's really looks like I don't have a good connection between devices. My adapter is similar to the one you use. The chip is detected as Prolific. But if i disconnect the cable from projector, I have the same result. I have a usb - serie femal and an adapter femal-femal same as the Amazon option you send me. So could be the adapter cable or the adapter femal-femal. Any other idea ?

rrooggiieerr commented 9 months ago

@Shiftane there are two kinds of serial cables, regular and nullmodem or cross cable. For the null modem/cross cable the RX and TX wires are crossed. So it could be that you use the wrong kind of cable.

I think you first manage to get a working connection using minicom and the benqprojector library. Only if you've got that working move on to the HA integration

wasspoca commented 9 months ago

Thank you for looking further into it, @rrooggiieerr, here are the results.

When the projector is in standby for some time (not directly after shutdown), does the python3 -m benqprojector serial /dev/ttyUSB0 115200 status command produce any sensible data?

No, here's the error I get:

➜  ~ python3 -m benqprojector serial /dev/ttyUSB0 115200 status
Unable to retrieve projector model, is projector powering down?
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/lib/python3.11/site-packages/benqprojector/__main__.py", line 50, in <module>
    if not projector.connect():
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 218, in connect
    model = self._send_command("modelname")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 368, in _send_command
    return self._parse_response(command, action, _command, response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 454, in _parse_response
    raise BlockedItemError(command, action)
benqprojector.benqprojector.BlockedItemError: ('modelname', '?')

Can you power on the projector using python3 -m benqprojector serial /dev/ttyUSB0 115200 on?

No I can't, I get the same error as above:

➜  ~ python3 -m benqprojector serial /dev/ttyUSB0 115200 on
Unable to retrieve projector model, is projector powering down?
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/lib/python3.11/site-packages/benqprojector/__main__.py", line 50, in <module>
    if not projector.connect():
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 218, in connect
    model = self._send_command("modelname")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 368, in _send_command
    return self._parse_response(command, action, _command, response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 454, in _parse_response
    raise BlockedItemError(command, action)
benqprojector.benqprojector.BlockedItemError: ('modelname', '?')

Directly after power up, does the python3 -m benqprojector serial /dev/ttyUSB0 115200 status command produce any sensible data?

Yes it does:

➜  ~ python3 -m benqprojector serial /dev/ttyUSB0 115200 status
Device on /dev/ttyUSB0 available
Unexpected response: b'*PW=\r\r\n'
Unexpected response: b'\x00'
Model: w1070/w1250
Position: None
Power on
Direct power on  : False
Lamp time        : 2471 hours
3D               : None
Picture mode     : None
Aspect ratio     : None
Brilliant color  : False
Blank            : False
Brightness       : None
Color value      : None
Contrast         : None
Color temperature: None
High altitude    : False
Lamp mode        : lnor
Quick auto search: False
Sharpness        : None
Video Source     : hdmi
Volume           : 0
Muted            : False
Supported video sources: ['dp', 'dvia', 'dvid', 'hdbaset', 'hdmi', 'hdmi2', 'network', 'rgb', 'rgb2', 'rgb3', 'svid', 'usbdisplay', 'usbreader', 'vid', 'wireless', 'ypbr', 'ypbr2', 'smartsystem']

Can you power off the projector using python3 -m benqprojector serial /dev/ttyUSB0 115200 off?

Yes I can:

➜  ~ python3 -m benqprojector serial /dev/ttyUSB0 115200 off
Device on /dev/ttyUSB0 available
Turning off projector

Directly after shutdown, does the python3 -m benqprojector serial /dev/ttyUSB0 115200 status command produce any sensible data?

No, I get the same error as before:

➜  ~ python3 -m benqprojector serial /dev/ttyUSB0 115200 status
Unable to retrieve projector model, is projector powering down?
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/lib/python3.11/site-packages/benqprojector/__main__.py", line 50, in <module>
    if not projector.connect():
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 218, in connect
    model = self._send_command("modelname")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 368, in _send_command
    return self._parse_response(command, action, _command, response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/benqprojector/benqprojector.py", line 454, in _parse_response
    raise BlockedItemError(command, action)
benqprojector.benqprojector.BlockedItemError: ('modelname', '?')

Additionally, when I restart HA, the integration is again unavailable, and I have to wait at least half an hour to have a successful reload. In the logs, I have a similar error involving benqprojector.benqprojector.BlockedItemError: ('modelname', '?').

Shiftane commented 9 months ago

I have this one : https://www.amazon.fr/Goobay-95435-Convertisseur-Transparent-Longueur/dp/B00606ZYPY Looks good no ? Maybe only compatible with microsoft, that's my problem ?

rrooggiieerr commented 9 months ago

@wasspoca, I have just released a new version of the benqprojector library (not the HA integration yet!). I think it covers more edge cases and now should at least let you power on the device when shutdown. Could you retry previous tests with the new version?

To upgrade the library to the latest version: pip3 install --upgrade benqprojector

If sucesfull I'll upgrade the HA integration acordingly

rrooggiieerr commented 9 months ago

@Shiftane, if you can't get a connection with your projector it's most probably the cable, I'm sorry

wasspoca commented 9 months ago

It worked perfectly, when turned off I can now get my projector status with python3 -m benqprojector serial /dev/ttyUSB0 115200 status and turn it on with python3 -m benqprojector serial /dev/ttyUSB0 115200 on.

➜  ~ python3 -m benqprojector serial /dev/ttyUSB0 115200 status
Unable to retrieve projector model while projector is off: Block item for command 'modelname' and action '?'
Device on /dev/ttyUSB0 available
Model: None
Position: None
Power off
Direct power on  : None
Lamp time        : None hours
Supported video sources: []
➜  ~ python3 -m benqprojector serial /dev/ttyUSB0 115200 on
Unable to retrieve projector model while projector is off: Block item for command 'modelname' and action '?'
Device on /dev/ttyUSB0 available
Turning on projector
rrooggiieerr commented 9 months ago

Wonderfull! I'll move on to updating the integration then

Shiftane commented 9 months ago

I've ordered a new cable. Let you know after holiday how it work. Thanks for all and merry christmas

Le sam. 23 déc. 2023, 17:55, rrooggiieerr @.***> a écrit :

Wonderfull! I'll move on to updating the integration then

— Reply to this email directly, view it on GitHub https://github.com/rrooggiieerr/homeassistant-benqprojector/issues/12#issuecomment-1868330688, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2FABAEO3XSXIA6H3B6PHTYK4EIPAVCNFSM6AAAAABA2FSIBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRYGMZTANRYHA . You are receiving this because you were mentioned.Message ID: @.***>

Shiftane commented 9 months ago

Hello, fisrt happy new year. I've receive my new cable, and it's finally work fine. Will go deeper in your plugin now. I have added the turn on and turn off action to my script when home cinema start and stop, I've used the command raw for switch on and off. We try more those next day. Thanks a lot for all.