piBeacon:15- device type CAR

Posted on
Thu Jan 12, 2017 10:28 pm
kw123 offline
User avatar
Posts: 5929
Joined: May 12, 2013
Location: Dallas, TX

piBeacon:15- device type CAR

starting with v 7-37-37 the plugin supports a device type = CAR

1. create a device plugin = pibeacon, type = CAR, eg Volvo or Moms car ...
2. select
(A) a battery type beacon (i.e. with AAA battery), place that beacon in the CAR (fixed)
(B) a USB powered beacon put into USB output in CAR
(C) 0-3 beacons attached to your car keys (eg xy)
Screen Shot 2017-01-15 at 22.43.36.png
Screen Shot 2017-01-15 at 22.43.36.png (98.22 KiB) Viewed 1691 times

The CAR device will have 3 states with the following values:
(a) LOCATION= HOME/ AWAY
(b) ENGINE = ON/OFF/""
(c) MOVING = STOP/LEAVING/LEFT/ARRIVING
Screen Shot 2017-01-15 at 22.36.27.png
Screen Shot 2017-01-15 at 22.36.27.png (53.88 KiB) Viewed 1691 times
Screen Shot 2017-01-15 at 22.34.33.png
Screen Shot 2017-01-15 at 22.34.33.png (52.97 KiB) Viewed 1691 times

Conditions for the states:
LOCATION:
-HOME: if Beacons A or B or all C are UP (at least one of the beacon is how so the car must be home)
-AWAY: if Beacons A and B and one of C are down (none of the beacons is home)

ENGINE:
ON if beacon B is on
OFF if beacon B is off
"" if STATUS =AWAY

Moving:
- STOP if home and Beacon B = off (HOME and car is off = must be home standing)
- LEAVING if HOME and Beacon B = ON ( car is home and battery beacon or key is on and USB key comes on. = home starting engine --> must be leaving)
- LEFT if AWAY (no beacon visible so car must be gone)
- ARRIVING if AWAY and any beacon on (was away, have detected at least one beacon so it must come home)


the state "status can be set to show either one or 2/3 of the states described above.

This can be used to detect your CAR(s) home/ away, coming home, leaving ..

It utilizes "fastDown" option for the beacons: if a beacon does not send a signal for x seconds the RPI will send a "fastDown" message to the plugin. for the status to go down ALL RPI must send the fastDown signal.
This is in contrast to not sending anything to the plugin and the plugin will set the beacon status to Down after seconds expiration time.
This will allow a faster reaction time. The fastDownTime used here is 15 seconds. You can manually adjust it for each beacon in beacon device edit. Increase if you have just one RPI, or you could go down to 10 seconds if you have 10 beacons. But you might get some false positives.


Karl

Posted on
Fri Jan 13, 2017 11:13 am
kw123 offline
User avatar
Posts: 5929
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon:15- device type CAR

One item i need to improve:
sequence of beacon coming on/ off line. They might be just a second apart: eg
battery beacon comes online first then the USB that would result in a state HOEM, then "leaving" not "arriving" the other way around would it work fine..

Need to add short timers and controls to make sure that these things are handled correctly.

In other words not just current state but also last state has to be taken into account.

will take a day or so.

Karl

Posted on
Sun Jan 15, 2017 10:48 pm
kw123 offline
User avatar
Posts: 5929
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon:15- device type CAR

posted v 7-37-40.
improved the flow and timing of the states, added state indicators etc to the layout. And have removed the "beta"


Karl

Posted on
Tue Jan 17, 2017 3:40 pm
kw123 offline
User avatar
Posts: 5929
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon:15- device type CAR

This is how the data looks when leaving and when arriving

Code: Select all
 id  |             ts             | engine |  motion  |      status          | location
-----+----------------------------+--------+----------+----------------------+----------
 134 | 2017-01-16 21:46:35.244983 | off    | stop     | home/off/stop        |
 135 | 2017-01-17 14:03:49.225078 | on     | leaving  | home/on/leaving      |
 136 | 2017-01-17 14:04:35.525524 |        | left     | away//left           | away
 137 | 2017-01-17 15:01:56.764415 | off    | arriving | home/off/arriving    | home
 138 | 2017-01-17 15:01:56.939498 | on     |          | home/on/arriving     |
 139 | 2017-01-17 15:02:39.540619 | off    | stop     | home/off/stop        |

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest