-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
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
Switchbot Integration Aborted #58547
Comments
Hey there @Danielhiversen, @RenierM26, mind taking a look at this issue as it has been labeled with an integration ( switchbot documentation |
Also having this issue as abrahamfa as of 2021-10-28 09:22 UTC. Two Switchbots and two curtain bots affected. They are still showing up as "home" via their BLE MACs so it doesn't seem to be a signal issue. When I set up the curtain bots yesterday, I was getting OP's issue but after several (and I mean several) attempts at configuring the integration, it finally showed me the expected form for MAC entry. |
I am having the same issue as OP ... Failed to connect (Aborted) I do not have any HACS or custom repository added or manual configuration.yaml but it still does not work |
Hi All, The btle scanner might require special permissions if used in custom OS versions. (non supervised install) What OS are you guys running? Thanks. |
I am running HA OS with an Asus BT USB dongle plugged in. I can add the HACS integration from the alextud git and manually configure MACs in configuration.yaml to get them working but if I add your fork and do the same thing, the devices all become unavailable. Or if I try to install the integration through the configuration/integrations gui, I get the failed to connected or aborted error - so the integration will not add/install. |
Hi @DanDon, Could you please try the following commands?
Output should be something like this:
|
Running core-2021.10.6 (was on 10.4 when this issue started). Using Pi 4 B's onboard Bluetooth. As previously mentioned, HA can see the devices as device trackers. |
Your problem might be caused by the device tracker. I'm also using a PI4b with supervised install (hass os) in my production and test environment. (Without any issues) The scanner sets bluez in a BTLE mode (le on) and other bluetooth integrations could cause conflicts with the process. What bluetooth tracker integration are you using? |
Hi @DanDon , You'll need to disable protected mode for the terminal first. I use "SSH & Web Terminal" from the Home Assistant Community Add-ons on the https://addons.community repository. |
Hi @RenierM26 , I am already using the SSH & Web terminal add-on ... that is what the screen grab is from. How do I disable protected mode? |
Looks like you have two BT dongles? Or the asus dongle presents two interfaces. Any chance you could try the following python code?
Then the following code:
0 = hci0 Please try with 1 as well. |
Yes I believe the dongle presents to interfaces ... it is only a single BT USB dongle. Would you like me to try this with the HACS intergration from Alextud removed and the manual config in configuration.yaml removed too ... or does it not matter? |
Alextud's integration uses an old version of pyswitchbot. You'll need to remove it and try the built in one. If this works, then I'll need to add options to the integration for selecting a different interface. Shouldn't be too much effort to implement. |
Try this from bash;
|
That fixed the problem of running the python discover() .... It does only work on interface 1 not on interface 0 I presume this means I cannot add this intergration then till the option to select interface is added :( Thanks for you help with this so far 👍 |
Thank you for testing! You've given me the info I need to code a fix. In the mean time you could do the following:
The integration domain is named "ha-switchbot-curtain". I initially stated the rewrite as a pull request on Alextuds's repository.
Change this: to: |
You'll need to remove the integration in totality. Bluetooth scanning processes between libraries causes conflicts. The dongle can only handle 1 operation at a time and gets locked up if multiple libraries attempts a bluetooth discover. |
Thanks for this try but it doesn't work... I am using the white Switchbot Curtain to add to intergrations: |
@DanDon , Sorry, missed one more change: in config_flow.py: Change:
to
|
|
Sorry @RenierM26 Although .... It seems that I'm getting errors now when trying to open / close etc .... cannot communicate Is there somewhere in the config that requires the signals to be sent out via a specific interface?? |
Hi @DanDon , Under cover.py and switch.py:
to:
Should do it. |
The link you sent helped, now I fixed it for my docker container. I only needed to add in my docker compose file (tested and worked):
I think the command equivalent is |
It's not working for me. Bluetooth working ok inside Docker container. |
Did you try adding cap for your docker container like I mentioned in this comment? |
RPI 4, HA in docker. |
Hi @lonsdaleite, Your problem should be fixed in the next release (2021.12). You could try copying the latest integration from the DEV branch if you run a non supervised install? (For advanced users though - I would recommend waiting for the next stable release.) |
Hi @RenierM26, I've tried to install the DEV version of Switchbot integration but it doesn't work because of requirements conflict: 2021.9.7 requires pySwitchbot 0.8.0 and DEV requires pySwitchbot 0.13.0. |
Going to gently toss my name into the hat here as well... I am entirely down to test the dev changes before a stable release. I am gonna snag the latest dev code and pull the switchbot component and see if it works for me 👍 |
Hi, Same here with HA docker 2021.12.9, with this error :
Any clue on a fix release date ? |
Adding the restart: always
network_mode: host
cap_add:
- net_admin I then
Looking inside the container, a manual discovery succeeds more often than not: $ docker exec -it homeassistant /bin/bash
bash-5.1# python
Python 3.9.7 (default, Sep 9 2021, 13:39:57)
[GCC 10.3.1 20210424] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import switchbot
>>> switchbot.GetSwitchbotDevices(interface=0).discover()
{'XXXXXXXXXXXX': {'mac_address': 'XX:XX:XX:XX:XX:XX', 'isEncrypted': False, 'model': 'T', 'data': {'temp': {'c': 21.6, 'f': 70.88}, 'fahrenheit': False, 'humidity': 33, 'battery': 100, 'rssi': -82}, 'modelName': 'WoSensorTH'}}
>>> I checked the list of devices, I cannot find my SwitchBot sensor. |
In case of multiple bluetooth adaptors and you aren't using other adapter, you can follow this article: |
Thanks for the link, but it is not a case of multiple bluetooth adaptors. |
I gave |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
This still is an issue for me and my Raspberry Pi 4 and Home Assistant OS 7.6. #notstale |
still a problem on Raspberry Pi 4
|
I also have a problem with SwitchBot integration If anyone has a tip what else should I test for successful integration I will be happy. Server: xxx@nuc:~$ docker exec -it home-assistant /bin/bash
bash-5.1# hciconfig
hci0: Type: Primary Bus: USB
BD Address: 1C:4D:70:B7:B3:4D ACL MTU: 1021:4 SCO MTU: 96:6
UP RUNNING PSCAN ISCAN
RX bytes:14032014 acl:0 sco:0 events:179672 errors:0
TX bytes:173643 acl:0 sco:0 commands:11752 errors:0
bash-5.1# python
Python 3.9.9 (main, Feb 8 2022, 09:16:53)
[GCC 10.3.1 20210424] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import switchbot
>>> switchbot.GetSwitchbotDevices(interface=0).discover()
{'fda853264875': {'mac_address': 'fd:a8:53:26:48:75', 'isEncrypted': False, 'model': 'T', 'data': {'temp': {'c': 29.6, 'f': 85.28}, 'fahrenheit': False, 'humidity': 26, 'battery': 100, 'rssi': -45}, 'modelName': 'WoSensorTH'}} However, when I try to add integration, the following messages appear: Unexpected error. Or No unconfigured devices found. There is part of my docker-compose file: homeassistant:
container_name: "home-assistant"
image: "homeassistant/home-assistant:latest"
cap_add:
- net_admin # test for switchbot...
depends_on:
- mariadb
- influxdb
environment:
PUID: 1000
PGID: 1000
TZ: "Europe/Prague"
network_mode: host
privileged: true
restart: unless-stopped
volumes:
... |
Still an issue, running on container on rpi4 and also in os also in rpi4 |
I have Raspberry Pi 3 and I ran into the same error "Failed to connect" when trying to add the integration to Home Assistant. I dont see any error in the logs. I would like to connect the new temperature/humidity sensor. Cant find any solution. |
I can use the integration, it detects the courtins but noithing happends if I try to "move" them. HA OS in RPI4, lastest version |
The underlying library has changed for switchbot to use Thanks 👍 |
D-Bus and BlueZ are required on LinuxFor Bluetooth to function on Linux systems, the D-Bus socket must be accessible to Home Assistant. The Bluetooth adapter must be accessible to D-Bus and running BlueZ >= 5.43.
|
still having same issur in: Home Assistant 2022.7.6 |
Please try 2022.8.0 when it comes out. There have been quite a few fixes. |
Ok,i Will try and i uodate the thread ;) thank you |
If you still have an issue with 2022.8.0, please open a new issue. This one is cluttered with unrelated information and multiple problems which makes it impossible to solve. Thanks 👍 |
The problem
When I try to install the Switchbot integration I receive a message saying that "No unconfigured devices found. I had this integration installed before but it became unavailable and now I cannot install it again.
Switchbot Integration Aborted.pdf
.
What version of Home Assistant Core has the issue?
core-2021.10.6
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Core
Integration causing the issue
Switchbot
Link to integration documentation on our website
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: