-
Notifications
You must be signed in to change notification settings - Fork 8
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
[Fix Released] ESP32 BTProxies not working. #4
Comments
Same for me. Were getting "No backend with an available connection slot that can reach address" after I removed the Bluetooth dongle from my Pi :) |
Extra details: bleak.exc.BleakError: No device found for address 00:1A:22:16:BA:58 and then Traceback (most recent call last): Caused by File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 170, in connect From ESP: Keep up the good/great work ! Keep on improving the code. |
|
@andyxpert it may well ve that you have the Firmware>1.20, in which case you need to pair it with the esp first. I haven't tried this yet, but it may ve enough to hold the device button pressed for 5 seconds or so, and then adding the device in HA (make sure no other Bluetooth adapter is on) |
Is there an easy way to check the firmware version btw? |
No result, tried with different configs in esp (esp32_ble_tracker and bluetooth_proxy both with active true), doesn't seem to work. added verbose logging in esp, will paste below.
I'll post if something changes |
Yes, either:
|
@andyxpert did you try what I said about pairing? |
Yes, but nothing happens. I think esp can't pair with the thermostat, think it only works for passive ble devices, as it shows in the log above that it does send messages to homeassistant, but when pairing it somehow doesn't |
You are right... I must have made a mistake during testing then. I do remember the esp discovering it, but I guess when I connected, it used the bluetooth adapter in my HA machine :/ @api_error_as_bleak_error
async def pair(self, *args: Any, **kwargs: Any) -> bool:
"""Attempt to pair."""
raise NotImplementedError("Pairing is not available in ESPHome.") |
I corrected the readme. If you find any way to downgrade the firmware to pre v1.20 let me know. That should actually work. |
@dbuezas I will continue here, because this issue is actually Bluetooth Proxies ;). I adopted the proxies to ESPHome. Unplugged the Bluetooth Dongle from Pi (so I am only left with Bluetooth Proxies). Logs from ESPHome show nothing useful (potentially logging level too high). In HA, I got this:
I am not sure if by device it means Bluetooth dongle or the thermostat. But it almost seems like your implementation tries to always connect to the thermostat through the same BT adapter? |
Then I restarted Hassio and got three different errors for three different thermostats. Logs below: FIrst
Second
Third
I hope that helps. |
I think this may be because the btproxy is not yet connected to HA. The component should sooner or later switch to the BTProxy, and then you will get a different error :/ |
Thanks for the experiments btw |
If I should just create a new issue, let me know ;). |
I can disconnect it tomorrow and wait longer and see what happens. But first I want to make sure it's warm in the house, so don't want to leave it disconnected for the night ;). Let me know if checking that would be useful :) |
And maybe that first message is useful. :) And actually... one of the Bluetooth Proxies may have just connected to a thermostat. This showed up in ESPHome logs:
|
But when updating temperature, I don't think it uses it to communicate. I am not sure how to verify that |
Also got a few of those:
|
Hmm, reopened, so there is something you can do directly in HA component to alter/control the esphome communication with the thermostat ? Interesting, i thought the issue was in esphome after we validated that it works with BT natively (yesterday) |
We could try to find out if BTProxies work on old firmwares at least:
|
I haven't followed the full instruction yet. Just installed 1.0.1 and now I have this:
However, after this, it seems to update very fast which with this specific thermostat may mean that it actually used the proxy. But I will need to see tomorrow if it still happens when I unplug the dongle ;) |
Nothing new, nothing interesting...
but i also have this:
Hope it helps |
I got those messages too, but then it worked. But again I don’t know if it fell back to the dongle or actually worked through proxy. Will play with it tomorrow and report back. |
It's most probably through the dongle. i got this eventually:
But still not working in HA. This error originated from a custom integration.
sooooo still not working, though you must be on the right track as ESP connects (somehow) to the Thermostat |
Then I just need the firmware version. If any of you has v<1.20 and it still doesn't work, then it may not be pairing after all and maybe something can be done |
The one I tested yesterday was 1.20. I will check the other ones and follow the full instructions today :) |
I have checked my logs. I am getting only some messages during or right after restart BT Proxy. Only from time to time, I will get message about some issue with disconnecting device - I don t have it now but is say something that is done before disconnecting properly device or similar - it is like 1 per day /1 or per 2-3 days. |
OK thank you for this information but then it seems to be a different problem in my case. |
Are you on the latest Home Assistant and ESPHome versions? |
@dbuezas yes i am running the latest esphome and the latest HA version.I have changed many Options in the passt to fix the problems without any effect.One thing i could Not figure Out till yet how can i bind thermostats to a specified Proxy or isnt it possible ?! |
@M4Marc did You tried first with one TRV? I recommend You play first with one TRV to see if is working good and then increase value of TRV connected to HA. |
@maciekelga all good ideas and correct 👍. @M4Marc Can you try removing a thermostat, disabling the bluetooth adapter, restarting HA, waiting for it to be discovered automatically via BTProxy and adding it that way? There is a slight chance that the mac address of the TRV reported by the USB adapter is not the same as the BTProxy (I know this to be the case when running HA directly from a Mac) |
Can you give some examples of the error messages? |
I will be Back tomorrow and give you the informations thank you for your interests in advance |
@Eroli
i have any questions about your solution. can you send me a mail [email protected] please. |
My TRV since last winter are very stable, I have no more issue when working together with ESP32 Proxy. |
Actually? Sorry if I say that because I read your words but I don't believe them. |
Wow, 18 is a lot! I have 7 and thought I was exaggerating. Have you ever paired them with a phone? I read somewhere that once paired, they ignore every other request. I assume you did try long pressing the button and resetting at least one, right? |
@moscito1010 I don't know how did You start, but I suggest to delete all of them from HA, in next step turn on just one, and try to fix connection with one. Once is configured, set scan interval for 5min. Afternoon I can send You my configuration of ESP32 Proxy. @dbuezas |
Hi @moscito1010 , In total, i have 12 TRVs, which are controlled by 5 ESP32 based on tasmota. Using the MAC filtering i can achieve a latency ranging from 3s (normal) to up to approximately 60s (worst case). Furthermore, i stepped away from the Heltec Wifi Kit 32, as i noticed the wireless connection of those boards is not really good. Using simple Wroom32 boards i get much more stable results. If you are still interested in this solution, i can help you out setting something up! EDIT: Before i updated my tasmota solution i also tried, once again, the ESP32 bluetooth proxy feature, but ran into problems with some TRVs working on an older firmware version. Using tasmota, things are working quite reliable independent of the TRV firmware used. Also for TRVs working with a newer firmware version, the tasmota solution is more stable and reacts a lot faster than the approach based on bluetooth proxies - at least in my opinion and based on the experiments i did with some TRVs. |
@Eroli |
Hallo everybody, |
It's a shame that there's no reaction, but maybe the solution is totally secret and can only be shared with the Illuminati :-) |
I am not using btproxys I found them to barely work with these thermostats, but others say it works fine for them. Maybe it depends on how many bluetooth devices are in the surroundings or some other external factor. I use:
|
@Eroli blames him for changing the BLE Tasmota version. That sounds very promising. addition: |
I didn't understand that Eroli had a special brunch for that. I didn't see the other branch. For understanding, a question to @Eroli // !!! Remember that your changes GOES AT THE BOTTOM OF THIS FILE right before the last #endif !!! #define USE_EQ3_ESP32 #endif // USER_CONFIG_OVERRIDE_H All TRVs that are nearby are still displayed in the BLE menu item and nothing has changed in the behavior of the ESPs. |
Hello everyone, excuse the late response, but I am currently very busy at work. Moscito1010 is right, I have created a Tasmota fork and implemented my changes there, which are very rudimentary. I also think a fork is best here as I see the MAC filter as a special case which would hardly be of benefit to most Tasmota users. The biggest changes can be found in tasmota/tasmota_xdrv_driver/xdrv_85_esp32_ble_eq3_trv.ino, for example in the matchPrefix function, in which the hardcoded MAC addresses are filtered. You can then parameterize the MAC filters in tasmota/user_config_override.h. In my case, for example, it looks like this:
Since I rarely change the room-specific things (fourth part), I actually only have to change the set room in the third part of the code snippet, depending on which ESP I want to flash. In my case, I build the firmware with the tasmota32-DE profile and then flash it onto the ESP. After the ESP has been flashed, it only takes a few seconds for it to detect the thermostats. In the web interface of tasmota, in my case in German, you can check this via Consoles --> Console --> TRV devlist. The answer looks something like this:
So, only Thermostat A is connected with a signal strength (RSSI) of -93dBm. If everything has worked, only the thermostats that you have set in user_config_override.h will be displayed in this console output. If other thermostats are displayed, you have made an error when compiling/flashing. If fewer thermostats are displayed, be patient or it may be that the missing thermostats have too poor signal quality (RSSI). @Mosquito1010: I would be interested to find out why this fork is not working for you. Are you sure you compiled and flashed the FW correctly? @ALL: I think the concept has become clear. You determine in advance which ESP should communicate with which TRVs. Verify your selection in the Tasmota console after flashing. In my case, communication becomes relatively unstable from an RSSI of -100 to -110 dBm, so I then try to query this thermostat via an ESP with better connection quality so that the latency of the overall system remains acceptable. As soon as the connection between the tasmotas and the thermostats is working fine, you may start implementing those thermostats in HomeAssistant as outlined here: #4 (comment) If there are any further questions, I will be happy to help. If someone is inexperienced with C or flashing ESPs, then we will certainly find a solution... Best regards! |
@Eroli Yes, I have questions about Home Assistant integration. Since this is already pretty off-topic and the problem is officially closed, I'll just take the plunge :-) Unfortunately, I have to admit that I'm a total HA boon and my learning curve is rather flat in this area. You then bring the individual sensor values into the HA via configuration.yaml using mqtt? This will be easy, I've already looked at it on the HA website. Is there anything to consider or do you have any other tips? Herzlichen Dank das du deine knappe Freizeit opferst um deine Lösung zu teilen. Mir hat es sehr weiter geholfen. |
Hi Moscito1010, I'm glad to hear that it's working for you now. Are you happy with the reliability and latency? Especially compared to the variant via BTProxy? Exactly, you have to define your sensors in the configuration.yaml file. I think I've already explained a lot about this in this comment, but if you still have questions or problems, please let me know.
But you can also leave the string empty, the buttons are quite self-explanatory, I think. A tip: There is a small but quite smart program called MQTTExplorer. This is very helpful to see what information is provided via MQTT and how you can access it and visualize it in HA. In this way, you could, for example, pick up the window-open status of the thermostats. I haven't implemented this myself because the thermostats only react very slowly anyway (and in my case only when the window is wide open), but it might still be quite nice. Kein Problem, es freut mich, wenn ich helfen konnte. Die alten Bluetooth-Thermostate sind zwar manchmal etwas zickig und die Kommunikation nicht 100%ig zuverlässig, aber es wäre schade diese entsorgen zu müssen, nur damit man sie besser in HA integrieren kann. Abgesehen davon laufen sie ja recht gut und stabil - außer die Batterie ist leer, dann öffnen die das Ventil komplett in meinem Fall, was schon mal sehr ärgerlich sein kann. Also, wenn ein Urlaub bevor steht und das Batterie-Symbol aktiv ist (könnte man auch in HA anzeigen lassen übrigens), unbedingt die Batterie wechseln ;-) |
Hi, |
But how do you decide which trv uses which proxy? Does btproxy not always relay all ble it sees? |
I didn't specify anything, just observe that if I have more than 2pcs TRV per BT Proxy it doesn't work properly. |
Has anybody tried pairing with btproxys ? https://esphome.io/components/ble_client#on-passkey-request |
Hello,
Got a problem where the thermostats are not visible through ESP Home Bluetooth Proxy integration.
The Thermostats were successfully paired using the BT from the server, communicated, all good.
I them moved them away (only reachable through the ESPHome bluetooth_proxy) and they became unavailable.
I only have the "bluetooth_proxy:" added to the esphome yaml and use the Wemos D1 Mini (Wifi & BT). The BT Proxy works as other BT sensors connect and work.
I tried also adding the esp32_ble_tracker without any luck.
The text was updated successfully, but these errors were encountered: