rrooggiieerr / homeassistant-benqprojector

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

Still intressted to integrate network connection? #9

Closed fabiankrauss closed 1 month ago

fabiankrauss commented 11 months ago

Hey there @rrooggiieerr !

You mentioned in your readme that: "The same commands should work over a network connection, but I don't own such projector and have not implemented any network functionality. Contact me if you have a network connected BenQ projector and like this to work."

I own a BenQ with LAN Connection and im totally intressted to integrated that with you togehter!

BR Fabian

rrooggiieerr commented 11 months ago

That sounds great Fabian!

I'm not using my projector a lot at the moment because of summer time and not being at home a lot, but I'll try to help you where needed.

The conecction and commands are actually handled in the benqprojector.py library, so thats where you should be to add the network connection.

Keep me posted on you progress and if you have any questions.

Rogier

waazdakka commented 11 months ago

Hello @rrooggiieerr! I'm currently trying to connect my hass to my projector using lan. It has it's own IP address, and the only thing I could have get so far is this page when connecting from a web browser 😅

Capture d’écran 2023-08-18 à 14 36 06

I'm not sure how to use your library to connect from Home Assistant, since the IP address is not an acceptable setting in your integration panel:

Capture d’écran 2023-08-18 à 14 38 17

How are we supposed to use it?

Thanks a lot!! (and sorry for the noob questions ^^')

Dodoooh commented 9 months ago

hej @waazdakka and @rrooggiieerr

I am also at this point, have you @waazdakka already found out more or could somehow integrate it into Home Assistant?

thanks a lot!

waazdakka commented 9 months ago

Hello, I didn't tried anything more since my last post. But I'm still interested by the connection :)

rrooggiieerr commented 9 months ago

I actually implemented support for serial to networking bridges in the benqprojector.py library. But having said that, it looks like your projector is using Creston RoomView Connect which seems to be a different protocol.

What model of BenQ projector are you using?

Can you try using the benqprojector.py library from the command line and connect to it?

waazdakka commented 9 months ago

I actually have a W4000i (the US reference is HT4550i). I don't even know how Creston RoomView Connect works, but I'll try tonight from the command line! Thanks for your support!

rrooggiieerr commented 7 months ago

I just released a major update to the integration: network support. Still very much in beta since I don't own a networked projector. Let me know if it works for you.

Dodoooh commented 7 months ago

thanks for implementing! @rrooggiieerr

but I'm already failing to integrate: "Unexpected error" can I send you any useful debug logs? I have the BenQ W4000i (HT4550i).

fabiankrauss commented 7 months ago

Same here with the W5700

Am Do., 21. Dez. 2023 um 12:18 Uhr schrieb Dodoooh @.***

:

thanks for implementing! @rrooggiieerr https://github.com/rrooggiieerr

but I'm already failing to integrate: "Unexpected error" can I send you any useful debug logs? I have the BenQ W4000i (HT4550i).

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

rrooggiieerr commented 7 months ago

Thanks for giving it a try! Unfortunately without luck, yet.

My first questions would be:

Can you ping your projector from your HA instance? Can you telnet to port 8000 of your projector? If so, can you execute a command like *pow=?# And what response do you get

If not to port 8000, is there an other port available on your projector that accepts telnet connections? Maybe you could do a portscan on your projector to see which ports are available.

The integration does not use any web based interface to communicate with the projector, so if the only way to communicate with your projector is web based that's not going to work, it needs to be telnet and it needs to accept commands in the *<key>=<value># format.

rrooggiieerr commented 7 months ago

@Dodoooh, for your W4000i I read in the manual that there is support for "Control4", which I never heard off before but seems to be an other home automation platform. Maybe you can enable that and see if it makes a difference?

Screenshot 2023-12-21 at 12 33 16
rrooggiieerr commented 7 months ago

@fabiankrauss your W5700 seems to support a Network Standby Mode which disables the network connection after some time. Make sure it's disabled or try the integration with the projector turned on.

W5700 manual for reference

fabiankrauss commented 7 months ago

good hint :) the projector is on. May a other port?

Am Do., 21. Dez. 2023 um 12:40 Uhr schrieb rrooggiieerr < @.***>:

@fabiankrauss https://github.com/fabiankrauss your W5700 seems to support a Network Standby Mode which disables the network connection after some time. Make sure it's disabled or try the integration with the projector turned on.

W5700 manual for reference https://esupportdownload.benq.com/esupport/PROJECTOR/UserManual/W5700/W5700_UM_EN_210203100126.pdf

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

rrooggiieerr commented 7 months ago

@fabiankrauss, yes, could be running on an other port too although the information I found online default port should be 8000. Maybe you need to enable something else in the menu. I didn't go trough the whole manual of your model, maybe you can have a good look in the manual and the menu options and see if there is something else that can be set.

Also, do a port scan of you projector over the full port range. and let me know which ports are open. Maybe that can give a hint.

Dodoooh commented 7 months ago

I have activated control4, thought I had to anyway, when I connect to the IP of the beamer I get the following UI, which does not work (flash in 2023 really benq?...)

Screenshot 2023-12-21 at 12 56 39

the port scan outputs the following:

Not shown: 995 closed tcp ports (conn-refused)
PORT     STATE    SERVICE
80/tcp    open  http
843/tcp   open  unknown
1023/tcp  open  netvenuechat
4352/tcp  open  pjlink
4774/tcp  open  converge
8000/tcp  open  http-alt
8080/tcp  open  http-proxy
41794/tcp open  crestron-cip
55950/tcp open  unknown
55953/tcp open  unknown

telnet on port 8000 does not seem to work for me

rrooggiieerr commented 7 months ago

@Dodoooh Can you try telnet on the other ports? Just give an enter when connected and see if anything returns

fabiankrauss commented 7 months ago

looks like the same ports like @Dodoooh

Discovered open port 8080/tcp Discovered open port 80/tcp Discovered open port 843/tcp Discovered open port 41794/tcp Discovered open port 8000/tcp Discovered open port 4352/tcp Discovered open port 1023/tcp Discovered open port 55953/tcp Discovered open port 55950/tcp

Dodoooh commented 7 months ago

@Dodoooh Can you try telnet on the other ports? Just give an enter when connected and see if anything returns

have tried it with all ports unfortunately none of them returns anything useful on telnet

rrooggiieerr commented 7 months ago

Since I don't own a networked BenQ projector I think finding out how to make this work is not within reach for me. If you're able to find out how to make it work I'm more than happy to make the required changes to the library and integration.

The actual communication with the projector is done using the benqprojector library. You could try to use that manually as described in the Readme and add the -debug argument to the benqprojector CLI command. Like so: python3 -m benqprojector telnet <host> <port> status --debug

Maybe that gives some extra hints on what's going on

fabiankrauss commented 7 months ago

so what I can report:

PjLink on Port 4352 is working with putty and this class 1 comands: https://optics.fujifilm.com/projector/en/spec/manual/fp-z8000/technical_notes/pjlink/#pjlink_class1

but this is just basic.

rrooggiieerr commented 7 months ago

There is a PJLink integration for HA, but I don't think it's as extensive as my BenQ integration

https://www.home-assistant.io/integrations/pjlink/

waazdakka commented 5 months ago

Hello! Sorry I wasn't able to run tests...

I found a way to access the flash interface of Crestron RoomView. Here are the few settings we can found into this shinny interface!

Capture d’écran 2024-02-10 à 22 19 55

I tried a lot of ports (80 / 843 / 1023 / 8000 / 8080 and finally 41794) without any success :(

mrZeffka commented 1 month ago

Any news on the topic?

rrooggiieerr commented 1 month ago

Network connection is implemented and should work, although I never got feedback of anyone using it

mrZeffka commented 1 month ago

I'm trying to connect Benq W5700, but it doesn't work.

rrooggiieerr commented 1 month ago

You need to give more details on what you're trying to do and what message you get. I don't own a networked projector myself so am totally dependent on proper feedback

mrZeffka commented 1 month ago

When adding a network address, the following error appears: Failed to connect

Error in log: `Registrar: benqprojector.benqprojector Source: /usr/local/lib/python3.12/site-packages/benqprojector/benqprojector.py:277 First message: 17:58:40 (2 сообщений) Last message: 17:59:58

Failed to get projector command prompt, is your projector properly connected?`

rrooggiieerr commented 1 month ago

Can you telnet to the port and what do you get then

mrZeffka commented 1 month ago

Telnet opens for me only on port 4352. But this is a PJLink port. (It also cannot connect through standard integration PJLink, although I can do everything through the test application) No command can be executed. Everything is as described above in this thread.

rrooggiieerr commented 1 month ago

Then this integration does not work for you

waazdakka commented 1 month ago

Hello @rrooggiieerr, I'm sorry I'm in the middle of moving so I can't test your integration for now but I promise I will add some elements here! Thanks!!

rrooggiieerr commented 1 week ago

I learned some new things on how the network connection to the BenQ projectors work. I tried to implement that in the leatest library and integration. You might want to give that an other try

waazdakka commented 1 week ago

OK! I'll give a try this weekend! Thanks a lot


From: rrooggiieerr @.> Sent: Monday, July 15, 2024 10:27:25 AM To: rrooggiieerr/homeassistant-benqprojector @.> Cc: waazdakka @.>; Mention @.> Subject: Re: [rrooggiieerr/homeassistant-benqprojector] Still intressted to integrate network connection? (Issue #9)

I learned some new things on how the network connection to the BenQ projectors work. I tried to implement that in the leatest library and integration. You might want to give that an other try

— Reply to this email directly, view it on GitHubhttps://github.com/rrooggiieerr/homeassistant-benqprojector/issues/9#issuecomment-2227954080, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACHSB4NV2AOUXQUTOEM4L63ZMOBW3AVCNFSM6AAAAAA3Q2JLPGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRXHE2TIMBYGA. You are receiving this because you were mentioned.Message ID: @.***>

Dodoooh commented 1 week ago

@rrooggiieerr

I have just tried it on my W4000i / HT4550i. I get "Unknown error occurred"

can i give you any more information?

rrooggiieerr commented 1 week ago

@Dodoooh, Bummer.

Have you followed these steps for settung up your projector?

Screenshot 2024-07-15 at 22 16 19

There are a couple of things you could do, easiest first most difficult last: Enable debug logging and do whatever you did when you got the "Unknown error occurred" message.

Screenshot 2024-07-15 at 22 08 01

Then send me the resulting log file

You could try the CLI of the BenQ projector library and enable debug there. Instructions are in the readme of the library but I'm also available to help you if you like to go that route.

Try a proper telnet client and connect to port 8000 of your projector and type in <enter>*pow=?#<enter>

If everything above fails you could temporary enable port forwarding port 8000 of your internet router to port 8000 of your projector and send me the external ip address of your internet connection and I could give it a try. However I would actually not recommend any of this because it definitely compromises your network security.

Dodoooh commented 1 week ago

Unfortunately I only have this, I think that's because I haven't been able to add it yet?

-

I get the "Unknown error occurred" error when I try adding the device

AMX Device Discovery, is activated. I can control the projector via telnet, also switch it off and on (standby activated)

rrooggiieerr commented 1 week ago

I can control the projector via telnet, also switch it off and on (standby activated)

Ok, so that means port 8000 is working.

You can also enable logging by adding these lines to your configuration.yaml:

logger:
  logs:
    custom_components.benqprojector: debug
    benqprojector: debug

And then restart HA.

The resulting log you can find in home-assistant.log

Dodoooh commented 1 week ago

here are the debug log:

2024-07-16 00:12:59.508 INFO (MainThread) [benqprojector.benqprojector] Connecting to 192.168.172.10:8000
2024-07-16 00:12:59.513 DEBUG (MainThread) [benqprojector.benqprojector] Connected to 192.168.172.10:8000
2024-07-16 00:12:59.716 DEBUG (MainThread) [benqprojector.benqprojector] command *pow=?#
2024-07-16 00:12:59.918 DEBUG (MainThread) [benqprojector.benqprojector] Waiting for response
2024-07-16 00:13:00.169 DEBUG (MainThread) [benqprojector.benqprojector] Waiting for response
2024-07-16 00:13:00.421 DEBUG (MainThread) [benqprojector.benqprojector] Waiting for response
2024-07-16 00:13:00.672 DEBUG (MainThread) [benqprojector.benqprojector] Waiting for response
2024-07-16 00:13:00.924 DEBUG (MainThread) [benqprojector.benqprojector] Waiting for response
2024-07-16 00:13:01.175 DEBUG (MainThread) [benqprojector.benqprojector] Waiting for response
2024-07-16 00:13:01.426 DEBUG (MainThread) [benqprojector.benqprojector] Waiting for response
2024-07-16 00:13:01.677 DEBUG (MainThread) [benqprojector.benqprojector] Waiting for response
2024-07-16 00:13:01.929 DEBUG (MainThread) [benqprojector.benqprojector] Waiting for response
2024-07-16 00:13:02.180 DEBUG (MainThread) [benqprojector.benqprojector] Waiting for response
2024-07-16 00:13:02.434 DEBUG (MainThread) [benqprojector.benqprojector] Waiting for response
2024-07-16 00:13:02.685 DEBUG (MainThread) [benqprojector.benqprojector] Waiting for response
2024-07-16 00:13:02.936 DEBUG (MainThread) [benqprojector.benqprojector] Waiting for response
2024-07-16 00:13:03.188 DEBUG (MainThread) [benqprojector.benqprojector] Waiting for response
2024-07-16 00:13:03.439 DEBUG (MainThread) [benqprojector.benqprojector] Waiting for response
2024-07-16 00:13:03.690 DEBUG (MainThread) [benqprojector.benqprojector] Waiting for response
2024-07-16 00:13:03.941 DEBUG (MainThread) [benqprojector.benqprojector] Waiting for response
2024-07-16 00:13:04.193 DEBUG (MainThread) [benqprojector.benqprojector] Waiting for response
2024-07-16 00:13:04.444 DEBUG (MainThread) [benqprojector.benqprojector] Waiting for response
2024-07-16 00:13:04.695 DEBUG (MainThread) [benqprojector.benqprojector] Waiting for response
2024-07-16 00:13:04.947 WARNING (MainThread) [benqprojector.benqprojector] Timeout while waiting for response
2024-07-16 00:13:04.947 ERROR (MainThread) [benqprojector.benqprojector] Unable to retrieve projector power state: Response timeout for command 'pow' and action '?'
2024-07-16 00:13:04.950 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
    return await method(view, request, data, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in async_configure
    result = await self._async_configure(flow_id, user_input)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 415, in _async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 518, in _async_handle_step
    result: _FlowResultT = await getattr(flow, method)(user_input)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/benqprojector/config_flow.py", line 185, in async_step_setup_network
    title, data, options = await self.validate_input_setup_network(
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/benqprojector/config_flow.py", line 222, in validate_input_setup_network
    model = projector.model.upper()
            ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'upper'

i see you are waiting for the answer of "pow=?#" i realise that this does not always work in telnet. currently it does not want to work at all... i can always switch the projector off and on or change the source via telnet but "pow=?#" doesn't want to give me anything at the moment.

I'm pretty sure that ON was output the first time.

rrooggiieerr commented 1 week ago

i realise that this does not always work in telnet. currently it does not want to work at all... i can always switch the projector off and on or change the source via telnet but "*pow=?#" doesn't want to give me anything at the moment.

Does it make a difference if the projector is on or off? That *pow=?# only works when the projector is on?

Dodoooh commented 1 week ago
Telnet

Okay, I have been testing the setup again. It seems that the response “*POW=ON#” appears in my Telnet window on my computer when I want to integrate it into HomeAssistant.

However, it does not appear in HomeAssistant. I have tried disconnecting my computer from the projector and setting it up in HomeAssistant, but that didn’t work either.

I have highlighted the output that was actually triggered by HomeAssistant and doesn’t arrive in HomeAssistant.

Interestingly, commands like power off or switch source work without delay, but the output “*pow=?#” does not give any response, even in Telnet.

I can’t pinpoint when it doesn’t work; maybe it just ends up somewhere in the void? In any case, all outgoing commands always work.

I am currently able to control my projector using Node-RED and Telnet, which is great, but it would be even neater with this integration into HomeAssistant.

rrooggiieerr commented 1 week ago

That's quite interesting. So you're using a serial connection between your pc and projector and HA is using a networked connection? Does the projector echo the commands received on the network connection to the serial port? Thats a great way to debug.

Could you give the CLI of th BenQ projector library a try?

Dodoooh commented 1 week ago

no the console on the computer is telnet.

i can try the CLI, but probably not until the weekend. I will provide feedback here as soon as possible.