Giter Club home page Giter Club logo

bluetooth-scanner's Introduction

Bluetooth device (BLE or not) scanner for Jeedom home automation Framework

  • Class BTdaemon purpose: Scan Bluetooth devices on the network and notify a controller when registered devices are in range

Can work with Bluetooth LE (BLE) or normal (BT) devices
Controller is any system having an http API to settle devices ON & OFF
Primary controller configured with this script is Jeedom - but it can easily be adapted
Jeedom http API is used to control tag widgets
This script can run either on the same Raspberry PI as Jeedom or on another Raspberry PI allowing to have the BT adapter placed anywhere in the house
This script is intended to run in CLI mode as a background daemon (via pcntl_fork())
$ php BTdaemon.php

  • Configuration:
    Debug mode is selected when an instance of this class is created $ble = new BLE(debug_mode)
    It is advised to start in debug mode to check everything is fine, then turn debug off
    $ php BTdaemon.php start -> Start daemon
    $ php BTdaemon.php stop -> Stop daemon
    $ php BTdaemon.php conf -> Start configuration of your Bluetooth devices and Jeedom API calls

  • Tested with:
    Raspberry PI 2 - Raspbian Jessie
    BLE devices: Nut mini (https://goo.gl/l36Gtz)
    BT devices: Samsung Galaxy S5, LG G3, iPhone 6s
    Does NOT work with iTags (https://goo.gl/ENNL71): Since those devices are switching off when not connected, they can't be used for presence detection
    Bluetooth adapter: https://goo.gl/e52VTZ

  • Link with the controller
    Define a virtual with on & off cmd action IDs to control the widget via Jeedom http API
    Also create a binary info field that will represent the state of the virtual (only this one is to be displayed)

    In the advance configuration (toothed wheel) of the binary info field, use a binary widget with images for the on & off states (example below or any of your choice that you can also find on the jeedom market)

    When started in configuration mode, the script will ask for the list of Bluetooth devices to monitor (via their BT Mac address)
    For each registered devices, the IDs for on & off Jeedom cmd will be asked and stored into a BLE.ini file

  • Optionally a log file is generated to keep track of devices entering or leaving the adapter scan range

  • More information via Jeedom forum (French Forum)
    https://www.jeedom.com/forum/viewtopic.php?f=31&t=25492
    User: diving91

bluetooth-scanner's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.