esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
417 stars 26 forks source link

Using Bluetooth buttons that indentify themself as keyboard (AB Shutter3) #2022

Open chanz opened 1 year ago

chanz commented 1 year ago

Describe the problem you have/What new integration you would like

For better readability:

I'd like to use Bluetooth keyboards or Bluetooth buttons, to work with esphome integrations and Home Assistant. The Bluetooth button AB Shutter3 I bought, registers itself as keyboard and sends "volume up" to the connected computer/smartphone.

Please describe your use case for this integration and alternatives you've tried:

My use cases: - I like to use the _AB Shutter3_ as a cheap alternative to toggle lights on and off. - _Optional:_ Using Bluetooth keyboards, stickers/labels and a wall mount to create an terminal that controls every part of my home automations without the use of submenus or key combinations. Alternatives I've tried: - I started with [this](https://esphome.io/cookbook/ble_itag.html) example. Since pressing the button on _AB Shutter3_ did not provide any output, I tried to understand how Bluetooth works. My guess is that the _BLE iTag Button_ supports notifications for the button press characteristics and the _AB Shutter3_ does not. **Notice:** The battery service and characteristic of the _AB Shutter3_ did work and shows 99%. - Using the service and characteristic list of _AB Shutter3_ (see below), I tried every service and characteristic UUID, but sadly nothing worked. - I've searched how to connect Bluetooth keyboards to an esp32 and found [this](https://github.com/esp32beans/BLE_HID_Client/blob/main/examples/BLE_HID_Client/BLE_HID_Client.ino). But I lack the knowledge to make use of it for esphome. **Additional context**

Enable logging

logger:

level: VERY_VERBOSE

Enable Home Assistant API

api:

ota: password: ""

wifi: ssid: "" password: ""

Enable fallback hotspot (captive portal) in case wifi connection fails

ap: ssid: "Testbench Fallback Hotspot" password: ""

captive_portal:

esp32_ble_tracker:

ble_client:

Replace with the MAC address of your device.

binary_sensor:

sensor:

This entry registers and awaits notifications for the

characteristic that signals button presses. Each time

a notification is received, the corresponding binary_sensor

is briefly toggled.

This entry queries the battery level. Some tags may not

support this characteristic, you will see 'Unknown' in the

HA frontend.

Thank you very much!

yildiraymeric commented 1 year ago

Hi,

I think what you are looking for is this project https://github.com/fsievers22/esphome-ble-remote

whc2001 commented 10 months ago

Just a note: these bluetooth shutter buttons turn themselves off after a certain period to save power. You need to press at least two times (first time to wake it up and make the connection, second to register the key press) to get it working after idling for a while, which I found quite annoying.