HTTP/MQTT/LIRC bridge for Broadlink devices, supports Pronto hex codes

No, it is only meant to transmit. The original main goal was to be able to use Pronto hex codes.

If I can be entirely honest, I think it is unlikely that I will invest much effort in the receiving functionality. Maybe somebody who needs to scratch that itch might one day fork the code and work on that.

Regarding your use case, AFAIK the hardware is not normally receiving and must be put in that mode. I also think that it doesn’t stay in that mode for more than a minute or so, and it unilaterally stops receiving. To solve your problem the bridge should be putting the hardware in receive mode and making it stay that way, get the signals and do IR protocol decoding in order to get a clean version that it can match against and send an event back to HASS. This might be doable on paper, but as I wrote it is very unlikely that I will ever end up implementing this. And if the hardware can cope with being in receive mode all the time without ill effects is another big unknown.

@lbschenkel thanks for quick reply.

Sorry to hear that, I don’t know why this not implemented in broadlink switch component? Looks like the broadlink hw is very limited.

Do you know If there is ir + wifi hw that is in learning mode if no send sending codes and work with ha? Maybe this is posible with esphome and diy hardware?

No, unfortunately I didn’t really explore DIY hardware yet and I’m not aware of something that would fulfill your use case.

Can you please share the IR codes that you use for the kitchen hood. I’m looking for the codes of siemens that seem to be the same as for many manufactures

Can you please share the IR codes that you use for the kitchen hood. I’m looking for the codes of siemens that seem to be the same as for many manufactures

Sure no problem.

Here my hood codes:

Copy to clipboard

"FAN":"JgBQAAABK5IVNhUQFRAVEBUQFRAVEBU2FRAVNRU1FRAVEBU2FTUVEBU1FRAVERUQFRAVEBUQFTUVEBU2FTUVNRU1FTUWNRUQFQAFbQABLEcWAA0FAAAAAAAAAAA=",
       "LIGHT":"JgBIAAABLJETNxMTFBEUERQRFBEUERU1ExITOBI4ExITEhM3EzcTExI4ExITEhM3EzcTEhMTEjgTEhM3EzcTEhMSEzgSOBMSEwANBQ==",
       "UP":"JgBQAAABK5IUNxMSExITEhUQFBEUERQ2FBITNxQ2FBEUERQ3EzcTEhQ2FBEUNxMSExITEhMSFDYUERQ3ExITNxQ2FDYUNxMSEwAFbwABK0gUAA0FAAAAAAAAAAA=",
       "DOWN":"JgBIAAABKpMUNhMTExITEhMSFBEUERQ2FBISOBM3FBEUERM3FDcTEhMSEzcUERQ2FBITEhMSEzcUNhMSEzgTEhM3FDYUNhMTEwANBQ=="

Here is picture:

If those codes works for you contact me again and I can send you whole configuration for ha.

FYI: Updated bridge and add-on to use python-bradlink 0.14.0, which adds supports to RM4 devices.

Hi, would you happen to know of a method to convert broadlink codes to pronto or raw?

Can you read code? The algorithm to convert from Pronto to Broadlink is here: https://github.com/lbschenkel/broadlink-bridge/blob/6c52decd79c7acd75bc33bf712d0447f907cce35/broadlink_bridge/util.py#L89. This algorithm in theory could be “inverted” to convert it back to Pronto.

Hi. I just tried to install, but when I click Install, I get the following error message:

The command ‘/bin/ash -o pipefail -c apk add git gcc musl-dev libffi-dev openssl-dev’ returned a non-zero code: 5

Any idea what might cause this? FYI I’m running HA supervised. I did have the Motion-eye add-on installed as well, but I was not using it so removed it when I saw the note about a port conflict on one of the info pages.

What platform? x86-64 or something else?

I believe that you are using i386. I tried to rebuild the images and that is the only platform where I saw this happening. For some reason, python3 is not installed in the base image from Home Assistant. I amended the build instructions and if you refresh and try again, it should work. Actually it was my bad: I didn’t specify the proper base image for i386. Anyway, it is fixed now.

I took the opportunity to upgrade to python-broadlink 0.15.0, which supports new devices and contains bug fixes.

Hi. Sorry for the delay replying. I’m running on an Intel i3 NUC. If you have updated the package, do I need to do anything other than try the Install link again? I’m still getting the same error as of a couple of minutes ago.

PS: just checked the Python version on my nuc and it’s 3.6.9.

OK - just looked in the supervisor logs and there is loads more error info. I have a feeling this might be the fact that I’m running supervised on an unsupported base OS (Ubuntu instead if Debian). FYI here is the relevant part of the log. If the errors are down to the OS then it might be the spur for me to finally move over to Debian :slight_smile:

20-11-08 22:42:42 INFO (SyncWorker_0) [supervisor.docker.addon] Starting build for c523f6d3/amd64-addon-broadlink_bridge:0.1.5
20-11-08 22:42:55 ERROR (SyncWorker_0) [supervisor.docker.addon] Can't build c523f6d3/amd64-addon-broadlink_bridge:0.1.5: The command '/bin/ash -o pipefail -c apk add git gcc musl-dev libffi-dev openssl-dev' returned a non-zero code: 5
20-11-08 22:42:55 ERROR (SyncWorker_0) [supervisor.docker.addon] Build log: 
Step 1/17 : ARG BUILD_FROM
Step 2/17 : FROM $BUILD_FROM AS build
 ---> c72e517437d6
Step 3/17 : RUN apk add git gcc musl-dev libffi-dev openssl-dev
 ---> Running in 00f59abd941d
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.12/main: temporary error (try again later)
WARNING: Ignoring APKINDEX.2c4ac24e.tar.gz: No such file or directory

fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.12/community: temporary error (try again later)
WARNING: Ignoring APKINDEX.40a3604f.tar.gz: No such file or directory

ERROR: unsatisfiable constraints:

  gcc (missing):
    required by: world[gcc]
  git (missing):
    required by: world[git]
  libffi-dev (missing):
    required by: world[libffi-dev]
  musl-dev (missing):
    required by: world[musl-dev]
  openssl-dev (missing):
    required by: world[openssl-dev]
Removing intermediate container 00f59abd941d

20-11-08 22:51:02 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/lbschenkel/hass-addon-broadlink-bridge repository
20-11-08 22:51:02 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/hassio-addons/repository repository
20-11-08 22:51:02 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/home-assistant/hassio-addons repository
20-11-08 22:51:03 INFO (MainThread) [supervisor.store] Loading add-ons from store: 67 all - 0 new - 0 remove 

Not quite sure what is going on. The error seems to indicate a network problem in your environment: the package index files couldn’t be downloaded from dl-cdn.alpinelinux.org.

Me neither! It’s not just my network blocking the address, though, as entering that address in Chrome on my laptop downloads the file. It’s clearly something to do with my setup, though, so I’ll do some digging. Thanks for taking a look.

I’m getting an error when starting the addon. Authentication Failed.

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2020-12-03 15:45:37,824 INFO     Starting broadlink-bridge/0.1.6...
2020-12-03 15:45:37,826 INFO     Reading config file: /config/custom_components/broadlink_bridge/config.ini
2020-12-03 15:45:37,827 INFO     Registering command: philips/power-off
2020-12-03 15:45:37,828 INFO     Registering command: denon/power-on
2020-12-03 15:45:37,829 INFO     Registering command: panasonic/power-on
Traceback (most recent call last):
  File "/usr/local/bin/broadlink-bridge", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/broadlink_bridge/cli.py", line 63, in main
    REGISTRY.add_manual_device(url, alias)
  File "/usr/local/lib/python3.9/site-packages/broadlink_bridge/__init__.py", line 18, in add_manual_device
    return self._add_device(host, alias)
  File "/usr/local/lib/python3.9/site-packages/broadlink_bridge/__init__.py", line 76, in _add_device
    dev = Device(dev)
  File "/usr/local/lib/python3.9/site-packages/broadlink_bridge/__init__.py", line 99, in __init__
    self.connect()
  File "/usr/local/lib/python3.9/site-packages/broadlink_bridge/__init__.py", line 109, in connect
    connected = self._dev.auth()
  File "/usr/local/lib/python3.9/site-packages/broadlink/device.py", line 198, in auth
    check_error(response[0x22:0x24])
  File "/usr/local/lib/python3.9/site-packages/broadlink/exceptions.py", line 137, in check_error
    raise exception(error_code)
broadlink.exceptions.AuthenticationError: [Errno -1] Authentication failed
[cmd] /run.sh exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

I can see that you opened an issue in GitHub. To avoid having to repeat this conversation in both places, I’m going to follow up there.