Trigger automation on remote.send_command event

I have a Broadlink RM4Pro that I’m successfully using to send commands to a pre-amp DAC with Home Assistant. Unfortunately, there is an OLED screen on the DAC that turns on anytime it receives a command, and it does not turn off automatically. Another command has to be sent to turn the screen off.

What I would like to do is have an automation that gets triggered any time HA sends a command. The automation would then wait 10 seconds, and then send the command to toggle the screen. This seems like it would be the simplest way to handle this. I’m sure I could make a script for every command, but that seems inelegant.

I take it that the move here is to have the automation monitor for an event, but for the life of me I can’t figure out how to approach that. I’m using the event monitor in the dev tools, and nothing shows up when I use HA to adjust a setting on the DAC. (I’m monitoring for ‘*’).

Any pointers would be appreciated!

For every action/service call (remote.send_command), home assistant generates an event and you can fire another automation when this event is received with specific context.

You have to filter out unrelated events (there will be many) and let your automation run only interested event type and arguments.

Thanks for the reply. I understand that this is the approach, in general. But I’m not having much luck setting it up. It would be helpful if I could just see the events the system is generating, but using the event viewer is not turning anything up.

See my post here.

Thanks for replying. I am trying this approach, but no event is showing when I issue a command.

I am not sure if an action actually goes to the event bus.
Test it with something else, like a light, and see if the action is recorded or only the reply from the device.

Okay, I figured it out. I was navigating away from the Developer screen to issue the command, and apparently that removed the listener. That’s kindof frustrating, but whatevs.