Settins for fastest UP/DOWN detection.

Posted on
Sat Oct 15, 2016 5:40 pm
chrisfromthelc offline
Posts: 38
Joined: Oct 08, 2014

Settins for fastest UP/DOWN detection.

I'm trying to figure out how I can set up piBeacon for the fastest UP/DOWN detection, using iPhone that have the GemTot app.

I'd like to do some automation with light switching on arrival/departure, but the status change detection seems too long on both UP and DOWN.

Any suggestions?

Otherwise, the plugin and kw123's entire suggested setup works great. Everything worked perfect on the first try.

Posted on
Sat Oct 15, 2016 9:03 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Settins for fastest UP/DOWN detection.

are you talking about BLE connected devices (blue tooth for phone detection)?

They work like this:

1. The RPI sends a connect request to the phone.
2. if not answered, try again after xx seconds(settings in the BLE device)

It is not like the iBeacons that send beacons every 0.1 -- 10 seconds (depending on type and settings) on their own.

the options you can set are:
try to reach iPhone when DOWN again after (once down when to try again)
try to reach iPhone when UP again after (once up, when to try again)
time out BLE query after (wait how long for the iPhone to answer)

The optimal situation is likely 1-2 seconds reaction time BUT this will drain the phone battery significantly.
Lets assume you leave and you set when down retry every second. the expected reaction time >>> !! IF the iPhone BLE is active!! <<< should be 1-2 secs
if the phone is home and you like to know when it leaves (set to 1 second) the iPhone has to answer a query every second continuously. Thats a lot of energy.

I tried to get the iPhone itself to be a good and fast presence indicator, but have not been successful.
The best solution is still a very simple (xy) beacon. Battery lasts several months reaction time for UP is < 0.5 secs, for down depending on your settings. I use 90 secs.


Karl

Posted on
Sat Oct 15, 2016 9:27 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Settins for fastest UP/DOWN detection.

ps :
version 6+1 has a lot more things, less cpu (50%) and eg:
https://www.dropbox.com/s/yvqhj8m9iwlyjyw/IMG_0014.m4v?dl=1
ultra sound distance sensor with an OLED display on the RPI that measures eg cm (or feet ,...) of a body, hand away from the sensor
(hardware cost ~ $10-display+$5-ultrasound sensor)

Posted on
Sun Oct 16, 2016 12:22 am
chrisfromthelc offline
Posts: 38
Joined: Oct 08, 2014

Re: Settins for fastest UP/DOWN detection.

kw123 wrote:
The best solution is still a very simple (xy) beacon. Battery lasts several months reaction time for UP is < 0.5 secs, for down depending on your settings. I use 90 secs.


Yeah, after tinkering with it more, I noticed that it zapped the battery quick. I'll probably grab a few of the XY2 beacons to use instead.

kw123 wrote:
ps :
version 6+1 has a lot more things, less cpu (50%) and eg:
https://www.dropbox.com/s/yvqhj8m9iwlyjyw/IMG_0014.m4v?dl=1
ultra sound distance sensor with an OLED display on the RPI that measures eg cm (or feet ,...) of a body, hand away from the sensor
(hardware cost ~ $10-display+$5-ultrasound sensor)


Not sure what this means in regard to the beacon stuff?

Posted on
Sun Oct 16, 2016 2:31 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Settins for fastest UP/DOWN detection.

Just a teaser for the next version under i6+1


Sent from my iPhone using Tapatalk

Posted on
Mon Oct 17, 2016 6:02 am
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: Settins for fastest UP/DOWN detection.

Quick semi related question; Is there any way to have a trigger fire whenever ANY beacon changes without setting up a separate trigger per beacon? I haven't had a problem with the speed of detection on entry, and I actually want a delay on system arm when the last beacon leaves because it normally takes 30 seconds to a minute after we start the car to reach the driveway sensor down the road. But I have half a dozen XYs that I keep in a drawer and loan to guests when they come in to stay for the weekend (since the Ags have started moving up in the polls, I'm often putting up old college roommates and/or family members for home game weekends). Since the XYs stay active all the time, what I have done to ease the chore of keeping the security system up to date was create a "Valid piBeacon" folder And I have a script that counts the number and concatenates the names of "NOT expired" beacons in that folder into variables. Count > 0 system disarms, Count = 0, system arms. The script gets called whenever a beacon changes state... which means that I currently have 24 separate triggers, all doing exactly the same thing; calling the "Check Beacons" action which runs the script. It sure would be nice to have only one for each rPi... or even better one for the plugin.

Posted on
Mon Oct 17, 2016 7:05 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Settins for fastest UP/DOWN detection.

Good suggestion .
Yes. Version6+1


Sent from my iPhone using Tapatalk

Posted on
Mon Oct 17, 2016 7:52 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Settins for fastest UP/DOWN detection.

How about an option to create groups of beacons that have a common trigger
E.g. Family, visitors , ignore. And do a common trigger
All away. All home, one away. One home ?


Sent from my iPhone using Tapatalk

Posted on
Mon Oct 17, 2016 8:19 am
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: Settins for fastest UP/DOWN detection.

Depending on how easy or difficult it would be to define and update the group lists, that would be ideal, especially if a single beacon could appear in multiple groups (which the folder option doesn't allow). But as far as the various conditions, there is no good way to think of all the conditions the users might want, so a simple "group has any change" trigger would put that into the trigger action, where the user could be as specific as they like: "If any kids are home and parents are not, power down the cable box..."

Posted on
Mon Oct 17, 2016 10:20 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Settins for fastest UP/DOWN detection.

have added:

Family; Guests; Other1, Other2 groups (I guess 4 groups of iBeacons should be enough); you could could put all active recognized beans in to eg group other2 , then you have an overview of all active beacons

Each beacon is added in its device edit to one, 2.. or all of the groups, or no member of any group (default)

Then the following events for triggers are available:

Code: Select all
    <Event id="Family-allAway">   <Name>Family-allAway  .. ALL devices                in the group must be AWAY to trigger</Name> </Event>
    <Event id="Family-oneAway">   <Name>Family-oneAway  .. ONE device  of the devices in the group must be AWAY to trigger</Name> </Event>
    <Event id="Family-oneHome">   <Name>Family-oneHome  .. ONE device  of the devices in the group must be HOME to trigger</Name> </Event>
    <Event id="Family-allHome">   <Name>Family-allHome  .. ALL devices                in the group must be HOME to trigger</Name> </Event>

    <Event id="Guests-allAway">   <Name>Guests-allAway  .. ALL devices  ....</Name> </Event>
    <Event id="Guests-oneAway">   <Name>Guests-oneAway</Name> </Event>
    <Event id="Guests-oneHome">   <Name>Guests-oneHome</Name> </Event>
    <Event id="Guests-allHome">   <Name>Guests-allHome</Name> </Event>

    <Event id="Other1-allAway">   <Name>Other1-allAway</Name> </Event>
    <Event id="Other1-oneAway">   <Name>Other1-oneAway</Name> </Event>
    <Event id="Other1-oneHome">   <Name>Other1-oneHome</Name> </Event>
    <Event id="Other1-allHome">   <Name>Other1-allHome</Name> </Event>

    <Event id="Other2-allAway">   <Name>Other2-allAway</Name> </Event>
    <Event id="Other2-oneAway">   <Name>Other2-oneAway</Name> </Event>
    <Event id="Other2-oneHome">   <Name>Other2-oneHome</Name> </Event>
    <Event id="Other2-allHome">   <Name>Other2-allHome</Name> </Event>

home is if a beacon is in status=up, away otherwise (=down or expired)

It also populates variable "Count-Family-Away" with the number of Beacons in group Family AWAY (same for HOME and the other groups )
You then have a count of beacons home/away for each group

Doing some testing,.. as soon as i(6+1) is available, it will be there


Karl

Posted on
Tue Oct 18, 2016 6:09 am
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: Settins for fastest UP/DOWN detection.

A "has any change" event for each group would also be useful. I keep a running list of who's home on one of my control pages, which wouldn't get get triggered for update if two people in a 4 person group are home and either one of them leaves or another arrives..

Posted on
Tue Oct 18, 2016 7:00 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Settins for fastest UP/DOWN detection.

Any change = variable xx-home has changed
It will update the number within one second of a beacon arriving it is unlikely that in that same second another beacon goes off.


Sent from my iPhone using Tapatalk

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 6 guests