Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] sent text to the spotlight ipad app. #29

Open
arcidodo opened this issue Jul 18, 2023 · 0 comments
Open

[bug] sent text to the spotlight ipad app. #29

arcidodo opened this issue Jul 18, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@arcidodo
Copy link

arcidodo commented Jul 18, 2023

i spend some hours to get this working but here is my config to control an ipad what is hanging on the wall:-)

everything is working great except the text i sent "Home Assistant" of "Woning" is sometimes scrambled, so Home Assistant is sent as "Ho Assistantme" is it possible to get some delays between the letters what is sent?

globals:
  - id: ipad_state
    type: bool
    restore_value: no
    initial_value: "false"

# Enable components
external_components:
  - source: github://dmamontov/esphome-blekeyboard

ble_keyboard:
  id: my_ble_keyboard
  name: "MyBleKeyboard"
  manufacturer_id: "Apple"
  reconnect: true
  buttons: false

switch:
  - platform: template
    name: "Screen iPad"
    icon: mdi:power
    lambda: |-
      if (id(ipad_state)) {
        return true;
      } else {
        return false;
      }
    turn_on_action:
        - lambda: |-
            id(ipad_state) = true;
        - ble_keyboard.combination:
            id: my_ble_keyboard
            delay: 1000
            keys:
              - 0x20
              - 0x20
        - ble_keyboard.press:
            id: my_ble_keyboard 
            code: 0x20

          
    turn_off_action:
        - lambda: |-
            id(ipad_state) = false;
        - ble_keyboard.combination:
            id: my_ble_keyboard
            delay: 100
            keys:
              - 0x83
              - 0x80
              - "q"
button:
  - platform: restart
    entity_category: "config"
    name: "Restart"

  - 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"

  - platform: template
    name: "unlock an iPad"
    id: unlock_an_ipad
    icon: "mdi:lock"
    on_press:
      then:
        - ble_keyboard.combination:
            id: my_ble_keyboard
            delay: 1000
            keys:
              - 0x20
              - 0x20
        - ble_keyboard.press:
            id: my_ble_keyboard 
            code: 0x20


  - platform: template
    name: "Open App Home Assistant"
    id: open_ha
    on_press:
      then:
        - ble_keyboard.combination:
            id: my_ble_keyboard
            delay: 500
            keys:
              - 0x83
              - 0x20
        - ble_keyboard.print:
            id: my_ble_keyboard 
            text: "Home Assistant"
        #- delay: "00:00:01"
        - ble_keyboard.press:
            id: my_ble_keyboard 
            code: 0xB0

  - platform: template
    name: "Open App Woning"
    id: open_hk
    on_press:
      then:
        - ble_keyboard.combination:
            id: my_ble_keyboard
            delay: 500
            keys:
              - 0x83
              - 0x20
        - ble_keyboard.print:
            id: my_ble_keyboard 
            text: "Woning"
        - ble_keyboard.press:
            id: my_ble_keyboard 
            code: 0xB0
@arcidodo arcidodo added the enhancement New feature or request label Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants