Skip to content

Cookbook

Dmitry Mamontov edited this page Aug 1, 2022 · 1 revision

Sending a simple message

button:
  - platform: template
    name: "Simple message"
    id: simple_message
    icon: "mdi:send"
    on_press:
      then:
        - ble_keyboard.print:
            id: my_ble_keyboard
            text: "Hello world!"

Pressing the ENTER key

button:
  - platform: template
    name: "Enter"
    id: key_enter
    icon: "mdi:keyboard-return"
    on_press:
      then:
        - ble_keyboard.press:
            id: my_ble_keyboard
            code: 0xB0
        - ble_keyboard.release: my_ble_keyboard

Press CTRL + ALT + DELETE

button:
  - platform: template
    name: "CTRL + ALT + DELETE"
    id: ctrl_alt_delete
    icon: "mdi:microsoft-windows"
    on_press:
      then:
        - ble_keyboard.combination:
            id: my_ble_keyboard
            delay: 8
            keys:
              - 0x80
              - 0x82
              - 0xD4

Press CTRL + A

button:
  - platform: template
    name: "CTRL + A"
    id: ctrl_a
    icon: "mdi:format-color-highlight"
    on_press:
      then:
        - ble_keyboard.combination:
            id: my_ble_keyboard
            delay: 8
            keys:
              - 0x80
              - "a"

Lock an iPad

button:
  - platform: template
    name: "Lock an iPad"
    id: lock_an_ipad
    icon: "mdi:lock"
    on_press:
      then:
        - ble_keyboard.combination:
            id: my_ble_keyboard
            delay: 100
            keys:
              - 0x83
              - 0x80
              - "q"
Clone this wiki locally