I'm working in a plugin that would (in my intention) handle a presence based on on BLE beacon devices or, if needed, keep trak of all BLE devices availabe in the network (TVs, remote, apple devices and a really lot of stuff I've seen, is using BLE for beaconing!!!)
In my intention here's the deal
WHAT THE PLUG-IN WILL DO
- Discover the network and grab al MACs
- Create a switch devices for each new Mac available (*)(**)
- Set a state change for each device based on its discoverability (discovered=on, not discovered=off, but check its state fefore)
(**) due to limitation of the framework and mostly in my python knowledge the name of each device MUST end with the MAC address, otherwise the device will be recreated
WHAT THE PLUG-IN WILL DO in next release
- Get Battery level (if provided)
- Put the battery data in the BatteryLevel of each device
WHERE I'M STUCK
I'm using Python3 and gattlib to grab BLE data
but the library seems to be unabailable under domoticz....

Code: Select all
2017-03-06 16:53:09.107 Error: (BLE Beacon) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/BLE-BEACON/:/usr/lib/python3.4/:/usr/lib/python3.4/plat-arm-linux-gnueabihf:/usr/lib/python3.4/lib-dynload'.
2017-03-06 16:53:09.107 Error: (net_Ble) Module Import failed, exception: 'ImportError'
2017-03-06 16:53:09.107 Error: (net_Ble) Module Import failed: ' Name: gattlib'
How could I include this library?!
if I run another script from ssh (sudo python3 ble_discovery.py) that include the same library it runs correctly...
PLEASE NOTE:
the attached PlugIn is NOT finalized and should be NOT used into a production environment
Since I cannot test its functionality I have NO IDEA of the inpact on domoticz yet


