Keyboard as automation trigger, possible?

Hello, I have a keyboard with pad, like this;

images

It’s connected to an android phone trough a USB dongle, and with the official HA app I can control HA.
I would like to know if there’s a way to trigger automations with a key or a key combination (like Ctrl + W) so I can use it for multiple shortcuts in HA.

Thanks in advance.

The only way I can think of is if you somehow map those button presses as intents then use the HA apps intent listener to read it.
A quick search gave me this:
[Help] Can Tasker detect specific key-presses from a Bluetooth keyboard? : tasker (reddit.com)

So probably if you use one app to relay it to Tasker that then fires the intent.
I could not find anything in Tasker to read the keyboard, but I don’t have a keyboard either so perhaps it’s not showing or I don’t know what to look for :slight_smile:

You can use the AutoInput plugin direct in Tasker. Set a profile that specifies which keys you want to detect. The task has a variable which shows which key (combination) was pressed. You can detect down, up, or both key activations. You tell autoinput if it is to pass through the key combination to Android as well, or only to your task. When you do this, you need to specify the same keys you are intercepting - if you don’t all key presses are not passed through.