{"id":13648200,"url":"https://github.com/lbschenkel/broadlink-bridge","last_synced_at":"2025-07-13T14:36:55.252Z","repository":{"id":43022574,"uuid":"200094514","full_name":"lbschenkel/broadlink-bridge","owner":"lbschenkel","description":"Bridge to Broadlink devices supporting REST, MQTT and LIRC protocols","archived":false,"fork":false,"pushed_at":"2022-03-22T21:28:06.000Z","size":34,"stargazers_count":35,"open_issues_count":3,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-30T22:29:25.521Z","etag":null,"topics":["broadlink","http","lirc","mqtt","rest"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lbschenkel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-01T17:41:40.000Z","updated_at":"2024-09-30T08:26:10.000Z","dependencies_parsed_at":"2022-09-10T00:01:17.868Z","dependency_job_id":null,"html_url":"https://github.com/lbschenkel/broadlink-bridge","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/lbschenkel/broadlink-bridge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbschenkel%2Fbroadlink-bridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbschenkel%2Fbroadlink-bridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbschenkel%2Fbroadlink-bridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbschenkel%2Fbroadlink-bridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lbschenkel","download_url":"https://codeload.github.com/lbschenkel/broadlink-bridge/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbschenkel%2Fbroadlink-bridge/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265156507,"owners_count":23719734,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["broadlink","http","lirc","mqtt","rest"],"created_at":"2024-08-02T01:04:03.162Z","updated_at":"2025-07-13T14:36:54.995Z","avatar_url":"https://github.com/lbschenkel.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# broadlink-bridge\n\nA HTTP/MQTT/LIRC bridge to Broadlink IR/RF devices, written in Python\nand powered by [python-broadlink](https://github.com/mjg59/python-broadlink).\n\nNote: that there is a [similar project for Node.js](https://github.com/401Unauthorized/broadlink-bridge)\nwith the same name.\n\n## Features\n\n- supports [HTTP](#http) protocol\n- supports [MQTT](#mqtt) protocol\n- supports [LIRC](#lirc) protocol\n- supports multiple Broadlink devices\n- supports Broadlink IR/RF codes\n- supports Pronto hex codes\n- supports defining named commands\n- supports specifying repeats\n- can act as sending hardware for [IrScrutinizer](http://www.harctoolbox.org/IrScrutinizer.html) via the [LIRC output](http://www.harctoolbox.org/IrScrutinizer.html#The+%22Lirc%22+pane)\n\n## Installing/running\n\nTo install: `pip install [--user] git+https://github.com/lbschenkel/broadlink-bridge.git`\n\nTo run: `broadlink-bridge [config-file]`\n\n### Docker\n\n(to be written)\n\n### Usage in Home Assistant\n\nThis bridge is available as an [unnoficial add-on](https://github.com/lbschenkel/hass-addon-broadlink-bridge/tree/master/broadlink-bridge).\n\nCodes can be transmitted via [RESTful commands](https://www.home-assistant.io/components/rest_command):\n\n```yaml\nrest_command:\n  my_command:\n    url: http://BRIDGE_HOST:PORT/device/DEVICE\n    method: post\n    payload: CODE\n```\n\nOr by [publishing via MQTT](https://www.home-assistant.io/docs/mqtt/service), for example in an entity button:\n\n```yaml\ntype: entity-button\nname: My command\nentity: ...\ntap_action:\n  action: call-service\n  service: mqtt.publish\n  service_data:\n    topic: PREFIX/device/DEVICE/transmit\n    payload: CODE\n```\n\nAn on/off switch can be implemented directly via a [MQTT switch](https://www.home-assistant.io/components/switch.mqtt):\n\n```yaml\nswitch:\n- platform: mqtt\n  command_topic: PREFIX/device/DEVICE/transmit\n  payload_on: CODE\n  payload_off: CODE\n```\n\nOr by combining RESTful commands with a [boolean input](https://www.home-assistant.io/components/input_boolean)\nand an [automation](https://www.home-assistant.io/docs/automation):\n\n```yaml\nrest_command:\n  my_device_on:\n    url: http://BRIDGE_HOST:PORT/device/DEVICE\n    method: post\n    payload: CODE\n  my_device_off:\n    url: http://BRIDGE_HOST:PORT/device/DEVICE\n    method: post\n    payload: CODE\ninput_boolean:\n  my_device:\n    name: My Device\nautomation:\n  trigger:\n    platform: state\n    entity_id: input_boolean.my_device\n  action:\n    service_template: rest_command.my_device_{{ trigger.to_state.state }}\n```\n\nNote that the [RESTful switch](https://www.home-assistant.io/components/switch.rest)\nis not useful, because it relies on the REST endpoint providing the state\n(not possible here) and it does not implement an optimistic mode with an\nassumed state (like the MQTT switch does).\n\nIn the above:\n\n- `BRIDGE_HOST` is the hostname/IP address of this bridge\n- `PORT` is the HTTP port (default `8780`)\n- `PREFIX` is the MQTT prefix (default `broadlink`)\n- `DEVICE` identifies the target [device](#device)\n- `CODE` is the [code](#code) (or command) to transmit,\n  prefixed by any [repeats](#repeats)\n\n## Configuration\n\nA configuration file can be optionally specified as a command-line argument.\nAn [example file](config.example.ini) is provided.\n\n### MQTT client\n\nTo enable the MQTT client, it is necessary to specify the URL of the MQTT\nbroker as the `broker_url` value inside the `[mqtt]` section.\n\nThe prefix for the MQTT topics is configurable via `topic_prefix`.\n\n### Manually declared devices\n\nDevices can be manually declared in the `[devices]` section. When a device is\ndeclared in this way it is given an *alias* which can act as an additional\n[identifier](#device) for the device in the bridge.\nAuto-discovered devices do not have aliases.\n\n### Commands\n\nCommands can be defined in the `[commands]` section. Commands associate a\n*name* with a *code*. The name can then be used anywhere where a code can appear.\n\nThe code for the command can be in [any supported format](#code) and contain\n[repeats](#repeats), with the exception that it cannot be another command.\n\n## Protocols\n\n### Definitions\n\n#### Device\n\nA *device* represents a Broadlink device which can be addressed on any of the protocols.\nIt can be identified by any of the following:\n\n- by its alias (as specified in the configuration file)\n- by its host (as specified in the configuration file or found via discovery)\n- by its MAC address\n- by one of its IP addresses\n\nWhen the device is not found via one of the mechanisms above, a final attempt\nis made by interpreting *device* as a host: in case a device is discovered at\nthat address, then it is added to the list of known devices (this can be\nconsidered a lazy discovery mechanism).\n\n#### Default device\n\nThe *default device* is the [device](#device) with an alias of `default`. If there is no device with such an alias, it is the first declared or discovered device.\n\n#### Code\n\nThe *code* is the data to transmit. It can have one of the following forms:\n\n- IR/RF data in Broadlink format (encoded as base64):\n  `JgAcAB0dHB44HhweGx4cHR06HB0cHhwdHB8bHhwADQUAAAAAAAAAAAAAAAA=`\n- IR data in Pronto hex format:\n\n  ```\n  0000 006C 0022 0002 015B 00AD 0016 0016 0016 0016 0016 0041 0016 0016 0016\n  0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0016 0016 0041\n  0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0041 0016\n  0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016\n  0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 05F7 015B 0057 0016\n  0E6C\n  ```\n\n- a *command* defined via the configuration file: in that case the code for\n  the command is used (which can have any of the above forms)\n\nNote that codes can contain repeats (see next section).\n\n#### Repeats\n\n*Repeats* are the number of times a *code* will be retransmitted.\nRepeats can be specified in multiple ways:\n\n- as part of the code — if the code starts with `N*` (number plus asterisk)\n  then the code will be sent `N` times (`N-1` repeats), for example:\n  - `3 * JgAcAB...` (Broadlink format, sent 3 times)\n  - `2 * 0000 006C ...` (Pronto hex format, sent 2 times)\n  - `5 * tv/on` (command defined via configuration file, sent 5 times)\n- inside Broadlink data packet (second data byte is the number of repeats)\n- via the protocol command (in case of LIRC)\n\nWhen repeats are specified in more than one way, their effects multiply.\nFor example, LIRC command `SEND_ONCE default 3*tv/on 1` (1 being the repeat\nand `tv/on` being a command defined in the configuration file as `2*JgAcAB...`)\nwill result in the code being sent 2x3x2 = 12 times (11 repeats).\n\n### HTTP\n\nverb | path | description\n--|--|--\nPOST | /device/*device*  | transmits the submitted [code](#code) via [device](#device)\n\nStatus codes:\n\n- `404` when the device is unknown\n- `400` when the code is invalid or not recognized\n\n### MQTT\n\nThe topic *prefix* defaults to `broadlink` and can be changed via the configuration file.\n\ntopic | description\n--|--\n*prefix*/device/*device*/transmit  | transmits the submitted [code](#code) via [device](#device)\n\n### LIRC\n\nA subset of the [LIRC command interface](http://www.lirc.org/html/lircd.html) and the unofficial [CCF extension](http://www.harctoolbox.org/lirc_ccf.html) is supported.\n\ncommand | description\n--|--\nSEND_ONCE *device* *code* [*repeat*] | transmits the given [code](#code) (no spaces) via [device](#device), optionally repeating it *repeat* times\nSEND_CCF_ONCE *repeat* *code* | transmits the given [code](#code) (spaces allowed) via the [default device](#default-device), repeating it *repeat* times\nLIST | replies with all known devices\nLIST *device* | replies with all defined commands (commands are not device-specific)\nVERSION | replies with bridge version\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flbschenkel%2Fbroadlink-bridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flbschenkel%2Fbroadlink-bridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flbschenkel%2Fbroadlink-bridge/lists"}