piBeacon: 3- presence monitoring download

Posted on
Sat Jun 20, 2020 9:55 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

piBeacon: 3- presence monitoring download

posted v7.121.406

Code: Select all
Added features / changes in v7.121.406 @ 2020-06-20
===================================================
1. added compression of data when #bytes > xxbytes (set in config)
2. there was a limnit in # of bytes to be received from RPIs at ~ 30k, was lifted to 120kbytes
running beacon scan with very low cutoff RSSI could produced much more data
3. added beacon report for new and existing beacons
 start from menu and send request to ONE rpi, set RSSI cutoff  to accpet all/many/some/ony very close beacons:
BLEAnalysis received for beacons with signal (rssi) > -70; from RPI#:11
================================ existing_Beacons ============================================
===MAC# DC:0D:30:92:E3:1F  -b-feasy-aaa == ; raw data:
n_of_MSG_Types              : 4
raw data:
- 043E26020100001FE392300DDC1A0201060303AAFE1116AAFE20000C6F80000005E43F000414A4
- 043E26020104001FE392300DDC1A0E16F0FF1B020902DC0D3092E31F640A094653435F42503130
- 043E2A020100001FE392300DDC1E0201061AFF4C000215FDA50693A4E24FB1AFCFC6EB07647825275165C1
- 043E27020100001FE392300DDC1B0201060303AAFE1316AAFE10D403676F6F2E676C2F50484E5364
mfg_info                    : FSC_BP104
MSG_in_10Secs               : 4.0
beaconType                  : [u'Feasy_AAA', u'MiniBeacon']
max_rssi                    : -53
max_TX                      : 109
pos_of_reverse_MAC_in_UUID  : []
pos_of_MAC_in_UUID          : []
possible knownTag options:
-- use:Feasy_AAA
-- use:MiniBeacon

================================ new_Beacons ============================================
===MAC# FF:FF:C2:28:06:C3   == ; raw data:
n_of_MSG_Types              : 2
raw data:
- 043E1702010000C30628C2FFFF0B0201060302E0FF030954
- 043E1A02010400C30628C2FFFF0E0DFFFFFFC22806C315FB757117
mfg_info                    : TF
MSG_in_10Secs               : 5.3
beaconType                  : [u'', u'']
max_rssi                    : -60
max_TX                      : 70
pos_of_reverse_MAC_in_UUID  : [-1, -1]
pos_of_MAC_in_UUID          : [-1, 18]
possible knownTag options:
-- "name_here":{"battCmd":"off","beepCmd":"off","dBm":"-61","prio":1,"pos":12,"posDelta":0,"tag":"0B0201060302"}
-- "name_here":{"battCmd":"off","beepCmd":"off","dBm":"-61","prio":1,"pos":12,"posDelta":0,"tag":"0E0DFFMAC#########"}

4. added debug option on RPI do
   cd pibeacon
   sudo python beaconloop.py
   echo "A4:DA:32:24:5F:6B" > temp/beaconloop.trackmac
will create output like for 10 beacon message, it will give you frequence, some raw info and if accepted or rejected
START  A4:DA:32:24:5F:6B 30:20.899144  logCount: 10  hex: 6B5F2432DAA41E0201061AFF4C00021553706F747950616C5465727261636F6D1ADDD624CACA
0-     A4:DA:32:24:5F:6B ; UUID: 53706f747950616c5465727261636f6d ; Maj: 6877 ; Min: 54820
1-     A4:DA:32:24:5F:6B ; tag: SpotyPal ; prio: 1 ; uuidMajMin: [u'SpotyPal', u'6877', u'54820'] ; useOnlyPrioMsg: True
tag-   A4:DA:32:24:5F:6B ; posFound: 32 ; dPos: 0 ; tag: SpotyPal ;  53706F747950616C5465727261636F ; tagString 53706F747950616C5465727261636F
5-     A4:DA:32:24:5F:6B ; rejectThisMessage: False ; UUID: SpotyPal 6877 54820
9-     A4:DA:32:24:5F:6B ; tagFound True ; UUID: SpotyPal
11-    A4:DA:32:24:5F:6B ; added to beaconMSG
99     A4:DA:32:24:5F:6B ; accepted
START  A4:DA:32:24:5F:6B 30:24.911548  logCount: 9  hex: 6B5F2432DAA41E0201061AFF4C00021553706F747950616C5465727261636F6D1ADDD624CACB
0-     A4:DA:32:24:5F:6B ; UUID: 53706f747950616c5465727261636f6d ; Maj: 6877 ; Min: 54820
1-     A4:DA:32:24:5F:6B ; tag: SpotyPal ; prio: 1 ; uuidMajMin: [u'SpotyPal', u'6877', u'54820'] ; useOnlyPrioMsg: True
tag-   A4:DA:32:24:5F:6B ; posFound: 32 ; dPos: 0 ; tag: SpotyPal ;  53706F747950616C5465727261636F ; tagString 53706F747950616C5465727261636F
5-     A4:DA:32:24:5F:6B ; rejectThisMessage: False ; UUID: SpotyPal 6877 54820
9-     A4:DA:32:24:5F:6B ; tagFound True ; UUID: SpotyPal
11-    A4:DA:32:24:5F:6B ; added to beaconMSG
99     A4:DA:32:24:5F:6B ; accepted

Posted on
Tue Jul 07, 2020 5:08 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

v7.122.417, maintenance release

Code: Select all
1. cosmetic changes for new beacon reports
2. increased data collection time for new beacon report from 15secs to 25 secs.
3. fixed action reboot rpi# through ssh
4. improved speed of car devices status changes
5. improved new beacon report
6. fixed update to states in devcies edit does not work anymore, changed to batch update
  ie group members was impacted, need to edit and save all devices / beacons if problem

Posted on
Thu Jul 23, 2020 8:25 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

Code: Select all
Added features / changes in v7.123.422 @ 2020-07-23
===================================================
1. re-wrote get battery level, beep functions, BLE analysis, get new beacon info.
   also added a beaconloop restart after any of the above functions to avoid a hanging BLE stack
2. fixed battery level calculation for Aiko beacons (it uses a range value:64 = 0% .. value:100 =100 %)
3. added more tagging features for beacons
4. RINEX and NJOII are now the same type of beacon
   if you have a RINEX or NJOII you need to edit and set beacon type
5. some samller menue changes
6. some smaller program changes

Posted on
Thu Aug 06, 2020 3:20 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

Code: Select all
Added features / changes in v7.124.423 @ 2020-08-06
===================================================
1. added sensor bosch BMP388 high precision pressure
   accuracy equivalent = 0.8m altitude change


Karl

Posted on
Sun Aug 23, 2020 7:35 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

Code: Select all
Added features / changes in v7.124.424 @ 2020-08-23
===================================================
1. several small fixes, typos, menus ..
2. fixed some properties of ruuvi tag sensor and settings
3. added option in ibeacon device edit to not run get beattery level for individual beacon at 4 am, as eg
   nutale beacons beep for 5 secs when attached to the RPI or any other host  (they beep when connection to a host is lost)


Karl

Posted on
Mon Aug 31, 2020 8:29 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

Code: Select all
Added features / changes in v7.126.436 @ 2020-08-31
===================================================
0. added new method (option) to read beacons using hcidump & lescan instead of python socket calls
1. added several "feasy" type beacons w battery level support in std message
2. added several "Minew" type beacons w battery level support in std message
3. added menu option to reload known beacon tags (for dev)


This new option can read manufacturing special message that are filtered out in the previously used python library calls.
this allows to read several new items
- battery level, and other message supplied measurements
- beacon manufacturing names
- and other info.


The default is the old version. You can switch in config at the bottom of RPI parameter settings:
Screen Shot 2020-08-31 at 09.28.32.png
Screen Shot 2020-08-31 at 09.28.32.png (37.73 KiB) Viewed 6643 times


Karl
ps thanks go to John for testing

Posted on
Tue Sep 22, 2020 5:27 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

Added features / changes in v7.127.453 @ 2020-10-23
===================================================
Code: Select all
0. cleaned up some code
1. rearanged some menu items, clearer structure, using some color for menu items
2. In addition to the Ruuvitag added several blue tooth sensors, very easy to setup, they all can be used as presence as well as sensors
   They have long battery life and > 30 m distance -- with several RPi in the house essetially the whole house is covered
   INGICS:
      iBS01-x: Family of on/off sensors- Button, magent, movement, external switch
      iBS01T:  Temp and humidity
      iBS01RG: x-y-z acceleration/ gravity sensor
      iBS02:   PIR presence ir IR object detection
      iBS03-x: Family of on/off sensors- Button, magent, movement, external switch
      iBS03G:  Movement detection of beacon on/off
      iBS03T:  on board temp sensor
      iBS03TP: on board temp sensor + temp sensor probe, water proved       ==> great temp sensor for a pool <====
      iBS03RG: x-y-z acceleration/ gravity sensor
    Minew
      E8: x-y-z acceleration/ gravity sensor
   iSensor - Kaipule
      various on/off sensors for GAS, CO water, alarm ...
      EN61, ES61, EW70, ET90, IM21, IX30 IX32
   Satech
      STixx sensors, acceleration, temp, humidity, on/off

3. Normally beacon go "up" as soon as a signal is detect. When they are gone / no signal is received:
   the RPi does not send any info to the plugin if no signal. Then the plugin will set them to down after xx secs (normally 90) and after another xx secs to expired
  In "fastDown" mode: after yy secs (>=10) w/o signal the RPi sends a fast down message to the plugin, then the plugin will set the beacon to down,
  If you have more than 2 RPi you can probably go down to 10 secs, better 20 seconds.
  That means if the beacons leaves the house you will know in ~ 10+3 secs
  If you have just one RPI and have it connected to something that moves around in the house it is likely not a good idea
  but for eg a beacon that is connected to eg a bike that arrives in a dedicated space and has a good connection to the RPi it shouldd work well

4. minUpSigal and minDownSignal:
  When set to eg up=-60 and down=-80: the beacon will only go up when it is close to the RPI  ~ 1 m. but will stay up until it has eg left the room (>10m)
  with this setting you can decide if a beacon is in a room - that requires an RPI in each room you like to have this feature

Karl

Posted on
Tue Sep 29, 2020 1:35 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

Code: Select all
Added features / changes in v7.128.459 @ 2020-10-29
===================================================
0. cleaned up some code
1. rearanged some menu items, clearer structure, using some color for menu items
2. In addition to the Ruuvitag added several blue tooth sensors, very easy to setup, they all can be used as presence as well as sensors
   They have long battery life and > 30 m distance -- with several RPi in the house essetially the whole house is covered
    INGICS:
        iBS01-x: Family of on/off sensors- Button, magent, movement, external switch
        iBS01T:  Temp and humidity
        iBS01RG: x-y-z acceleration/ gravity sensor
        iBS02:   PIR presence ir IR object detection
        iBS03-x: Family of on/off sensors- Button, magent, movement, external switch
        iBS03G:  Movement detection of beacon on/off
        iBS03T:  on board temp sensor
        iBS03TP: on board temp sensor + temp sensor probe, water proved
        iBS03RG: x-y-z acceleration/ gravity sensor
        iBS04:  on/off button
    Minew
        E8: x-y-z acceleration/ gravity sensor
    iSensor - Kaipule
        various on/off sensors: GAS, CO water, alarm ,
        on sensor: door button
        remoteKey
        The on/off states are managed according to the cabailities of the sensors
    Satech
        STixx sensors, acceleration, temp, humidity, on/off

3. Normally beacon go "up" as soon as a signal is detect. When they are gone / no signal is received:
   the RPi does not send any info to the plugin if no signal. Then the plugin will set them to down after xx secs (normally 90) and after another xx secs to expired
  In "fastDown" mode: after yy secs (>=10) w/o signal the RPi sends a fast down message to the pluginthen teh plugin will set teh beacon to down,
  If you have more than 2 RPi you can probably go down to 10 secs, better 20 seconds.
  That means if the beacons leaves the house you will know in ~ 10+3 secs
  If you have just one RPI and have it connected to something that moves around in the house it is likely not a good idea
  but for eg a beacon that is connected to eg a bike that arrives in a dedicated space and has a good connection to the RPi it shouldd work well

4. minupSigal and mindownSignal:
  When set to eg up=-60 and down=-80: the beacon will only go up when it is close to the RPI  ~ 1 m. but will stay up until it has eg left the room (>10m)
  with this setting you can decide if a beacon is in a room - that requires an RPI in each room you like to have this feature

5. changed hcidump method
    added option to restart BLE scanner every 5 minutes, just in case RPi can not keep up
    fixed so that 2. ble dongle is not needed
    This method catches all types of messages while the python socket method ignored some of the mesage types
     ie mfg info which is used to id a beacon / sensor
    You can select which method to use for all RPi in config, or overwrite in RPI device edit.


I would like to point out the newly supported BLE door button and key fob devices.
They work on battery and only send messages when button pressed -- claim lifetime of battery is > 3 years.
There is an indicator for low battery which is set when battery is low (have not tested as the batteries are still fresh)
The reaction time is ~ 0.5 secs between button press and indigo device state change

Karl

thanks go to Wouter and John in the Netherlands for patiently debugging

Posted on
Sun Nov 01, 2020 1:55 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

Added features / changes in v7.128.463 @ 2020-11-01
===================================================
0. fixed accept new beacons signal not working

1. added new beacons and sensors:
Radius RAD beacons, April beacons, ...

2. added option in config to change name of group variables from eg "other1" to eg bicycles ..
This option counts the number of group members (beacons, RPI, BLEconnect devices) that are home, away etc .
With these variable you can create a trigger: Allfamily member at home or one family member away or all family members away
These group names can now be anything ( Family, guests, bicycles, guests, RPI, ... ) you add/remove a member in device edit with checks next to the group name.
and you can now have up to 5 groups.
The variables will only be created if
--a) the names are set in config (ie not empty)
-- b) a group has any members (set in device edit)

3. added another folder name for the variables pi_IN_x. these are the variables used for restful communication from RPI to indigo.
The user should not be bothered by them hence the extra folder.
the other variables last changed beacon ... are in the current variable folder

3. with the newly supported flat credit card size beacons (radius, april, Minew C10) you can glue one of these to the back of your iPhone case.
As I am actually never leaving the house w/o my phone, this is very much linked to me being at home.
With this you have a VERY reliable sensor that indicates if you are at home.
I can not recall an instance where the beacons had a false positive or negative.
Gluing the cards to the back actually makes it easier to hold the phone. I roughened the back to the beacon with sandpaper to allow a better grip.
... only drawback: wireless charging does not work w the beacon card on the back. But that might change w iPhone 12 ..

Karl
Attachments
Screen Shot 2020-11-01 at 13.46.46.png
Screen Shot 2020-11-01 at 13.46.46.png (262.79 KiB) Viewed 6480 times

Posted on
Fri Nov 06, 2020 11:06 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

Added features / changes in v7.129.467 @ 2020-11-07
===================================================
0. added Bluetooth Temp / humdity sensor: Xiaomi MiJia round humidity sensor. The round one not sqaure!
check eg: https://medium.com/@smarthomespot/my-xi ... 37b32ab1d0

Added features / changes in v7.129.467 @ 2020-11-05
===================================================
0. added some debug statements when master on pi can not find indigo or ip number
1. fixed fillMemberListState error

Added features / changes in v7.128.465 @ 2020-11-05
===================================================
0. fixed error memberList not defined
1. change secuence of accepting beacons to aloow ignored beacon to be accepted as sensors
eg for ruuviTag beacon: it has a beacon and a sensor device,
when beacon device was deleted in indigo the mac# was set to ignore and the the sensor device was not updated.

Added features / changes in v7.128.464 @ 2020-11-03
===================================================
0. switch bluetooth to no socket if bluez python include fails
1. added support for safedome credit card type beacons, wireless rechargeable
2. changed some menu text, spelling and messages shown

Posted on
Mon Nov 16, 2020 9:35 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

v 7.129.471 posted on GitHub

https://github.com/kw123/pibeacon/releases/tag/v7.129.471
it seems indigo store does not copy from GitHub right now

Code: Select all
0. fixed format for humidity UI values was {:0f} should be {:.0f}
1. added optiuon to add new beacon mac # in menu, (accept new becons
   if you know a beacons mac numebr and you like to add it put the mac number there
   and the system will allow that mac numebr to be added as a beacon
2. updated BLE-Analysis - detect new beacon tool
   the print outin plugin.log is now done is a nice format
   this can be used to identify beacons and understand the message structure
3. for Minew TH + accelerator sensor (s1-Plus) added states amd options
4. Autodetect battery level in BLE data and setup beacon accordingly for TLM and msg battery levels
   set supportBatterylevel = true and set method prop
5. Added nuki door lock and UDM-pro and Flower care /mate

Posted on
Mon Dec 07, 2020 2:12 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

posted v 7.131.479

added option to connect to BLE devices that do not just send broadcasts, but requires a connect, send commands and get values back. That requires a second BLE dongle in the RPI (~$6 at amazon)
It was tested on RPI2 and 3 and 4, should also work on RPI0W
When the RPI connects to the BLE device all other BLE communications will stop. That would stop the regular beacon listening process for several seconds (ie when sensor does not respond it would block BLE for ~ 15 seconds - every minute or so)

The first types of these are:

1. XIAOMI T&H (+ battery level, one cr2030) square w display
2. XIAOMI soil sensor ( T+moisture, conductivity, light, battery level, one cr2030 )- sold as VegTrug .

-the XIAOMI round TH sensor (al ready supported) sends TH,batterylevel .. values as broadcasts.

The attached images show the sensors and the states of the soil sensor.

You will need to get the MAC number of the sensors (use plugin/ menu "detect (new) beacons ...)" and set RSSI to -50, put the sensor next to the rpi then check plugin.log for the info of the "new" beacons. There you should find flower care and or xiaomi as tags.)
you can find these sensors on amazon, eBay, bangod, ... they go between $5 and 20 depending on the source.

You can select to have the standard sensor image in the status column or use Red/Grey/Green dots. Set in device edit at the bottom
eg for moisture set::
Green: x>50 and x< 70
Grey: x> 30 and x < 80
Red: x=x ( or True )
( GREEN/GREY/RED are the only colors supported by indigo right now, nice would be to also have at least Yellow, Blue, ..

That will make it green for 50%<moisture<70%, grey for 30%<Moisture < 80% and red otherwise
The plugin will go through Green/Grey/Red and when one condition is True it will stop and use that color (x=x is True, you could also use simply True (but not true, not accepted by python.. it dos an eval of teh expression with x = the status variable))

Karl

and thanks to Wouter for testing
Attachments
Screen Shot 2020-12-07 at 13.45.39.png
Screen Shot 2020-12-07 at 13.45.39.png (88.88 KiB) Viewed 6403 times
Screen Shot 2020-12-07 at 13.52.40.png
Screen Shot 2020-12-07 at 13.52.40.png (521.13 KiB) Viewed 6403 times

Posted on
Fri Dec 11, 2020 4:08 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

v7.132.480@ 2020-12-11

added:
Xiaomi MiJia Bluetooth Xiaomi MiJia MI clock w temp humidity(LYWSD02) w clock temp/hum display 2xcr2032
shows T, H, Batterylevel. and count (message#) in indigo dev states
This sensor sends out Broadcasts w T, H , Battery and count

Works similar to Ruuvitag, but w display, and no pressure and acceleration info.

You need to use the Xiaomi mi home app to setup the sensor (connect to china server, in dec 2020 that sensor was not supported on servers outside china)

This is a really nice sensor w high contrast display of time , temperature and Humidity

Karl
Attachments
Screen Shot 2020-12-11 at 21.49.10.png
Screen Shot 2020-12-11 at 21.49.10.png (486.33 KiB) Viewed 6353 times

Posted on
Mon Dec 14, 2020 9:56 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

v7.132.481

added BLE sensors:
Govee Temp & humidity sensors, they broadcast T, H, BatteryLevel, they cost between $8 .. $20 at amazon
- H5101 w small display
- H5075 w medium display
- H5177 w large display
- H5174 outside sensor, no display
Screen Shot 2020-12-14 at 21.53.20.png
Screen Shot 2020-12-14 at 21.53.20.png (731.42 KiB) Viewed 6331 times


The plugin now supports MANY BLE sensor types out of the box. With the latest set, there are
T&H with and w/out display
T sensor for pool
T&H&Pressure&Acceleration
ON/off
1.. 4 button remotes
gas, ... sensors
mag switches
light on/off sensors
soil sensor (T, moisture, conductivity, light)
..
in total 25

I guess that is enough types

Karl

Posted on
Wed Dec 23, 2020 10:41 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

Added features / changes in v7.133.482@ 2020-12-23
===================================================
1. added BLE sensors:
blueradio sensor bug, support temp, light and orientation
2. changed number to float in device states for indigo version 7.5


the blueradio sensor bug is a little special it has a good light as well as temp and orientation sensor, and is very well documented, and they offer very good support (mine was in a brick mode, and they send me the proc to fix (essential remove it from the iOS app and iPhone history)

Checkout https://www.blueradios.com/hardware_sensors.htm for detailed info
You need the BlueSens app to configure the sensor
0. press sw1 until it blinks
1. enable temp
2. enable light, set res .. to 64000 16 bit ( default)
3. set motion to "garage"
4.frequency to 1-4 secs
5. exit the app to start broadcasting

Karl
ps info for the sensor is in device edit and on the web page and in the app.


And also from here a Merry Christmas, Happy Chanukah ,.. to everyone

Who is online

Users browsing this forum: No registered users and 8 guests