Feature request: Detect Bluetooth from Phones without pair

Posted on
Sat May 07, 2016 11:23 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Feature request: Detect Bluetooth from Phones without pa

hackencrash, if you wan to test: v 1.18.1 :
[urlhttps://www.dropbox.com/s/7hth6wxh7vpiuul/piBeacon-f-1-18-1.zip?dl=1][/url]

you can request via menu/ action/ python script new BLE-connect or sensor data

1. menu pibeacon/ request new message/ select rPi and BLEconnect or sensors
2. action pbeacon/ request new message/elect rPi and BLEconnect or sensors
3. via script:
Code: Select all
plug = indigo.server.getPlugin("com.karlwachs.piBeacon")
plug.executeAction("newMessage" ,
   props={
   "piServerNumber" :"0" # for pi # 0, .."9" and up to "19" for sensor rPis
   ,"typeId": "BLEconnect"  # or "sensors"
   }
)


"BLEconenct" will only send new data(message) when there is "up" data, not when the iPhone is down. reaction time ~ 1-5 seconds depending on how fast the iPhone answers.
"sensors" will send data for all sensor connected. reaction time ~ 1-2 seconds


time to go to bed
Karl

Posted on
Sun May 08, 2016 4:44 am
Hackencrash offline
User avatar
Posts: 251
Joined: Dec 16, 2015
Location: UK

Re: Feature request: Detect Bluetooth from Phones without pa

OMG :shock: This actually works !!!!!!!!! :lol:

This is brilliant, really brilliant !!!!!

Karl you're the best developer in the universe 8)

Posted on
Mon May 09, 2016 7:33 am
roquej offline
User avatar
Posts: 609
Joined: Jan 04, 2015
Location: South Florida, USA

Re: Feature request: Detect Bluetooth from Phones without pa

Karl,

Although the iPhones are staying up longer, they still go expired while within range of the rPIs. It would be helpful to understand the best parameters for rPi and BLE devices. Hoping my issues are related to configuration.

The iBeacons are rock solid!

Thank in advance.

JP

Posted on
Mon May 09, 2016 7:38 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Feature request: Detect Bluetooth from Phones without pa

I found some positive correlation to number of rpi probing the iPhones. If there are more it happens sooner.
May be there is some logic in the iPhone if too many requests don't answer. But this is not really tested. Also may be it related to low battery.
Good things to test for someone.


Sent from my iPhone using Tapatalk

Posted on
Mon May 09, 2016 8:39 am
Hackencrash offline
User avatar
Posts: 251
Joined: Dec 16, 2015
Location: UK

Re: Feature request: Detect Bluetooth from Phones without pa

In the BLE device settings, I set to try continuously when down and then every 8 minutes when up. This is very reliable. Now, with the script Karl did above, you can kick-off an ad-hock iPhone ping to get your proximity values when you need them.


Sent from my iPhone using Tapatalk

Posted on
Mon May 09, 2016 9:23 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Feature request: Detect Bluetooth from Phones without pa

you can check for down events for example for over night with the indigo utilities
select the device
select state = status
condition not "up"

with indigoplotd use status as state to be plotted and use "min" not "average" as measure then you will see if there was any "down" or "expired"


with the utility you would get this:
Code: Select all
102269      2016-05-08-20:08:30                           down     
102270      2016-05-08-20:08:30                           down     
102271      2016-05-08-20:08:30                           down     
103344      2016-05-09-00:13:43                           down     
103345      2016-05-09-00:17:55                           expired   
103346      2016-05-09-00:40:34                           expired   
103347      2016-05-09-00:40:34                           expired   
103348      2016-05-09-00:40:34                           expired   
103349      2016-05-09-00:40:34                           expired   
103381      2016-05-09-00:50:33                           down     
103382      2016-05-09-00:56:31                           expired   
103383      2016-05-09-01:16:14                           expired   
103384      2016-05-09-01:16:14                           expired   
103385      2016-05-09-01:16:14                           expired   
103386      2016-05-09-01:16:14                           expired   
103421      2016-05-09-01:29:47                           down     
103422      2016-05-09-01:30:46                           down     
103423      2016-05-09-01:30:46                           down     
103424      2016-05-09-01:30:51                           down     
103425      2016-05-09-01:30:51                           down     
103426      2016-05-09-01:30:51                           down     
103427      2016-05-09-01:30:51                           down     
103819      2016-05-09-03:32:46                           down     
103820      2016-05-09-03:38:50                           expired   
103821      2016-05-09-04:08:55                           expired   
103822      2016-05-09-04:08:55                           expired   
103823      2016-05-09-04:08:55                           expired   
103824      2016-05-09-04:08:55                           expired   
103893      2016-05-09-04:30:19                           down     
103894      2016-05-09-04:36:23                           expired   
103895      2016-05-09-04:40:42                           expired   
103896      2016-05-09-04:40:42                           expired   
103897      2016-05-09-04:40:42                           expired   
103898      2016-05-09-04:40:42                           expired   
103910      2016-05-09-04:46:48                           down     
103911      2016-05-09-04:52:52                           expired   
103912      2016-05-09-05:05:06                           expired   
103913      2016-05-09-05:05:06                           expired   
103914      2016-05-09-05:05:06                           expired   
103915      2016-05-09-05:05:06                           expired   
103947      2016-05-09-05:11:23                           down     
103948      2016-05-09-05:17:26                           expired   
103949      2016-05-09-05:46:23                           expired   
103950      2016-05-09-05:46:23                           expired   
103951      2016-05-09-05:46:23                           expired   
103952      2016-05-09-05:46:23                           expired   
103978      2016-05-09-05:52:36                           down     
103979      2016-05-09-05:58:39                           expired   
103980      2016-05-09-06:06:40                           expired   
103981      2016-05-09-06:06:40                           expired   
103982      2016-05-09-06:06:40                           expired   
103983      2016-05-09-06:06:40                           expired   
104340      2016-05-09-07:58:31                           down     
104341      2016-05-09-08:01:17                           down     
104342      2016-05-09-08:01:17                           down     
104343      2016-05-09-08:01:17                           down     
104344      2016-05-09-08:01:17                           down     
104490      2016-05-09-08:33:19                           down     
104491      2016-05-09-08:34:33                           down     
104492      2016-05-09-08:34:33                           down     
104493      2016-05-09-08:34:33                           down     
104494      2016-05-09-08:34:33                           down     

  utilitie


by the way the repetition of the "down" 4 times is due to the fact that indigo updates all states in the sql logger whenever any items changes , so when you update status then date-stamp. that creates 2 changes of ALL states in the sql database, hence the quadruple lines (4 states are being updated)

Who is online

Users browsing this forum: No registered users and 15 guests