Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Broadlink remote #26528
This PR introduces a new platform for controlling Broadlink remotes. I know, we already have the Broadlink switch platform that does pretty much the same. But I consider this an enhancement to the wonderful work started by mjg59 and Danielhiversen.
This integration introduces the following improvements:
As a result, learning and command-sending services no longer need to be registered by the Broadlink component as they are already registered by the remote component.
The user no longer needs to learn one command at a time, check the persistent notification and then enter it manually into the configuration file as a switch. He can now use the following service:
- service: remote.learn_command data: entity_id: remote.bedroom device: television command: - turn on - turn off - channel up - channel down - volume up - volume down
This service allows the user to learn a sequence of commands very quickly. All the commands are stored in a JSON file and are easily retrieved by the command sending service. It also allows the user to capture toggle commands by using the 'alternative' flag:
- service: remote.learn_command data: entity_id: remote.bedroom device: television command: power alternative: True
When calling the command learning service with this flag, two codes will be captured for the same command, and will be sent alternatively each time the command is called.
Now the user can send several commands sequentially, and can repeat the sequence as many times as desired. Suppose the user wants to turn on the air conditioner and then turn off the annoying display light with a single service call. He can do something like this:
- service: remote.send_command data: entity_id: remote.bedroom device: air conditioner command: - turn on - turn off display
Now suppose the user wants to increase the volume of the television by 20. He can do something like this:
- service: remote.send_command data: entity_id: remote.bedroom device: television command: volume up num_repeats: 20
I use this powerful tool combined with a data template to voice control the volume of my TV. I can say things like "Alexa, set TV volume to 50". If you want to know how I do it, just ask me and I send you the config.
So that's it, I hope you enjoy this integration and make good use of it. And if there is anything I can do to make this code better before it is merged please let me know and I will do it.
Related issue (if applicable): #23888
If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Please, update the documentation and open a PR for it (be sure to create a documentation PR against the
It is not clear to me how to combine sending several commands and repeating some commands at the same time.
You could definetely do both.
- service: remote.send_command data: entity_id: remote.bedroom device: some_device command: - 1 - 2 - 3 num_repeats: 2
The num_repeats is the outer loop, so this script it will send 1 2 3 1 2 3.