In quiet mode, things go very slowly
QuietDrift isn’t merged. And even when the PR is merged, it is just global setting that doesn’t allow you to use both quick and slow transitions.
We can discuss how to implement it to HA properly. In the meantime, I’ve created a server that implements what I need:
Note that this is for advanced users only.
It seems that I need to fix handling of disconnects. I believe I’ve found a way to do it properly, so I’ll probably update the gist soon. EDIT: Seems solved. However, logging using app.log.info doesn’t work for some unknown reason, so I cannot verify it as much as I want.
I assume bluetooth proxies are not available thru dbus?
Is this question related to my server that allows you to use QuietDrift? I don’t have any BT proxy, but I assume that it will not work with them. However, it uses the same library as Home Assistant (pySwitchBot). If you can use BT proxies with SwitchBot in HA, it should be doable:
- You need to add some library for the BT proxies.
- You’ll probably want to replace
device = await get_device(mac)
(see the latest revision) by something else that uses BT proxies.
Potential issue: I am not sure if a BT proxy can work with multiple IP connections.
Alternatively, you can look at the PR and patch your HA. The latest update adds support for speed
parameter in set_cover_position
service. While it was rejected by the HA core team, it might be suitable for your needs. You would have to patch every HA update, though.
Now, I have a BLE proxy, so I can potentially work on it. However, I don’t want to spend much time on that. In my case, I don’t need BLE proxy for range. The BLE proxy improves reaction time, which is important only when I want the curtain to move quickly, and I don’t use my server for quick movement.
TL;DR: If you want to work on it, I can assist and test it at home, but it isn’t my top priority.
I got some motivation for implementing BLE proxies: It gets a bit more complicated there. I used to have an issue with BT, which requires restarting BlueZ sometimes. I have a workaround – when all BT devices are offline, BlueZ should be restarted. However, with BLE proxies, the BT devices don’t go offline, as they are still available via BT proxy. But they are available just for Home Assistant, not for other services. I can invent some further workaround, but it looks rather complex.
It looks like I can use BT proxies via aioesphomeapi + bleak-esphome, maybe + habluetooth. There is a key question: should I implement it as a standalone service, or as a HA addon?
a. Standalone app: Probably easier. However, in some scenarios, there might be issues with hitting BT connections limit. IIUC, HA maintains list of available devices for each BLE proxy, and list of all the connections. So, it can probably decide not to use some proxy because of having saturated the maximum number of connections (IIRC 3 connections). However, when we have two separate apps (HA + psb server), they might be unaware of connections made by each other.
b. HA addon. Probably easier for most to install. However, I am not sure about sandboxing etc. Also, it would require some work for integration (registering a service instead of starting a HTTP server) etc.
EDIT: I’ve created a simple custom component that adds a new service with speed parameter. Need to polish it…
Has anyone got it working by the ways of modifying the curtain.py
? I’m on HAOS (Home Assistant Yellow) and can’t find anything using e.g. find / -name 'curtain.py'
. As I’d also be satisfied with only using slow mode from HA, this hack would be better than going through the app every morning
I figured the file curtain.py
is not present if Custom Deps deployement has not been used. So you have two options for this:
- Use Custom Deps deployement and modify the file afterwards (this has the benefit that you only have to modify if a new version of pyswitchbot is deployed, other releases wont break this)
- Modify the file inside the docker container
See also the instructions here GitHub - Brephlas/dirty-slow-curtain3: Dirty solution to have both fast and slow speed available for Switchbot Curtain 3
Also note, that all of this is based on HAOS, not sure if this can be used 1-1 on other installation types
Hello,
Can someone confirm if switchbot can connect with HA via WIFI, now that the HUB2 is out
I’ll go through the bluetooth mess if I have to, but just wanted to see if switchbot has joined the 21st century yet.
There are two SwitchBot integrations for Home Assistant:
- SwitchBot Bluetooth (probably doesn’t need much more explanation, it just connects locally)
- SwitchBot Cloud – uses cloud and connects via SwitchBot Hub.
Additionally, the SwitchBot Hub reportedly supports Matter, so maybe one could connect to the SwitchBot through Hub without cloud.
I don’t see much point in using the Hub unless you want some mixed setup.
Hey thanks for replying.
My desire for WI-FI, is because I have my HA on a Synology NAS
runs great, but Synology shut off the USB ports for everything except HDD storage
So you can technically install the drivers yourself for Bluetooth, skynet(matter), etc, but its a royal PIA
So that’s why I wondered if that HUB integrates…Then would that mean I can use WIFI for the hub and NOT need Bluetooth or matter?
Maybe some Bluetooth proxy (ESP32 BT proxy or so) will be a more universal (and probably cheaper) solution.
QuietDrift with BLE proxy
I’ve created a custom component that implements QuietDrift. It is my first custom component for HA and it has few unfriendly parts, but it should do its job:
// cc @quenthal it will hopefully cover your needs
Wow! Works like a charm! You are awesome! Thanks so much!
Great work - I’ll have my maintenance schedule tomorrow and replace my current solution with your custom component!
Just updated, works great. Thank You!
Hi v6ak,
thank you very much for your effort! Unfortunately I can’t get your solution to work. I installed your custom component via hacs. But when I t try to install your component as an integration I receive the following error: “Config flow could not be loaded: {“message”:“Invalid handler specified”}”. Do you have any idea what I am doing wrong?
That’s a known issue. While the addon advertises that it can be configured (well, enabled, since there is no actual configuration) by GUI, it isn’t implemented. You currently have to enable it in Home Assistant’s config file by adding a single line (as mentioned in README).
Implementing the GUI shouldn’t be hard, but I have no experience with that it isn’t my top priority. If anyone else wants to do that, PR is welcome.
Ah I get it. Tried that first but it didn’t work in the first place. But tried again and now it works perfectly fine. Thanks again!