Giter Club home page Giter Club logo

home_assistant-ble's People

Contributors

kamaradclimber avatar kirichkov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

home_assistant-ble's Issues

Service Crash with HA 0.64.0

Hello,

I had a recurrent home_assistant-ble service crash right after a device detection.

The error message was this one :

Feb 28 22:39:24 hassbian home_assistant-ble[26959]: /usr/lib/ruby/2.3.0/net/http/response.rb:380:in inflate': incorrect header check (Zlib::DataError)
Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /usr/lib/ruby/2.3.0/net/http/response.rb:380:in block in inflate_adapter' Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /usr/lib/ruby/2.3.0/net/protocol.rb:411:in call_block'
Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /usr/lib/ruby/2.3.0/net/protocol.rb:402:in <<' Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /usr/lib/ruby/2.3.0/net/protocol.rb:108:in read'
Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /usr/lib/ruby/2.3.0/net/http/response.rb:402:in read' Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /usr/lib/ruby/2.3.0/net/http/response.rb:291:in block in read_body_0'
Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /usr/lib/ruby/2.3.0/net/http/response.rb:262:in inflater' Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /usr/lib/ruby/2.3.0/net/http/response.rb:281:in read_body_0'
Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /usr/lib/ruby/2.3.0/net/http/response.rb:202:in read_body' Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /usr/lib/ruby/2.3.0/net/http/response.rb:227:in body'
Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /usr/lib/ruby/2.3.0/net/http/response.rb:164:in reading_body' Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /usr/lib/ruby/2.3.0/net/http.rb:1445:in transport_request'
Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /usr/lib/ruby/2.3.0/net/http.rb:1407:in request' Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /var/lib/gems/2.3.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb:137:in block in update_home_assistant'
Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /usr/lib/ruby/2.3.0/net/http.rb:853:in start' Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /usr/lib/ruby/2.3.0/net/http.rb:584:in start'
Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /var/lib/gems/2.3.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb:132:in update_home_assistant' Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /var/lib/gems/2.3.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb:92:in block in detect_new_devices'
Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /var/lib/gems/2.3.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb:88:in each' Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /var/lib/gems/2.3.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb:88:in detect_new_devices'
Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /var/lib/gems/2.3.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb:66:in block in run' Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /var/lib/gems/2.3.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb:64:in loop'
Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /var/lib/gems/2.3.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb:64:in run' Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /var/lib/gems/2.3.0/gems/home_assistant-ble-1.3.1/bin/home_assistant-ble:22:in <top (required)>'
Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /usr/local/bin/home_assistant-ble:22:in load' Feb 28 22:39:24 hassbian home_assistant-ble[26959]: #011from /usr/local/bin/home_assistant-ble:22:in <main> Feb 28 22:39:24 hassbian systemd[1]: home_assistant-ble.service: Main process exited, code=exited, status=1/FAILURE Feb 28 22:39:24 hassbian systemd[1]: home_assistant-ble.service: Unit entered failed state. Feb 28 22:39:24 hassbian systemd[1]: home_assistant-ble.service: Failed with result 'exit-code'. Feb 28 22:39:27 hassbian systemd[1]: home_assistant-ble.service: Service hold-off time over, scheduling restart.

I think I found the problem (at least it worked for me) :
open the file : /var/lib/gems/2.3.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb

in the section "def update_home_assistant(ha_conf, state)" locate the line :
request = Net::HTTP::Post.new(uri)
request.content_type = 'application/json'

and add in between this line so it should look like :
request = Net::HTTP::Post.new(uri)
request["accept-encoding"] = "identity"
request.content_type = 'application/json'

Reboot or restart the service and everything should work perfectly.

crash when listed device found

while running in terminal, upon discovery of a listed device from the config, home_assistant-ble crashes.
stack trace:
Just discovered D8:84:DF:14:DA:83
/usr/lib/ruby/2.1.0/net/http/response.rb:357:in finish': incorrect header check (Zlib::DataError) from /usr/lib/ruby/2.1.0/net/http/response.rb:357:in finish'
from /usr/lib/ruby/2.1.0/net/http/response.rb:262:in ensure in inflater' from /usr/lib/ruby/2.1.0/net/http/response.rb:262:in inflater'
from /usr/lib/ruby/2.1.0/net/http/response.rb:274:in read_body_0' from /usr/lib/ruby/2.1.0/net/http/response.rb:201:in read_body'
from /usr/lib/ruby/2.1.0/net/http/response.rb:226:in body' from /usr/lib/ruby/2.1.0/net/http/response.rb:163:in reading_body'
from /usr/lib/ruby/2.1.0/net/http.rb:1414:in block in transport_request' from /usr/lib/ruby/2.1.0/net/http.rb:1405:in catch'
from /usr/lib/ruby/2.1.0/net/http.rb:1405:in transport_request' from /usr/lib/ruby/2.1.0/net/http.rb:1378:in request'
from /var/lib/gems/2.1.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.1.0/net/http.rb:853:in start'
from /usr/lib/ruby/2.1.0/net/http.rb:583:in start' from /var/lib/gems/2.1.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb:128:in update_home_assistant'
from /var/lib/gems/2.1.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.1.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb:88:in each'
from /var/lib/gems/2.1.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb:88:in detect_new_devices' from /var/lib/gems/2.1.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb:66:in block in run'
from /var/lib/gems/2.1.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb:64:in loop' from /var/lib/gems/2.1.0/gems/home_assistant-ble-1.3.1/lib/home_assistant/ble.rb:64:in run'
from /var/lib/gems/2.1.0/gems/home_assistant-ble-1.3.1/bin/home_assistant-ble:22:in <top (required)>' from /usr/local/bin/home_assistant-ble:23:in load'
from /usr/local/bin/home_assistant-ble:23:in `

'

Correct out of range detection

At least with my nut tracker, out of range detection does not seem to work as expected.

Device might not be detected as disappeared even when out of range.

HOW TO INSTALL

Hi, I could not figure out how to install all this. I arrive at the line "Run home_assistant-ble [your config file] binary." and I can not figure out where my config file is located. Can you explain it better? thank you.

Multiple installs

Not really an issue but a query.

If I were to run this software on multiple Pi's around my house all reporting to the same HA instance would it still work as intended? I'm using this to detect whether my dog is in the house I have a Pi downstairs and upstairs if I run this on both instances I assume it just updates the HA instance whenever it see's the bt tag on the dog collar. What I'm conerned about is when the dog is away from one of the Pi's it will report the dog as disappeared to the HA instance and may override the fact it has in fact now appeared on the other pi.

Either way thank you very much for this software its very useful and I appreciate it!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.