home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
70k stars 29.07k forks source link

IKEA Idesen Desk integration disconnects when using builtin Bluetooth #103776

Open backslashV opened 8 months ago

backslashV commented 8 months ago

The problem

Despite pairing the desk manually using bluetoothctl, after some time, this happens Screenshot_20231110-155833 Prior to the Home Assistant November update, I was able to reload the integration to temporarily reconnect the desk. The reload option doesn't even appear anymore.

What version of Home Assistant Core has the issue?

core-2023.11.2

What was the last working version of Home Assistant Core?

core-2023.10.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

idasen_desk

Link to integration documentation on our website

https://www.home-assistant.io/integrations/idasen_desk

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant
Source: components/idasen_desk/__init__.py:59
First occurred: 11:48:49 AM (1 occurrences)
Last logged: 11:48:49 AM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/idasen_ha/connection_manager.py", line 79, in _connect
    await self._idasen_desk.pair()
          ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'pair'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/idasen_desk/__init__.py", line 59, in async_connect
    await self.desk.connect(ble_device)
  File "/usr/local/lib/python3.11/site-packages/idasen_ha/__init__.py", line 62, in connect
    await self._connection_manager.connect(
  File "/usr/local/lib/python3.11/site-packages/idasen_ha/connection_manager.py", line 57, in connect
    await self._connect(auto_reconnect=auto_reconnect)
  File "/usr/local/lib/python3.11/site-packages/idasen_ha/connection_manager.py", line 87, in _connect
    await self._idasen_desk.disconnect()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'disconnect'

Additional information

No response

home-assistant[bot] commented 8 months ago

Hey there @abmantis, mind taking a look at this issue as it has been labeled with an integration (idasen_desk) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `idasen_desk` 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 idasen_desk` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


idasen_desk documentation idasen_desk source (message by IssueLinks)

backslashV commented 7 months ago

Are any fixes planned for this?

backslashV commented 7 months ago

Anyone?

abmantis commented 7 months ago

Anyone?

Posting here like that will not make anyone work on this any faster. Quite the opposite if you think about it. This is voluntary work by people that do not get paid to do it. Also, anyone can contribute and fix it.

backslashV commented 7 months ago

Anyone?

Posting here like that will not make anyone work on this any faster. Quite the opposite if you think about it. This is voluntary work by people that do not get paid to do it. Also, anyone can contribute and fix it.

Thanks. I was not expecting any faster work on the fix. I was simply waiting for some sort of acknowledgement since it seems other people aren't having this issue after pairing manually using bluetoothctl.

abmantis commented 7 months ago

At the moment, the best option is to use an esphome Bluetooth proxy. Using the bluez (the default Linux Bluetooth stack) is not working properly, unfortunately.

backslashV commented 7 months ago

At the moment, the best option is to use an esphome Bluetooth proxy. Using the bluez (the default Linux Bluetooth stack) is not working properly, unfortunately.

I do have an ESPHome device with Bluetooth proxy enabled in its YAML in the same room. I am not sure how to pair the desk with that specifically. I think I read somewhere that HA does that automatically once it sees Bluetooth proxies.

abmantis commented 7 months ago

I disabled the internal Bluetooth integration on mine, so that it uses esphome only.

abmantis commented 7 months ago

@home-assistant rename IKEA Idesen Desk integration disconnects when using builtin Bluetooth

micgogo commented 4 months ago

i see the same issue when use esphome bluetooth proxy

backslashV commented 3 months ago

i see the same issue when use esphome bluetooth proxy

Yup. The issue is still here with HA v2024.3.3 and ESPHome BT proxy.

Yiivgeny commented 3 months ago

+1 with ESPHome BT proxy

abmantis commented 2 months ago

https://github.com/home-assistant rename IKEA Idesen Desk integration disconnects and does not reconnect

abmantis commented 2 months ago

https://github.com/home-assistant/core/pull/115939 should hopefully fix this. The next HA beta should contain it.

VoloshinD commented 3 weeks ago

Who can share the YAML configuration for ESP Home? I don't understand what needs to be written there.

Yiivgeny commented 3 weeks ago

@VoloshinD, only basic configuration for btproxy https://esphome.io/components/bluetooth_proxy.html without any custom parameters for desk

VoloshinD commented 3 weeks ago

@VoloshinD, only basic configuration for btproxy https://esphome.io/components/bluetooth_proxy.html without any custom parameters for desk

I installed the firmware on a website with a bluetooth proxy, and added ESP via ip to HA. I turned off Bluetooth on the computer so that integration would not connect through it. It doesn’t connect, I pressed the pairing button, it works well with the phone, but it doesn’t work with HA. Sad story… IMG_8618

abmantis commented 3 weeks ago

@VoloshinD Make sure that the desk is not connected to anything else. It cannot be connected to the mobile app while pairing to HA. Also, make sure that it is in pairing mode (blue light blinking).

If that does not work, please ask for help on the forums or open another Issue here with debug logs. Thanks!