Hi,
I would like to use my small wireless USB Keyboard (attached with a magnet to the wall) as a lightswitch & more for my openhab smart home system on a RPi 3 B+.
I couldn´t find the according binding which listens to USB input in order to trigger rules with a single keypress.
You won’t find a binding that supports this AFAIK, and to be honest it sounds a bit too “special-purpose” to fit with a binding.
Depending on exactly what you are trying to achieve, however, there may be others ways to solve this. A bit more detail would be necessary in that case.
Are you really trying to use specific keys on a keyboard as dedicated light switches? Or are you looking for a more general way of navigating a UI for your openHAB-based lighting system?
Input devices are not treated like other USB type devices. There is no file under /dev that I know of that you can watch to get keyboard entries (I could be wrong).
So what you will need to find is a Linux based keylogger that can be compiled on an ARM processor and modify it to publish messages to OH (REST API calls, MQTT, etc) when certain keys are pressed.
I would have hoped for a binding that can read evdev events from /dev/input/ (https://www.kernel.org/doc/html/latest/input/input.html#event-interface) and trigger OH events from that.
This should be possible with native or java logic. This would only give raw keycodes though.
Maybe somebody here has already worked on that?
Thank you, that’s exactly what I’m looking for. Could you please share a precompiled .jar file here since I don’t know how to do that. Thank you very much in advance.