Broadlink inconsistencies - what the hell am i doing wrong now? (Broken again)

So I set up my broadlink bean (RM4C mini) and I can learn commands:

{
    "version": 1,
    "minor_version": 1,
    "key": "broadlink_remote_24dfa7310d8e_codes",
    "data": {
        "soundbar": {
            "power": "JgBwAAABJpMSExI4EjcSFBEUEhMSExI4ETgSOBE4ETkSOBE4ETgSOBITEhMSOBI3EjgSExITEhMSOBI3EhMSFBAVEjcSOBI3EgAEuAABJ0oSAAxeAAEmSxEADF4AAShJEgAMXgABJUsSAAxeAAEmShIADQU=",
            "aux": "JgCIAAABJZQSExI4ETgSExITEhMSFBE4EjgROBI4ETgSOBI3EjgSNxITEhQRFBEUEjcSExIUERQROBI4EjcSOBITEjcSOBI3EgAEuAABJ0oRAAxdAAEmSxIADFsAASdKEgAMXQABJkoRAAxfAAElShEADF0AASVLEgAMXAABJksSAAxcAAEmShIADQU=",
            "optical": "JgB4AAABJZQSExI4EjcSExITEhQRFBI3EjgSNxI4EjcSOBI3EjgSNxE5ERQSExI4ERQSNxITEhQQFRE4EjgSExE4EhQROBI4EQAEuAABJ0oSAAxdAAEmSxIADF0AASdKEQAMXgABJ0kSAAxeAAEmShIADF4AASZKEgANBQ==",
            "coaxial": "JgBYAAABJpMSFBE4EjgRFBEUEhMSExE5EjcSOBI3EjgSNxI4EjcSOBITEjgRFBEUEjcSExIUERQSNxITEjgSNxIUETgSOBI3EgAEuQABJUoSAAxeAAEmShIADQU=",
            "bt": "JgBoAAABJZQRFBI3EjgSExITEhMSExI4EjcSOBI3EjgSNxI4EDkSOBI3EhMSOBITEhMSNxIUERQSExI3EhMSOBI3EhQROBQ2EQAEuAABJ0kSAAxdAAEmSRIADF0AASZKEgAMXQABJkkSAA0F",
            "hdmiarc": "JgBYAAABJ5ISExI4EjcSExITEhQRFBI3EjgROBI4ETgSOBE4EjcSOBITEhMSOBEUEhMSNxIUEBUSNxI4ERQSNxI4ERQSNxI4EgAEtgABKEkSAAxcAAEmShEADQU="
        }
    }
}

but the remote.send command errors out when I try to use the following (all set via the GUI):

service: remote.send_command
data:
  device: soundbar
  command: power
target:
  device_id:
    - 63bc669215d62d9429b04931ad018b08

but this part of a script (or sending the b64 directly) works fine:

service: remote.send_command
data:
  command: >-
    b64:'JgBYAAABJZUQFRE4ETkRFBEUERQRFBE5ETgRORE4ETkROBE5ETkQOREUERUQORE4ETkRFBEUERUQORE4ERQRFRAVETgRORE4EQAEuQABJksRAAxeAAEmShEADQUAAAAAAAAAAAAAAAAAAA=='
target:
  device_id: 63bc669215d62d9429b04931ad018b08

any pointers appreciated. clearly the broadlink is working. is it my formating or does the broadlink integration not work properly?

Don’t you have an entity id of the remote?

This is what I would use:

service: remote.send_command
data:
  device: kitchen_tv
  command: power
target:
  entity_id: remote.broadlink_4_remote

well that sucks for the broadlink integration then because that means the GUI is populating itself with info that doesn’t actually work!

i generated the code in the gui then switch to yaml:

service: remote.send_command
data:
  command: power
  device: soundbar
target:
  device_id: 63bc669215d62d9429b04931ad018b08

and did as you suggested and edited the yaml to:

service: remote.send_command
data:
  command: power
  device: soundbar
target:
  entity_id: remote.broadlink_bean_remote

it works so looks like something in the integration or my install is messed up.

given the absolute mare of a time I’m having with anything zigbee and ZHA behaving like a petulant child at present it seems par for the course.

FYI - this appears to have started working when I upgraded to core-2022.4.4

UPDATE as of today using version 2022.4.7 this is not working again.

Again I used the GUI in dev tools to learn the remote commands. here’s the extract from the broadlink codes file in \config.storage:

"bedroom_fan": {
            "light_on_off": "JgByAiYPKQ4OKg0qDCsNKg4qDSooDw0qDSsMAAEIKQ4pDw0qDCsNKg4qDSoNKikODioMKwwAAQgoDygQDSoNKg0qDioNKg0qKBAMKwwrDQABBygQKQ4OKQ0qDioNKg4sCioOKgwrDSoOAAiAKA8qDg0qDCsNKg4qDSoMKxscDioNKg0AAQgnDykPDSoNKg4qDCsNKgwrDioNKg0qDQABBykPKA8MKw0qDioNKg0qDikOKgwrDSoNAAEHKBApDg0qDioNKg0qDikOKigPDSoNKg4ABZ0nDykODioNKg0qDik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wrDSoNKikPKespDikODioNKg0qKA8OKg0qDSoOKSkPKesoDyoODSoNKg0qKBANKg0oDyoNKykOKespDykODSoMKw4qKA8NKg0qDioNKigPKesoECkODikNKg4qKA8OKQ0rDCsNKigPKusoDykODikOKg0qKA8OKQ4qDSoNKioOKespDikODioNKg0qKA8OKg0qDikNKikPKesoDyoODSoOKQ0qKBANKg0qDSoNKygPKespDioODSoNKg0qKQ8NKgwrDikOKigPKespDyoNDikNKg0rKA8PKA0qDSsNKikOKewoDykODygOKg0qKA8OKQ4qDCsNKikOKuspDikODikOKg0qKA8OKgwrDSoNKigQKesoDykODioNKgwrKQ4OKgwrDSoNKygPKesoDyoODSoNKg0qKBANKg0qDikOKigPKesqDikODSoOKQ4qKA8OKQwrDioNKigPKespDyoNDikNKg0rKA8OKQ4qDSoNKikOKusoDykODikOKg0qKQ4OKQ4qDSoNKikPKesoDykODioNKg0qKBANKgwrDSoOKCkQKewoDisNDSoNKg4pKBANKgwrDSoNKygPKesoDyoODSoNKg4qJxANKg0qDioNKigPKesoECkODikNKg4qKA8OKQ0qDioNKikOKuopDykODioNKg0qKA8OKQ4qDSoNKikOKusoDykODikOKg4pKQ4OKgwrDCsNKigQKespDikODioNKg0qKQ4OKg0qDSoNKygPKesoDyoODSoNKg0qKBANKg0qDSoOKikOKewnECkODSoMKw4qKQ4NKg4pDioNKigPKesoECkODikNKg4qKQ4OKQ4qDSoNKigPKuspDikODikOKgwrKA8OKQ4qDCsNKikPKesoDykODioMKw0qKQ4OKg0qDSoNKikPK+ooDikPDSoNKg0qKBANKgwrDSoOKigPKesoDyoODSoNKg4qKQ4NKg0qDikOKigPKespDykODikNKg4qKA8OKQ0qDioMKygPKuopDykODikOKg0qKQ4OKQ4qDSoNKigPKuspDikODioNKg0qKA8OKQ0pDisNKikPKesoDykODioNKg0qKQ8NKg0qDygNKykOKespDioODSoNKg0qKBANKg0qDSoOKikOKespDykODSoNKg4qKA8NKg0qDioNKycPKespDykODikNKwwrKA8OKQ0rD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0qDioMKw0AAQcpDykODSoMKw4qDSoNKg0qDioNKg0qDQABBykPKQ4OKQ4qDSoNKg0qDioNKgwrDSoOAAEHKA8pDg0qDioNKg0qDioNKg0qDSoOKg0ADQU="
        }

here’s the yaml from the GUI for the send:

service: remote.send_command
data:
  device: bedroom_fan
  command: fan_off
target:
  device_id: 63bc669215d62d9429b04931ad018b08

and here’s the 3 errors that subsequently appear in the log:

Logger: homeassistant.components.websocket_api.http.connection
Source: components/broadlink/remote.py:146
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 14:41:07 (1 occurrences)
Last logged: 14:41:07

[139882374931120] Error handling message: Unknown error (unknown_error)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/broadlink/remote.py", line 144, in _extract_codes
    codes = self._codes[device][cmd]
KeyError: 'bedroom_fan'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 630, in handle_execute_script
    await script_obj.async_run(msg.get("variables"), context=context)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1275, in async_run
    await asyncio.shield(run.async_run())
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 359, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 379, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 582, in _async_call_service_step
    await service_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1634, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1671, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 677, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 955, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 714, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/broadlink/remote.py", line 221, in async_send_command
    code_list = self._extract_codes(commands, subdevice)
  File "/usr/src/homeassistant/homeassistant/components/broadlink/remote.py", line 146, in _extract_codes
    raise ValueError(f"Command not found: {repr(cmd)}") from err
ValueError: Command not found: 'fan_off'

Logger: homeassistant.helpers.script.websocket_api_script
Source: components/broadlink/remote.py:146
First occurred: 14:41:07 (1 occurrences)
Last logged: 14:41:07

websocket_api script: Error executing script. Unexpected error for call_service at pos 1: Command not found: 'fan_off'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/broadlink/remote.py", line 144, in _extract_codes
    codes = self._codes[device][cmd]
KeyError: 'bedroom_fan'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 379, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 582, in _async_call_service_step
    await service_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1634, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1671, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 677, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 955, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 714, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/broadlink/remote.py", line 221, in async_send_command
    code_list = self._extract_codes(commands, subdevice)
  File "/usr/src/homeassistant/homeassistant/components/broadlink/remote.py", line 146, in _extract_codes
    raise ValueError(f"Command not found: {repr(cmd)}") from err
ValueError: Command not found: 'fan_off'

Logger: homeassistant.components.broadlink.remote
Source: components/broadlink/remote.py:223
Integration: Broadlink (documentation, issues)
First occurred: 14:41:07 (1 occurrences)
Last logged: 14:41:07

Failed to call remote.send_command: Command not found: 'fan_off'

Any help appreciated

Hi,

sent it on another post, but older:

"I have a huge problem. I try to learn commends from the Devtools UI. And always get the following:
Failed to call service remote.send_command. Unknown error

When is look it to the .storage folder, I don’t see any boardlink file or code files.

Any one know what could it be?"

Please don’t cross-post.

If you have a Windows PC at home install Broadlink Manager according to this guide. Use the download link for Broadlink Manager provided with the instructions (see Part B) since that version is known to work.

Learning commands works suprisingly well. See also this thread.

Thanks man,

For some reason the manager dont find my device while my HA dose…

Any ideas why?

It is unclear to me what you mean. Learning commands through Broadlink Manager has nothing to do with HA.

the manager dont see my broadlink when scaning. dont see any broadlink devices

I just installed to get the RF codes for my curtains. Installation on win10 went fine including discovering my Broadlink device and getting the codes. Codes embedded in HA script. Tested and everything works fine. Great manager.

Note that you should NOT register your broadlink devices to the broadlink cloud when doing the initial setup through your Android/Apple phone! After you have set the necessary WiFi credentials leave the Broadlink App and continue with Broadlink Manager/Home Assistant instead.

If it is too late and you have already registered your devices with the Broadlink Cloud you have to reset those devices and additionally delete them from the Broadlink phone app and cloud.

I think that won’t be a problem. I have Broadlink registered in the cloud (Broadlink android phone application) and connected to Google Home
however, installation and discovery of my Broadlink device went fine.

That is a problem. It really is

Ok, so if that’s the problem then I don’t understand why it works for me?

Because you have it registered in the cloud, you just said you had.
If you have it connected to Google home then it’s defiantly cloud connected, and it should not if you want to use it in HA.

Sorry I misread your reply.
Not sure why it works in HA. I know there was some changes done, but perhaps broadlink manager does not have those changes.
Disconnect it from the cloud. It will be much buggier to have it in the cloud.

Then it’s weird. Yesterday I thought of downloading the RF codes so I installed broadlink manager on win10 and after booting it immediately scanned my Broadlink RM pro+ without doing or modifying anything else, then I got the codes from my RF driver and it was done. I’ve had it in the cloud for a few years now. Maybe we just misunderstood, I didn’t want to run broadlink manager in HA, so I just used the instructions above how to install on win10 and get the codes.

I installed the manager on another Linux docker compute and now it works great :slight_smile: don’t know what was the problem with both my HA and windows tries but I am now happy with a working RF fans :stuck_out_tongue: