Has there been any more progress on this? I was looking at a generic way to use the bluetooth of my PI3 to track BLE devices without pairing.
I already have the normal Bluetooth module working and that proved to have the best presence accuracy for iPhones. I have a MiBand 2 which would help with presence a lot.
From reading all the comments I wasn’t sure if this made it back into hass base code. The documentation on hass still shows bluetooth le as “We have received numerous reports that this integration will have a big impact on the performance of the server.”
I have tried adding it now, and I get this stacktrace when my Home Assistant is started:
2017-05-28 22:08:54 INFO (MainThread) [websockets.server] Connection error during opening handshake
Traceback (most recent call last):
File “/home/homeassistant/.homeassistant/deps/websockets/server.py”, line 64, in handler
extra_headers=self.extra_headers)
File “/home/homeassistant/.homeassistant/deps/websockets/server.py”, line 151, in handshake
path, headers = yield from read_request(self.reader)
File “/home/homeassistant/.homeassistant/deps/websockets/http.py”, line 43, in read_request
request_line, headers = yield from read_message(stream)
File “/home/homeassistant/.homeassistant/deps/websockets/http.py”, line 83, in read_message
start_line = yield from read_line(stream)
File “/home/homeassistant/.homeassistant/deps/websockets/http.py”, line 103, in read_line
line = yield from stream.readline()
File “/usr/lib/python3.4/asyncio/streams.py”, line 418, in readline
yield from self._waiter
File “/usr/lib/python3.4/asyncio/futures.py”, line 388, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.4/asyncio/tasks.py”, line 286, in _wakeup
value = future.result()
File “/usr/lib/python3.4/asyncio/futures.py”, line 277, in result
raise self._exception
File “/usr/lib/python3.4/asyncio/selector_events.py”, line 582, in _read_ready
data = self._sock.recv(self.max_size)
ConnectionResetError: [Errno 104] Connection reset by peer
And I also started getting:
2017-05-28 22:35:44 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
This project is actually the exact opposite of being integrated into home assistant code . The idea was to extract presence detection code in a seperate program to isolate performance issies and make it much easier to debug.
Another benefit of this de-coupled from main hass code base solution is that you are not forced to use it on the same computer where hass is installed.
Currently it can’t. It always checks whether an ID that is seen is in the exclusive list you supply in the configuration file. Depending on how hass behaves it might not be that difficult to implement.
The issue will be if hass does not accept new mac address supplied via the REST API, that we’re using to let hass know of which devices are seen.
I think would be even better to use mqtt if possible. That gets even more load off hass.
I was able to get the code to detect devices, but not post back to hass. I wasn’t able to determine what was wrong as it didn’t complain about anything.
I will pause trying this for now, as my purpose was also to get new devices registered, just like a normal tracker would.
I have problem with this. I run it on my intel nuc. I getting this:
BlockquoteJust discovered C3:EC:82:FF:8E:C3
/usr/lib/ruby/2.3.0/net/http/response.rb:380:in inflate': incorrect header check (Zlib::DataError) from /usr/lib/ruby/2.3.0/net/http/response.rb:380:in block in inflate_adapter’
from /usr/lib/ruby/2.3.0/net/protocol.rb:411:in call_block' from /usr/lib/ruby/2.3.0/net/protocol.rb:402:in <<’
from /usr/lib/ruby/2.3.0/net/protocol.rb:108:in read' from /usr/lib/ruby/2.3.0/net/http/response.rb:402:in read’
from /usr/lib/ruby/2.3.0/net/http/response.rb:291:in block in read_body_0' from /usr/lib/ruby/2.3.0/net/http/response.rb:262:in inflater’
from /usr/lib/ruby/2.3.0/net/http/response.rb:281:in read_body_0' from /usr/lib/ruby/2.3.0/net/http/response.rb:202:in read_body’
from /usr/lib/ruby/2.3.0/net/http/response.rb:227:in body' from /usr/lib/ruby/2.3.0/net/http/response.rb:164:in reading_body’
from /usr/lib/ruby/2.3.0/net/http.rb:1445:in transport_request' from /usr/lib/ruby/2.3.0/net/http.rb:1407:in request’
from /var/lib/gems/2.3.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb:129:in block in update_home_assistant' from /usr/lib/ruby/2.3.0/net/http.rb:853:in start’
from /usr/lib/ruby/2.3.0/net/http.rb:584:in start' from /var/lib/gems/2.3.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb:128:in update_home_assistant’
from /var/lib/gems/2.3.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb:91:in block in detect_new_devices' from /var/lib/gems/2.3.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb:88:in each’
from /var/lib/gems/2.3.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb:88:in detect_new_devices' from /var/lib/gems/2.3.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb:66:in block in run’
from /var/lib/gems/2.3.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb:64:in loop' from /var/lib/gems/2.3.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb:64:in run’
from /var/lib/gems/2.3.0/gems/home_assistant-ble-1.3.1/bin/home_assistant-ble:22:in <top (required)>' from /usr/local/bin/home_assistant-ble:22:in load’
from /usr/local/bin/home_assistant-ble:22:in `’
Is it possible that you are running home assistant behind a reverse proxy, e.g. nginx? If so point home_assistant-ble directly at home assistant’s web interface.
Just to give you an update - there was indeed a change in hass’ API. I’ve made the necessary changes on my own fork. I think the original author of the gem has taken a step back from the development.
The source above can be built and installed in the following way: