home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.57k stars 30.35k forks source link

Broadlink RF remote.send error - Enum RemoteKeyCode has no value defined #128222

Open Invisible-Escher opened 3 days ago

Invisible-Escher commented 3 days ago

The problem

The problem

Open blinds: Error executing script. Unexpected error for call_service at pos 1: Enum RemoteKeyCode has no value defined for name 'KEYCODE_Open'

This occurs when performing a RF remote.send_command to a Broadlink RM-4 Pro device. Commands were learned using remote.learn. The command will still function in a script despite the error. However, when combined in with other remote.send_command's the latter will fail due to the error. This is not mitigated by continue _on_error: true.

What version of Home Assistant Core has the issue?

2024.10.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Broadlink

Link to integration documentation on our website

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

Diagnostics information

Logger: homeassistant.components.script.close_blinds Source: helpers/script.py:525 integration: Script (documentation, issues) First occurred: 7:34:21 PM (1 occurrences) Last logged: 7:34:21 PM

Close blinds: Error executing script. Unexpected error for call_service at pos 1: Enum RemoteKeyCode has no value defined for name 'KEYCODE_Close' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 525, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 763, in _async_call_service_step response_data = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 726, in _async_run_long_action return await long_task ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/script/init.py", line 718, in _service_handler response = await self._async_start_run( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/script/init.py", line 674, in _async_start_run script_result = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/script/init.py", line 707, in _async_run return await self.script.async_run(script_vars, context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1795, in async_run return await asyncio.shield(create_eager_task(run.async_run())) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 463, in async_run await self._async_step(log_exceptions=False) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 527, in _async_step self._handle_exception( File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 557, in _handle_exception raise exception File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 525, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 763, in _async_call_service_step response_data = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 726, in _async_run_long_action return await long_task ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1021, in entity_service_call raise result from None File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1610, in async_request_call return await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1068, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/androidtv_remote/remote.py", line 109, in async_send_command self._send_key_command(single_command, "SHORT") File "/usr/src/homeassistant/homeassistant/components/androidtv_remote/entity.py", line 73, in _send_key_command self._api.send_key_command(key_code, direction) File "/usr/local/lib/python3.12/site-packages/androidtvremote2/androidtv_remote.py", line 395, in send_key_command self._remote_message_protocol.send_key_command(key_code, direction) File "/usr/local/lib/python3.12/site-packages/androidtvremote2/remote.py", line 106, in send_key_command key_code = RemoteKeyCode.Value(key_code) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/google/protobuf/internal/enum_type_wrapper.py", line 59, in Value raise ValueError('Enum {} has no value defined for name {!r}'.format( ValueError: Enum RemoteKeyCode has no value defined for name 'KEYCODE_Close'

Example YAML snippet

alias: Blinds Entrance - Close
action: remote.send_command
metadata: {}
data:
  command: Close
  device: Blinds - Entrance
target:
  area_id: living_room
  entity_id: remote.broadlink_ir

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 3 days ago

Hey there @danielhiversen, @felipediel, @l-i-am, @eifinger, mind taking a look at this issue as it has been labeled with an integration (broadlink) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `broadlink` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign broadlink` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


broadlink documentation broadlink source (message by IssueLinks)