Hey there
I have some projects in the pipeline, where I plan to include an esp32 for some basic things like turn an led on / of… etc.
Now, I want also to make use of the other benefits that I can have when using an ESP32 - for example, they should act as an bluetooth proxy, and maybe also include voice assistant later.
BUT:
I would like to implement a Switch component to turn on or of the Bluetooth Proxy functionallity
so is there a way to implement this:
bluetooth_proxy:
active: true
with a turn on / off switch that can be controlled within the Dashboard from Homeassistant?
if I would have seen any “on/off” option, I would probably not ask if there’s a method to implement such…
The question “why” - is another such question that doesn’t matter in that case… I would like to have an option to switch the bt proxy on or off … if that’s possible somehow - even with more complex code
I always “love” the question why someone want to have a very specific request, just because it doesn’t make sense to others…
So… is there any way to change such setting from true to false with a switch / script - whatever?
Yes? → then it would be nice to provide some help
No → then, that’s also fine for me…
Thanks.
ok… sorry for my “rude” words…
The reason is pretty simple… I want to implement BT Proxy - but I just want to enable it when I actually need it… right now, I don’t need it - but I don’t want to change the Config every time when I might need it…
Also, sometimes, you might just disable some functionallities for a certain time… so I do have some Plant sensors on plants on our balkony… I have a BT Proxy to get those information in the kitchen… but when we bring the plant inside over the winter, I don’t need the BT Proxy enabled in the kitchen…
Why in the world would you ever need to toggle it on/off? That makes about as much sense as wanting to toggle your router on/off. BT proxying is meant to run in the background and be a BT middleman. I think you might be overthinking this and gonna make things more difficult than they need to be.
I really wonder why people argue about the reason for a request, if they can’t provide an answer to a specific question…
is it just for the sake of writing something?
Anyway - as I already explained, I do have some devices, that should act as a BT Proxy under some conditions.
And if these conditions are not met, they don’t need to do ANY kind of BT stuff…
It’s just like the newly integrated switch for the Voice-Assistant to switch wake-word detection on or of…
IF I use the device for VoiceControl, I don’t “NEED” to switch between Push-To-Talk or WakeWord detection… I could just configure the device as I want it to behave.
But I CAN do it…
And I would like to be able to Controll options the ESP can do - if I need it - without always changing the Code and recompile the whole thing.
I don’t think, that my question: “Is it possible” is completely invalid, just because YOU don’t need such options…?
Knowing how to enable specific parts in the configuration could be an interesting part in other areas, too… not only for BT …
It could also enable other configurations which you might need in some cases - and in others not.
You would have just much more flexibility in the end.
Anyway… thanks for your reply without any information.
Well, not everything. Local automations and stuff continue to work but you obviously loose the “connected” (“smart”) feature of that esphome node
YES! All automations you define in ESPHome are executed on the ESP itself and will continue to work even if the WiFi network is down or the MQTT server is not reachable.
that’s why I wrote: “I would need the ESP for”
Because, that is the main purpose of the device in this particular case or more precise, in nearly all of my cases…
You could go to source code of Bluetooth proxy, create a writable property to do that. It doesn’t exist as of now.
On the other hand, there is custom component which might have this feature, ble_gateway and you can send the ble advertisement to custom passive ble monitor integration.
do you really think, I would not know that I might need the BT-Proxy there when the plant would just be placed aprox 2m ?
The plant will be placed to a complete different location for the winter… maybe the cellar… where I would then need another BL-proxy, because I don’t want to move my S3-Box from the kitchen to the cellar.
So … yep… I don’t need the BT Proxy in the cellar over summer times and I would not need the BT-Proxy over winter times in the kitchen - at least as of now.
Maybe, also relevant… before more questions will be asked… all the esp devices, that act as BT-Proxy do have other tasks, too… so BT-Proxy is just a “Side-Effect” which I want use.
The device in the cellar for example would read my water-meter… + having BT Proxy option as Bonus.
Some other ESP will be built in in Figures and Model-Kits, to controll lights, and so on… + Bonus having BT Proxy which I can just enable if required.
That being said - I just don’t want to recompile every ESP when I come into the situation, that I do need BT Proxy… it should be like a feature, that can be turned off if not required.
@anon63427907: Thanks… I don’t think, that I will be able to edit the source code for my requirements…
But I will have a look into the custom component to see, if that would enable the feature.
Nevertheless… I already found a feature request to implement an “enable / disable” option for the whole BLE stuff… it seems that I am not the only one witch such an idea.
Then again, having bt proxy on all the time will not do any harm and will strengthen your BT reachability and reliability. I am not trying to decry your use case, but I find it hard to tell why you want to turn it off.
The one thing I can think of is if the esp32 is not up to task of running bt proxy and whatever else you want it to do. bt proxy is quite resource intensive. But in that case you wouldn’t even want to turn bt proxy on seasonally, because whatever else you want it to do might stop working properly. You’d just get another dirt cheap esp32.
I guess I just don’t get it, but that’s OK, you understand your use case! I think I see you learning c++ …
Looks great but active property of Bluetooth proxy correspondence to active listening (vs passive one). It is not enabling or disabling the proxy. Am i missing anything here?
I did some further tests with the code above and found the following (for my plant-Sensors, at least)…
turning all three switches off:
Plant-Sensor becomes unavailable
turning on Bluetooth Proxy allone:
No change, all Sensors are unavailable
ESP32-S3-Box is rebooting randomly
turning on Bluetooth Proxy + BLE Scan active:
no change, all Sensors are unavailable
turning on BLE Continous Scan → (all others are off)
Plant Sensors become available.
So, the BLE Continous Scan seems to activate the whole BLE Stack on the device, which will automatically enable the Bluetooth Proxy.
In this case, the other two switches, especially the one for the Bluetooth Proxy seems out of function.
But so far, it would fit my needs, with only enabling / disabling Bluetooth at all.
Why even overcomplicate things by switching On/Off? Set up a BT only device somewhere hidden and out of the way in any rooms you need and then use seperate esp32 boards for whatever else. These boards are a few $$ not a few thousand $$ where you need to make 1 board do everything. Some things just shouldnt be overcomplicated.