core icon indicating copy to clipboard operation
core copied to clipboard

All Switchbot becomes unavailable daily until I restart HA.

Open fangoward opened this issue 1 year ago • 16 comments
trafficstars

The problem

My Switchbot devices (Bot and Lock) suddenly become unavailable, at random, specially by the end of the thay . They just disconnect and doesn't come back until I restart Home Assistant.

If I go on the Switchbot app all of the devices are working just fine, so that's a problem with the integration, not the app or the Switchbot system.

That's especially annoying because I use the products to unlock my doors. Can you see what's happening?

What version of Home Assistant Core has the issue?

core-2024.4.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Switchbot Bluetooth

Link to integration documentation on our website

No response

Diagnostics information

It just happens. For no reason, whatsoever.

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

fangoward avatar Apr 14 '24 19:04 fangoward

Hey there @danielhiversen, @renierm26, @murtas, @eloston, @dsypniewski, mind taking a look at this issue as it has been labeled with an integration (switchbot) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of switchbot can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign switchbot Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


switchbot documentation switchbot source (message by IssueLinks)

home-assistant[bot] avatar Apr 14 '24 23:04 home-assistant[bot]

Can you see what's happening?

Is there anything in the logs? Any errors you're seeing?

TheJulianJES avatar Apr 14 '24 23:04 TheJulianJES

I don't see any erros. It just goes "Unavailable" without giving me any warning and I can't control them.

Right now it's unavailable. I guess, it's not even related with the hours, it's pure random.

fangoward avatar Apr 15 '24 10:04 fangoward

Update. I just got this error:

This entity is no longer being provided by the switchbot integration. If the entity is no longer in use, delete it in settings.

fangoward avatar Apr 15 '24 18:04 fangoward

It's about a problem with the raspberry Bluetooth and there are like 3 months unsolved. It's so annoying. It's is reported long time and lots times. I don't know what are they doing to solved. I have an automation to notify me if bluetooth lock is 5 minutes "offline" for restart manually HA..

janfajessen avatar Apr 18 '24 11:04 janfajessen

I'm not running a Raspberry, but a NUC. So I guess it has nothing to do with Raspberry specifically.

fangoward avatar Apr 18 '24 11:04 fangoward

Have the same problem with my Switchbot Lock. Running bluetooth from ESPHome. Cant see anything in the Logs. It just goes to disconnected

nikee73 avatar Apr 23 '24 16:04 nikee73

Same problem. I have to reset the bluetooth to the device to become available for a couple of minutes. To reset Bluetooth I execute this command:

hciconfig hci0 reset

esguti avatar Apr 28 '24 14:04 esguti

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. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Still the same problem with Home Assistant 2023.7.3 Frontend 20230705.1 - latest

esguti avatar May 14 '24 13:05 esguti

Still the same problem with Home Assistant 2024.5.3 Frontend 20240501.1 and python 3.12

esguti avatar May 21 '24 19:05 esguti

I think, it is related with https://github.com/Bluetooth-Devices/bleak-retry-connector/issues/91

executing

bluetoothctl -- scan on

looks like temporary solving the problem

esguti avatar May 27 '24 13:05 esguti

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. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

I'm also facing this issue; with Switchbot curtain rods; they seem to all go unavailable, every couple of minutes and come back on line. Annoying as it means i have to keep the automation for sunrise and sunset in the switchbot app instead of HA.

Running on a Raspberry Pi 3B, no bluetooth dongle (maybe its the built in bluetooth on the pi and an adapter might help? 🤷 )

rforster-dev avatar Jun 15 '24 11:06 rforster-dev

@rforster-dev the built-in Raspberry Pi bluetooth adapter might be listed as high performance but it's very susceptible to interference even from the onboard USB, I'd suggest to switch to an external adapter on a good quality shielded USB extension cable (not directly plugged in to USB port) or ESP32 Bluetooth proxy. That's also what I had to do to make things more reliable. https://www.home-assistant.io/integrations/bluetooth/#bluetooth-interference-with-other-devices

dsypniewski avatar Jun 15 '24 16:06 dsypniewski

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. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

It happened again. This integration should be stable by now, this should not happen. It should be maximum priority since we're talking about door locks.

fangoward avatar Jul 02 '24 22:07 fangoward

@fangoward as already stated the most likely cause of this and many similar issues is Bluetooth interference not the integration itself. What Bluetooth adapter are you using? I see that you mentioned you run on NUC and not a raspberry pi but nothing more. Assuming you are using the integrated one, unfortunately I've also heard about similar performance problems with those as well (like the raspberry pi) and would suggest moving to a dongle on USB extension or ESP32 Bluetooth proxy. The page I linked in my previous comment has excellent explanation regarding this, I would suggest reading the whole page (not just the section I linked) since it might be very helpful in understanding and solving the actual problem.

dsypniewski avatar Jul 03 '24 00:07 dsypniewski

I bought a USB bluetooth adapter and it seems to be more stable but does go offline throughout the day. I probably need to adjust the positioning of it and implement a bluetooth proxy like you've suggested to rule things out my side first.

For now, i'm having to use Switchbots integration itself to rely on the curtains open and closing instead of home assistant as its not reliable enough - for me - yet, its a bit of a shame but not end of the world for me in my scenario - thanks!

rforster-dev avatar Jul 04 '24 09:07 rforster-dev

I bought a ESP32 bluetooth proxy and all problema are gone. Now, my Switchbot and Fingerbots work 100%

esguti avatar Jul 08 '24 08:07 esguti

@dsypniewski I have everything associated with the Switchbot Cloud. It has nothing to do with bluetooth, the Lock doesn't even operate with Bluetooh, I guess.

The problem is with the integration. It breaks after HA updates, it's not random. So I'm actually quite shure it's a integration problem, not a "me" problem. I had to roll back the update and it started working again, another reason why I think that it's a problem with HA.

fangoward avatar Jul 08 '24 14:07 fangoward

@esguti glad to hear that you got it working. @fangoward then we need to re-assign the issue to have the right people in the loop since Bluetooth and Cloud are separate integrations. Can someone with such powers assign the switchbot_cloud integration? @TheJulianJES maybe?

dsypniewski avatar Jul 08 '24 15:07 dsypniewski

@home-assistant unassign switchbot

dsypniewski avatar Jul 08 '24 15:07 dsypniewski

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. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.