Skip to content
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

Multiple lamps #10

Closed
bachulator opened this issue May 25, 2017 · 2 comments
Closed

Multiple lamps #10

bachulator opened this issue May 25, 2017 · 2 comments

Comments

@bachulator
Copy link

bachulator commented May 25, 2017

Hi,

First of thanks for the effort, it was rather huge surprise to see this rather exotic product get implemented to home automation.

But I have rather strange issue. I have two bedside lamps and it seem the yeelight_bt server can connect only to one of them in rather random order. I've been able to reproduce same issue in cli as well.
Please find attached logs:

Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 225, in async_update_ha_state
None, self.update)
File "/usr/lib/python3.5/asyncio/futures.py", line 361, in iter
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
raise self._exception
File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/homeassistant/.homeassistant/custom_components/light/yeelight_bt.py", line 164, in update
self._dev.state()
File "/srv/homeassistant/lib/python3.5/site-packages/yeelightbt/lamp.py", line 41, in _wrap
self.connect()
File "/srv/homeassistant/lib/python3.5/site-packages/yeelightbt/lamp.py", line 88, in connect
self._conn.connect()
File "/srv/homeassistant/lib/python3.5/site-packages/yeelightbt/connection.py", line 58, in connect
self._conn.connect(self._mac)
File "/srv/homeassistant/lib/python3.5/site-packages/bluepy/btle.py", line 408, in connect
self._connect(addr, addrType, iface)
File "/srv/homeassistant/lib/python3.5/site-packages/bluepy/btle.py", line 402, in _connect
"Failed to connect to peripheral %s, addr type: %s" % (addr, addrType))
bluepy.btle.BTLEException: Failed to connect to peripheral f8:24:41:e3:XX:XX, addr type: public

@rytilahti
Copy link
Owner

This is a known problem when trying to connect on multiple btle devices concurrently, but I'm unsure on what part of the stack the problem lies (chipset? bluez? bluepy?). Unfortunately there is no easy fix for it at the moment.

@rytilahti
Copy link
Owner

Considering there's nothing this library can do to alleviate the problem, I'm closing this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants