I have successfully added Broadlink RM4 mini to HA and added some remote commands at it works, but what i need is add this commands to Lovelace so i can with a Single Tab action (a Toggle) set the TV on/off or set the volume repeatly to tab that button.
No luck, where did you get the ID. Is that the device ID? What i need really so simple one touch button in lovelace but it likes so difficult this. It works wel with switch but the i need then click double on the button
The entity_id is your Broadlink remote, the Device and Command parameters come from your broadlink_remote_xxxxxxx_coes file located in /config/.storage (these are the names you gave when you recorded the codes):
Yes, in my earlier post I said that I can get it to work in automations but not in a lovelace button, not sure if this is a bug. Someone else has mentioned using a script (which runs the same code as an automation trigger) so maybe you could write a script similar to my config above then have you button turn on the script.
I think we are OK with setting up switches to fire the IR codes. What we are discussing here is firing codes learned using the remote.learn_command service via the remote.send_command service. This has the advantage of keeping the long complex IR codes out of your yaml as you only need the specify the device (e.g. “tv”) and command (e.g. “power”).
So far this only seems to work in automations & scripts but not in lovelace.
Can you please help me in my situation how to and what to add in scripts such as “mute” command and what to be added in Lovelace. Guys why is this now so difficult…
Hello again, while looking into your problem I was able to resolve why my TV remote cards were not working - it was because I had “data” rather than “service_data” in the config.
If you want to try this out you can use the custom:tv-card from HACS as follows:
If you do not want to emulate a remote control then you can just create buttons in a horizontal stack for the functions you require as mentioned in my previous post. The nice thing about doing this way is that you avoid having to deal with all the lengthy IR codes
This works now like a charm!!! Thank you so much for that!!!
Another question is just say i want to volume be by every startup stay on the +10 (it should not be when the TV was +5 just you turn off the TV and turn On the TV back not the +15)
And how can i customize such as when you click on a button it must repeat ‘4x down - OK - OK’ so i can automate that a channel will startup automatically on the Box?
Sorry but I don’t understand your question about the TV volume going +5 or +10. Typically when you switch a TV on it will be at the last set volume.
There is a way to have muitiple key presses using the “num_repeats: x” parameter. I use this to automatically turn the TV volume +10/-10 when someone turns on our big noisy fan in the lounge. Here is the automation for it (sonoff04 is the switch for the fan):
If you always want the TV to come on at a set volume regardless of the way it was last left then maybe you could send a mute command followed by a volume_up with num_repeats:10.
Another question, how can i fire multiple scripts after and after. Such as command source, and then arrow left and then OK. In this way i want to do a button so i can with one click set TV on chromecast.
The first is to create a new longer script to do what you want by chaining the commands together e.g. :
watch_chromecast:
alias: watch_chromecast
sequence:
- service: remote.send_command
data:
device: lounge_tv
command: power
entity_id: remote.broadlink01
- delay:
seconds: 2
- service: remote.send_command
data:
device: lounge_tv
command: left
entity_id: remote.broadlink01
- service: remote.send_command
data:
device: lounge_tv
command: enter
entity_id: remote.broadlink01
mode: single
This is just intended as an example and note that you might need a delay after powering on the TV to let it get started and ready to accept the following commands.
The other option would be to create a new script and then call your existing scripts from this one using the script.turn_on service e.g.
Again, this is not real code but just intended to illustrate whow you might go about this. This option would obviously make sense if you already have scripts setup for your codes.