I am using the “Namando Keypad” which is a Bluetooth numeric keyboard. It is working perfectly through the below configuration and using some automations on the buttons:
I am using Hassio installed on buster - RPI 4B
Issue:
Since the device disconnects automatically after some period of unuse, the reconnection does not seem to register in Home Assistant. I have checked through ‘bluetoothctl’ and the device is reconnected fine (see below) but the HA does not detect it. Even the Automation script for disconnection also does not trigger during this period. This is only restored when I restart the Home Assistant
bluetoothctl output in RPI
Name: Namando Keypad
Alias: Namando Keypad
Class: 0x00000540
Icon: input-keyboard
Paired: yes
Trusted: yes
Blocked: no
Connected: yes
LegacyPairing: no
Update to the above:
Issue still consistently occurring,
The device does disappear and reappear as expected when it goes to sleep and reactivated respectively. I could see the details of the connectivity in the linux console. Also confirmed from LED as there is a small led in keyboard which turns red and green as expected.
I found out that the actual input files I think get changed everytime a reconnect is made. The below is the output of cat /proc/bus/input/devices
The input# in the below S:…/input/input0 always gets a new number. Is this the source of the problem? If yes, the device_descriptor: “/dev/input/event0” should have automatically referred to the right files - unable to understand why does it now work
I have investigated further, I got another similar remote. And this remote somehow reconnects properly and promptly to HA. I am able to get consitent notification even after prolonged sleep. So I guess, it is to do with the device rather than the HA or RPI. The device I used is similar to this:
This issue is still persisting in latest 109.2 release. Although I have successfully paired my old Amazon Fire TV remote still it doesn’t reconnect automatically. I need to restart HA every time. Guys please help me resolve this issue. Shall we re-post this issue into Github ?
As I stated above, don’t think the issue is with HA. I believe it is the device which does not retain the info to reconnect after sleep. Some devices do and connect properly. You might want to go via a BLE mode
If the keypads were on BLE, we could use the chips like esp32 to record keystrokes for each ble event. Currently the cheap iTag that has 1 button can easily be connected to esp32 and their actions captured and sent to HA