dmamontov / esphome-blekeyboard

ESPHome BLE Keyboard
https://community.home-assistant.io/t/esphome-ble-keyboard/
84 stars 16 forks source link
ble blekeyboard cpp11 esp32 esphome esphome-component homeassistant keyboard python3

ESPHome BLE Keyboard

CodeQL Telegram

Custom esphome component to implement a virtual BLE keyboard.

More info

Supported OS

OS Description
Windows Fully supported
Linux Fully supported
Android Fully supported
MacOS It does not work stably
IOS It does not work stably

Base configuration

Requirements

Adding a component

external_components:
  - source: github://dmamontov/esphome-blekeyboard

Configuration

ble_keyboard:
  id: mamontech_keyboard
  name: "MamonTechKeyboard"
  manufacturer_id: "MamonTech"
  battery_level: 50
  reconnect: true
  buttons: true
  use_default_libs: false

Actions

ble_keyboard.print

Print arbitrary text.

ble_keyboard.print:
  id: my_ble_keyboard 
  text: "hello"

ble_keyboard.press

Press a key.

ble_keyboard.press:
  id: my_ble_keyboard 
  code: 0x80

For media keys:

ble_keyboard.press:
  id: my_ble_keyboard 
  code:
    - 0
    - 1

ble_keyboard.release

Release keys.

ble_keyboard.release: my_ble_keyboard

ble_keyboard.combination

Press a key combination.

ble_keyboard.combination:
  id: my_ble_keyboard
  delay: 8
  keys:
    - 0x80 # Left CTRL
    - "a"

ble_keyboard.start

Start advertising.

ble_keyboard.start: my_ble_keyboard

ble_keyboard.stop

Stop advertising and disable customers.

ble_keyboard.stop: my_ble_keyboard

Credits