Skip to content

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

License

Notifications You must be signed in to change notification settings

diving91/Bluetooth-scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published