Add Broadlink RM4 Events

Hello,

I just installed/integrated the Broadlink RM4 Pro in HA. I was hoping to be able to use ir signals from a remote to start automations (So a remote control for HA). It appears the integration is only able to learn, send, and delete codes. Would it be possible to add a “remote.received” event to this integration to enable HA automations instead of only blasting known codes?

Not sure what you mean by “remote.received”. The RM4 only sends commands - it has no way of knowing whether the command has been received or not. As far as HA is concerned the devices the Broadlink is controlling do not exist.

If you are only using the RM4 to turn things on and off you can represent the state of each device in HA with input_boolean “helpers”, creating small automations to issue remote.send commands when the helper is toggled. Once you have done this the state of the helper can be used to trigger automations and you can assign appropriate icons for use in Lovelace.

If you go down this route, HA generally should only ever reference the devices the RM4 is controlling via the helper. If you use the remote.send command explicitly anywhere the toggling is likely to get out of sync.

I don’t really get you. Why it’s only possible to send command with RM4 when teaching the IR codes is basically teaching the device what button is what so the RM4 is capable of receiving and deciphering commands as a sensor. Why is it not possible to let the device always listen and when I press a button on my IR remote it detects what button I pressed? Just like most zigbee switches and sensors work as a zha_event it could be an ir_event.
I know this wouldn’t be an essential feature but it would be nice to have. It would be possible to control my xbox, lights, ac with my IR remote.

The RM4 isn’t a sensor. When it “learns” a command, it writes it to a file. When it sends a command (in response to an instruction from HA), it reads it from the file. It doesn’t “listen” in any sense at all.

I literally just signed up to let you know you are absolutely correct. Don’t listen to these GPT Home Assistant Hackers… the device is more than capable of “learning” so that means its able to receive a signal and do something to it (save to file). That means all you have to figure out is how to