amosyuen / ha-epson-projector-link

Home Assistant Epson Projector Link
Apache License 2.0
12 stars 5 forks source link

Can not control power on/off #105

Closed larhedse closed 5 months ago

larhedse commented 5 months ago

I can not control power on/off anymore. It just stopped after a power failure.

However I can, thru the plugin, get status (power, color mode, hours and so on - no no error codes, that still fails during config) - but I can not power on/off.

I can change input - however it fails sometimes with "unknown error" and the I find this in the core log:

2024-04-26 08:50:39.137 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [548195027008] 
Traceback (most recent call last):
  File "/config/custom_components/epson_projector_link/projector/projector.py", line 228, in _send_request
    return await request.future
           ^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2543, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2580, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 971, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1043, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/epson_projector_link/media_player.py", line 345, in async_select_source
    await self._projector.set_property(PROPERTY_SOURCE, selected_source)
  File "/config/custom_components/epson_projector_link/projector/projector.py", line 180, in set_property
    return await self._send_request(Request(f"{prop} {value}", value))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/epson_projector_link/projector/projector.py", line 226, in _send_request
    with async_timeout.timeout(TIMEOUT_REQUEST):
  File "/usr/local/lib/python3.12/site-packages/async_timeout/__init__.py", line 128, in __exit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.12/site-packages/async_timeout/__init__.py", line 228, in _do_exit
    raise asyncio.TimeoutError
TimeoutError
2024-04-26 08:50:39.216 ERROR (MainThread) [custom_components.epson_projector_link.projector.projector] _pop_request: Request queue is unexpectedly empty
larhedse commented 5 months ago

And just to "kill myself" all of a sudden power on/off just works. I find this a bit challenging...

larhedse commented 5 months ago

Well it turned out, that after a power failure of the projector, I need to restart my Home Assistant system, or I will not be able to control my projector. So I think this might be a TCP/IP communication thing, and most likely not part of this integration but rather something that happens inside HA. So I will close this one.