reconnect (Optional, bool): Automatic reconnect service after disconnecting the device. (default: true);
buttons (Optional, bool): Whether to add separate buttons for keys (default: true);
use_default_libs (Optional, bool): Whether to use the arduino standard library. In recent versions of frameworks, they come by default. Actual for esp32s2, esp32s3, esp32c3 and esp32h2. (default: true).
Hi, great project, thank you for sharing it with the community.
I’m trying to use it to control an nvidia shield, I have been able to do almost everything except for the menu, I haven’t found the right code.
I would also like to be able to control the fast farward and rewind functions, is this possible?
Again thank you for the effort this project is realy useful and is also faster than using adb.
Unfortunately, I can’t advise. I think it is necessary to look for codes or their combinations. I had an idea to develop a separate component that would allow them, on the contrary, to be intercepted from the original consoles. I think I’ll implement it as soon as I have time.
Understood, thank you.
Just another question, I’m trying to create a button that sends the KEY_MEDIA_PLAY_PAUSE, I used the following code, but it returns the error “Expected integer, but cannot parse {8, 0} as integer”
Hi dmamontrov,
great project you started there. Unfortatnely with my new ESP32-C3 I do get all the time the following error messages which let the deploy abord. Any suggestion how to slove that?
Or is there something else wrong?
In file included from src/esphome/components/ble_keyboard/ble_keyboard.cpp:3:
src/esphome/components/ble_keyboard/ble_keyboard.h:7:10: fatal error: BleKeyboard.h: No such file or directory
*********************************************************************
* Looking for BleKeyboard.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:BleKeyboard.h"
* Web > https://registry.platformio.org/search?q=header:BleKeyboard.h
*
*********************************************************************
#include <BleKeyboard.h>
^~~~~~~~~~~~~~~
compilation terminated.
*** [/data/c3u/.pioenvs/c3u/src/esphome/components/ble_keyboard/ble_keyboard.o] Error 1
In file included from src/esphome/components/ble_keyboard/button.h:7,
from src/esphome/components/ble_keyboard/button.cpp:3:
src/esphome/components/ble_keyboard/ble_keyboard.h:7:10: fatal error: BleKeyboard.h: No such file or directory
*********************************************************************
* Looking for BleKeyboard.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:BleKeyboard.h"
* Web > https://registry.platformio.org/search?q=header:BleKeyboard.h
*
*********************************************************************
#include <BleKeyboard.h>
^~~~~~~~~~~~~~~
compilation terminated.
*** [/data/c3u/.pioenvs/c3u/src/esphome/components/ble_keyboard/button.o] Error 1
========================= [FAILED] Took 57.89 seconds =========================
Hello I’m trying to use this as a play pause remote for my android phone it connects and all that but when I try pressing play/pause key it keeps the key pressed so it just keeps pausing and playing all the time and pressing release key don’t help it only stops when I press another key and then that key is pressed.
I also tried volume up and down and it keeps pressing until max or min volume and keeps pressing
i have tried different delay press/release and also this in my yam file
so it appears it does not release they media keys property with bleKeyboard.releaseAll();
when I make this change in ble_keyboard.cpp
void Esp32BleKeyboard::press(MediaKeyReport key, bool with_timer) {
if (this->is_connected()) {
if (with_timer) {
this->update_timer();
}
bleKeyboard.press(key);
delay(100);//<--
bleKeyboard.release(key);//<--
}
}
it works perfectly, thank you for all the work you put into this. Now I can use my ikea volume knob for pause play and volume when I play audiobooks from my phone to my google speaker.
This is great!
I managed to solved an annoying issue I had with this project,
I have a Xiaomi mi box S, that disconnects from WiFi in sleep mode, so there is no way to wake the device up from sleep without the remote.
Figured out the remote is just a BLE HID device and the Xiaomi box keeps the Bluetooth on when it’s in sleep mode.
Flashed an esp32 with the project on it, paired with the Xiaomi box, and now I can just send a key to wake the device up, finally I can fully control it with home assistant!
So a huge thank you for this!
I do have a question - do you know what is the key code or key combination to lock (or sleep) an android device?
I have a Logitech Bluetooth keyboard that when I press fn + “L” it locks the android device it is connected to, the same key combination also put a windows machine to sleep when it is connected to one.
Do you think this functionality can be achieved with esp BLE keyboard?
I think it’s possible. But you need to find a code. Somehow in the vastness of the network I met combinations for various actions with Android. I’ll try to search and add to the examples.
Hi there, I’m pretty new to ESP Home in general and am working to get this set up. I took the .yaml from the ESP32 example in the github and changed the stuff for my own names.
However, when I go to install this, I see the following error:
INFO ESPHome 2023.7.1
INFO Reading configuration /config/esphome/family-room-bt-keyboard.yaml...
Failed config
external_components: [source /config/esphome/family-room-bt-keyboard.yaml:46]
- source:
type: local
Could not find directory '/config/esphome/../components'. Please make sure it exists (full path: /config/components).
path: ../components
I feel like I’m missing something obvious, but I am sort of out of my element with .yaml config. Any advice?
Edit: I went back to the main page and copied just what was in the blocks:
This does install and I can see and adopt the device in HA, however I have no idea how to initiate the connection to the Nvidia Shield I’m trying to connect to. How do you do this?
One last edit: Apparently you just select the HA keyboard from the device itself as it’s always available for pairing lol.