Page 15 of 17

Re: piBeacon: 3- presence monitoring download

PostPosted: Tue Sep 10, 2019 12:39 pm
by kw123
Code: Select all
Added features / changes in v7.110.306 @ 2019-09-07

1. added option for logfile size on rpi
2. fixed no reboot if no ibeacon signal parameter on RPI, it was not active

3. added INPUTcoincidence device:
    eg using 2 .. 4 geiger counters you can set up a cosmic muon detector, by requiring simultaneous (within coincidence time window) events by all used GPIOs
   The  coincidence time of  INPUTpulses from different gpios trigger is 0.1 msec to several minutes.
    this can be used to for FAST (msecs) detection of 2 events and up to several minutes
in the attached phone you can see 3 geiger counters put on top each other. Bought on eBay and amazon for $30-$50
Screen Shot 2019-09-10 at 13.29.25.png
Screen Shot 2019-09-10 at 13.29.25.png (465.17 KiB) Viewed 930 times

With these devices you can detect background radiation (electrons and gamma rays) and eg cosmic muons passing through all 3 tubes. -- these do NOT detect Alpha particles (they do not get through the glass)
In Dallas the detection rate for muons is ~ 1 per 40 secs as the active area is pretty small. The background event rate for each tube is ~ 3/secs +-

You can buy radioactive pieces (very low intensity) on the web ~ $5. Putting eg a mesh next to these detectors the rate goes up from 3/s to > 50/s
Screen Shot 2019-09-10 at 13.37.53.png
Screen Shot 2019-09-10 at 13.37.53.png (317.79 KiB) Viewed 930 times


Re: piBeacon: 3- presence monitoring download

PostPosted: Tue Sep 10, 2019 4:10 pm
by matt (support)
Neat – a DIY version of this setup?

Re: piBeacon: 3- presence monitoring download

PostPosted: Wed Sep 11, 2019 7:58 am
by kw123
Just a tiny bit simpler. ...
... back to the roots... did this 30+ years ago ... FPtmVpTNCM


Sent from my iPhone using Tapatalk

Re: piBeacon: 3- presence monitoring download

PostPosted: Mon Sep 16, 2019 2:18 pm
by kw123
===> added feature to read battery level for beacons <===

Code: Select all
Added features / changes in v7.111.311 @ 2019-09-16

1. debug on rpi now logs individual ibeacon msgs as they come

2.  added battery level querry for beacons, shown in dev.states["batteryLevel"] and in detaiuled device listing in indigo main window
     you MUST first edit each ibeacon indigo device and set enable battery level .. and select either
     "randown" or plain com to iBeacons.   xy beacons use random,  NODA, iHere .. use plain comm.
        you can try on the rpi with:
        hciconfig hci0 down
        hciconfig hci0 up
         for xy beacons:
           /usr/bin/gatttool -b MAC#  -t random  --char-read --uuid=2A19
         for iHere,  Noda ..
            /usr/bin/gatttool -b MAC#  --char-read --uuid=2A19
         replace MAC# with eg 0C:F3:EE:00:66:15 = the mac # of your ibeacon connected to that RPI

         the gatttool will return something like this (or an error message, can not connect)
             handle: 0x002f     value: 64
            where 64 is the hex value, into integer = 100%
        gatttool will conflict with the regular iBeacon message listening = during that time(..15 secs per ibeacon) no ibeacon messages will be received
        The RPI that is asked to get the battery level is the "closestRPI" to the iBeacon(see dev.state). When a beacon is not "up" it will not be querried and will keep its battery level unchanged

      In order to check if your SSD is supporting gatttol do: ssh pi@... gatttool.. if its says not found you need to upgrade your ssd
      error messages:
       -- connect error: software caused connection abort (103)       == beaconloop might have restarted and the BLE stack was rebooted, ==> resubmit
       -- connect error: transport endpoint is not connected (107)    == beacon is in state where it rejects requests ==> either ranom on/off or retry
       -- connect error: function not implemented (38)                == beacon is in state where it rejects requests==> either random on/off or retry
       -- connect error: timeout                                      == connection took longer that 15 seconds, terminated ==> retry

       - Set option in ibeacon device edit to enable battery reading
       - A) in pibeacon menu select: "Get iBeacons parameters from rPi" for a one-time update
       - B) create an indigo action group and select "Get iBeacons parameters from rPi ie battery levels"
             then add a schedule ( eg every 6 hours ) to call that action group.

    This is the first version, some fine tuning will be necessary.

configure beacon device:
Screen Shot 2019-09-16 at 17.04.55.png
Screen Shot 2019-09-16 at 17.04.55.png (71.76 KiB) Viewed 821 times

indigo device view shows % battery charge
Screen Shot 2019-09-15 at 12.26.34.png
Screen Shot 2019-09-15 at 12.26.34.png (29.55 KiB) Viewed 821 times
Screen Shot 2019-09-16 at 18.00.35.png
Screen Shot 2019-09-16 at 18.00.35.png (30.98 KiB) Viewed 820 times


ps. and thanks go to Allan for patiently debugging this.

Re: piBeacon: 3- presence monitoring download

PostPosted: Thu Oct 03, 2019 9:53 pm
by kw123
Code: Select all
Added features / changes in v7.112.312 @ 2019-10-03

1. fixed situation when plugin deletes RPI, due to  MAC number =00:00:00:00:00:00 - bad data coming from RPI

2. tuned IMPULSE sensor

3. made # of digits for sensors consistent

4. added several options for display device on RPI
   - supports xwindows = can show composed (dynamic) images in window on rpi desktop
   - added "thermometer" item to display, w options for labels, ticks etc
   - added zoom factor for xwindows display.
   - it will automatically start xwindows on rpi when indigo output device is an xwindows device type
   - option in rpi device edit to start windows on RPI by rpi-master program
example to display on rpi screen:
Code: Select all
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import json

devId = "1196962895"#  output device id

tI = (float(indigo.devices[593268732].states["Temperature"]) )
tO = (float(indigo.devices[1336842918].states["Temperature"]))
hI = (float(indigo.devices[593268732].states["Humidity"]) )
hO = (float(indigo.devices[1336842918].states["Humidity"]))
p = (float(indigo.devices[1278464850].states["Pressure"]))
co2 = float(indigo.devices[1344322418].states["CO2"])
il = float(indigo.devices[864053974].states["illuminance"])
pr = float(indigo.devices[1062219179].states["Pressure"])
dir = (indigo.devices[375541516].states["directionText"])
speed = (indigo.devices[375541516].states["avgSpeed"])
AirQ = int(indigo.devices[593268732].states["AirQuality"])
pm25 = int(indigo.devices[91799756].states["pm25_standard"])

termLen = 800 # size of thermometer
tRange   = [-15,45]
hRange   = [20,100]
pRange   = [980,1030]
co2Range = [380,600]

## set these params########
aClockCenter = [425, 425]
aClockRadius = [400, 400]
aClockWidth  = 64  #  w of hh, mm ss pointers and 2*pixels of ring on radius
dClockPos   = [20, int(aClockCenter[1]+ aClockRadius[1]+ aClockWidth/2)+20 ]
dClockW     = 130

zoom = 0.7
xTot = 1680 # x pixels
yTot = 1050# y pixel
xwindows = "on"
xwindowSize = str(int(xTot*zoom))+","+str(int(yTot*zoom))
y1F = 70 # y start of boxes
yfw = 300 # wdith of boxes

tOS = "{:.1f}".format(tO)
tOScale = int(-(tO-tRange[0])*termLen/(tRange[1]-tRange[0]))

tIS = "{:.1f}".format(tI)
tIScale = int(-(tI-tRange[0])*termLen/(tRange[1]-tRange[0]))

hIS = "{:.0f}".format(hI)
hIScale = int(-(hI-hRange[0])*termLen/(hRange[1]-hRange[0]))

hOS = "{:.0f}".format(hO)
hOScale = int(-(hO-hRange[0])*termLen/(hRange[1]-hRange[0]))

pS = "{:.1f}".format(p)
pScale = int(-(p-pRange[0])*termLen/(pRange[1]-pRange[0]))

co2S = "{:.1f}".format(co2)
co2Scale = int(-(co2-co2Range[0])*termLen/(co2Range[1]-co2Range[0]))

ilS = "{:.1f}".format(il)
prS = "{:.1f}".format(pr)
dirS = dir
speedS = "{:.1f}".format(speed)
AirQS = "{:d}".format(AirQ)
pm25S = "{:d}".format(pm25)

# same for all termometers:
yt1 = 70  # top
tL  = 20  # length of tick line
tW  = 3   # width of tick line
tF  = 30  # font size Thermometers
## set these params########  END

# different x positions
xt1 = int(aClockCenter[0] + aClockRadius[0] + aClockWidth* 0.9)
xt2 = xt1+55
xt3 = xt2+120
xt4 = xt3+90

# for the 2 frames on the right:
frW = 5 # width of frame line
xF1 = xt4 + tL +10
fs1 = int(120./350. * yfw)  # font size big
fs2 = int(fs1*0.8)   # font size med
fs3 = int(fs1*0.7)    # font size small
y2F = y1F + yfw + 100   # ystart of box 2
x1s = 20  # start of bix text
x2s = int(100/300. * yfw)
ys1 = 30  # start of big text
ys2 = yfw - fs2 - 50
#on, off,on time in seconds
onT1 = [0, 2, 6]
onT2 = [2, 2, 4]
onT3 = [4, 2, 2]
onT4 = [6, 2, 0]

# colors
# frames
colFTop = [255, 0, 0]
colFBot = [0, 255, 0]

# the thermometers
texC    ="[ºC]"   ;textCL   = int(-tL/2)
texH    ="%H"      ;textHL   = int(-tL/2)
texP    ="[mBar]" ;textPL   = int(-tL/2-2*tF)
texCO2  ="CO2"    ;textCO2L = int(-tL/2-1.5*tF)

colBlack = [0,0,0]
colWhite = [255,255,255]
colt1T1  = [255, 255, 0] # yellow
colt1B1 = [0,  255, 0]   # green
colt1B2 = [255, 0, 0]    # red
colt1T2 = [50, 50, 255]  # blue

colt2T1  = [255, 255, 0] # yellow
colt2B1 = [0,  255, 0]  # green
colt2B2 = [255, 0, 0]   # red
colt2T2 = [00, 00, 190]   # blue

colt3T1 = [30, 200,200]
colt3B1 = [0, 0, 200]

colt4T1 = [30, 200,200]
colt4B1 = [50, 50, 255]

font = "Arial.ttf"

plug = indigo.server.getPlugin("com.karlwachs.piBeacon")
if not plug.isEnabled(): return
plug.executeAction("Display" ,   props ={
 [{"type":"rectangle", "position":[xF1,     y1F,     xTot-10,      y1F+yfw+frW], "fill": colFTop, "display":"wait", "reset":[50, 50, 50]}
 ,{"type":"rectangle", "position":[xF1+frW, y1F+frW, xTot-10-frW,  y1F+yfw],     "fill":colBlack, "display":"wait"}
 ,{"type":"rectangle", "position":[xF1,     y2F,     xTot-10,      y2F+yfw+frW], "fill": colFBot, "display":"wait"}
 ,{"type":"rectangle", "position":[xF1+frW, y2F+frW, xTot-10-frW,  y2F+yfw],     "fill":colBlack, "display":"wait"}
 ,{"type":"text", "position":[xF1+x1s, y1F+ys1], "width":fs1, "fill":colFTop, "font":font, "text":tOS+"[ºC]",      "offONTime": onT1, "display":"wait"}
 ,{"type":"text", "position":[xF1+x2s, y1F+ys2], "width":fs2, "fill":colFTop, "font":font, "text":"outside",       "offONTime": onT1, "display":"wait"}
 ,{"type":"text", "position":[xF1+x1s, y2F+ys1], "width":fs1, "fill":colFBot, "font":font, "text":tIS+"[ºC]",      "offONTime": onT1, "display":"wait"}
 ,{"type":"text", "position":[xF1+x2s, y2F+ys2], "width":fs2, "fill":colFBot, "font":font, "text":"inside",        "offONTime": onT1, "display":"wait"}
 ,{"type":"text", "position":[xF1+x1s, y1F+ys1], "width":fs1, "fill":colFTop, "font":font, "text":hOS+"[%H]",      "offONTime": onT2, "display":"wait"}
 ,{"type":"text", "position":[xF1+x2s, y1F+ys2], "width":fs2, "fill":colFTop, "font":font, "text":"outside",       "offONTime": onT2, "display":"wait"}
 ,{"type":"text", "position":[xF1+x1s, y2F+ys1], "width":fs1, "fill":colFBot, "font":font, "text":hIS+"[%H]",      "offONTime": onT2, "display":"wait"}
 ,{"type":"text", "position":[xF1+x2s, y2F+ys2], "width":fs2, "fill":colFBot, "font":font, "text":"inside",        "offONTime": onT2, "display":"wait"}
 ,{"type":"text", "position":[xF1+x1s, y1F+ys1], "width":fs1, "fill":colFTop, "font":font, "text":ilS,             "offONTime": onT3, "display":"wait"}
 ,{"type":"text", "position":[xF1+x2s, y1F+ys2], "width":fs2, "fill":colFTop, "font":font, "text":"[Lux]",         "offONTime": onT3, "display":"wait"}
 ,{"type":"text", "position":[xF1+x1s, y2F+ys1], "width":fs1, "fill":colFBot, "font":font, "text":prS,             "offONTime": onT3, "display":"wait"}
 ,{"type":"text", "position":[xF1+x2s, y2F+ys2], "width":fs2, "fill":colFBot, "font":font, "text":"[mBar]",        "offONTime": onT3, "display":"wait"}
 ,{"type":"text", "position":[xF1+x1s, y1F+ys1], "width":fs3, "fill":colFTop, "font":font, "text":dirS+" at",      "offONTime": onT4, "display":"wait"}
 ,{"type":"text", "position":[xF1+x1s, y1F+ys2], "width":fs3, "fill":colFTop, "font":font, "text":speedS+"[Kmph]", "offONTime": onT4, "display":"wait"}
 ,{"type":"text", "position":[xF1+x1s, y2F+ys1], "width":fs3, "fill":colFBot, "font":font, "text":"AirQ:"+AirQS+"[%]", "offONTime": onT4, "display":"wait"}
 ,{"type":"text", "position":[xF1+x1s, y2F+ys2], "width":fs3, "fill":colFBot, "font":font, "text":"pm2.5: "+pm25S,"offONTime": onT4, "display":"wait"}
 ,{"type":"text",                   "display":"wait","width": tF, "fill": colt1T1, "font":font, "position":[int(xt1+ textCL),yt1-tF-10], "text": texC}
 ,{"type":"vBarwBox",               "display":"wait","width": tL, "fill": colt1B1,              "position":[xt1,yt1+termLen,tIScale,-termLen]}
 ,{"type":"labelsForPreviousObject","display":"wait","width": tL, "fill": colt1T1, "font":font, "position":["L",tW,[[0,""],[67,"-10"],[133,""],[200,"0"],[266,""],[333,"10"],[399,""],[467,"20"],[532,""],[599,"30"],[665,""],[732,"40"],[800,""]]]}
 ,{"type":"vBarwBox",               "display":"wait","width": tL, "fill": colt1B2,              "position":[xt1+ tL+2, yt1+termLen,tOScale,-termLen]}
 ,{"type":"labelsForPreviousObject","display":"wait","width": tL, "fill": colt1T1, "font":font, "position":["L",tW,[[0,""],[67,""],[133,""],[200,""],[266,""],[333,""],[399,""],[467,""],[532,""],[599,""],[665,""],[732,""],[800,""]]]}

 ,{"type":"text",                   "display":"wait","width": tF, "fill": colt2T2, "font":font, "position":[int(xt2+textHL),yt1-tF-10],   "text": texH}
 ,{"type":"vBarwBox",               "display":"wait","width": tL, "fill": colt2B1,              "position":[xt2,yt1+termLen,hIScale,-termLen]}
 ,{"type":"labelsForPreviousObject","display":"wait","width": tL, "fill": colt2T2, "font":font, "position":["R",tW,[[0,""],[100,""],[200,""],[300,""],[400,""],[500,""],[600,""],[700,""],[800,""]]]}
 ,{"type":"vBarwBox",               "display":"wait","width": tL, "fill": colt2B2,              "position":[xt2+ tL+2, yt1+termLen,hOScale,-termLen]}
 ,{"type":"labelsForPreviousObject","display":"wait","width": tL, "fill": colt2T2, "font":font, "position":["R",tW,[[0,"20"],[100,"30"],[200,"40"],[300,"50"],[400,"60"],[500,"70"],[600,"80"],[700,"90"],[800,""]]]}

 ,{"type":"text",                   "display":"wait","width": tF, "fill": colt3T1, "font":font, "position":[int(xt3+textPL),yt1-tF-10],   "text":texP}
 ,{"type":"vBarwBox",               "display":"wait","width": tL, "fill": colt3B1,              "position":[xt3,yt1+termLen, pScale,-termLen]}
 ,{"type":"labelsForPreviousObject","display":"wait","width": tL, "fill": colt3T1, "font":font, "position":["L", tW,[[0,"980"],[80,""],[160,"990"],[240,""],[320,"1000"],[400,""],[480,"1010"],[560,""],[640,"1020"],[720,""],[800,"1030"]]]}

 ,{"type":"text",                   "display":"wait","width": tF, "fill": colt4T1, "font":font, "position":[int(xt4+textCO2L),yt1-tF-10], "text":texCO2}
 ,{"type":"vBarwBox",               "display":"wait","width": tL, "fill": colt4B1,              "position":[xt4,yt1+termLen, co2Scale,-termLen]}
 ,{"type":"labelsForPreviousObject","display":"wait","width": tL, "fill": colt4T1, "font":font, "position":["L", tW,[[0,""],[80,"400"],[160,"420"],[240,"440"],[320,"460"],[400,"480"],[480,"500"],[560,"520"],[640,"540"],[720,"560"],[800,""]]]}

 ,{"type":"dateString",  "position": dClockPos, "width":dClockW,  "fill":colWhite, "font":font, "text":"%a, %b  %d, %Y", "display":"wait"}
 ,{"type":"analogClock","position": aClockCenter, "width": aClockWidth, "font":font, "display":"immediate", "box":{"on": "circle", "width": "25", "fill": [100, 100, 100]}, "mm":{"fill": [0, 255, 0]}, "ticks":{"fill": [150, 150, 150]}, "ss":{"fill": [0, 0, 255]}, "hh":{"fill": [255, 0, 22]}, "radius": aClockRadius, "mode":"lineRound,,TicksNumbers"}])
produces video: pic:
Screen Shot 2019-10-03 at 22.42.45.png
Screen Shot 2019-10-03 at 22.42.45.png (580.11 KiB) Viewed 781 times

Re: piBeacon: 3- presence monitoring download

PostPosted: Sun Oct 13, 2019 9:30 pm
by kw123
Code: Select all
Added features / changes in v7.112.314 @ 2019-10-13

1. switched from ifconfig to ip xx for network info on rpi if os is > 7 (jessie)
2. checking network connectivity now checking for router instead of dns server
3. improved handling of frequencies of sensor updates
4. some smaller menu corrections
5. upgraded neopixel libraries to support rpi4
5. changed DHT temp+humidity sensor to check temp twice and build average (takes ~ 3 secs)


Re: piBeacon: 3- presence monitoring download

PostPosted: Sat Oct 26, 2019 12:20 am
by kw123
posted v .317

-removed a duplicate entry in device edit for RPI
-fixed ibeacon short message exception
-fixed network setup when RPI can not ping router

did a manual upload to GitHub. hope everything went through correctly


Re: piBeacon: 3- presence monitoring download

PostPosted: Thu Nov 07, 2019 1:00 pm
by kw123
Added features / changes in v7.113.318 @ 2019-11-07
Code: Select all
1. added device type 52pi relay i2c HAT. This relay board has 4 relays, set through i2c,
you can stack 4 of these boards w 16 total relays, no soldering needed
see: for details

2. fixed some smaller items, menus etc

3. added option to setup wifi through file on RPI SSD boot directory.
this is the directory visible when you mount the SSD on a mac, it should also contain the file config.txt
add a file: wifiInfo.json with the exact format:
{"SSID":"abc", "passCode":"def"}
the file name as well as keys and data are case sensitive.
it will add:
to /etc/wpa_supplicant/wpa_supplicant.conf. replace abc and def with your wifi setup.
the /boot/wifiInfo.json file will be removed once used.
===> this allows to configure wifi at first start w/o connecting terminal and monitor and keyboard
YOU WILL NEED the NEW SSD from october 2019 to use that feature


Re: piBeacon: 3- presence monitoring download

PostPosted: Wed Nov 13, 2019 8:32 am
by kw123
Code: Select all
Added features / changes in v7.113.319 @ 2019-11-13

1. small fixes to auto wifi config using file on ssd boot directory

2. small fixes to menus

3. fixes to code on rpi to determine ip numbers etc. ie when in first startup = not connected to indigo

Re: piBeacon: 3- presence monitoring download

PostPosted: Sun Nov 17, 2019 10:23 pm
by kw123
version 7.114.319:
added rd-lidar sensor

see for details


Re: piBeacon: 3- presence monitoring download

PostPosted: Wed Nov 20, 2019 11:10 pm
by kw123
v7.114.321 @ 2019-11-20

1. fixed multiple onewire sensor detection

2. improved rd-lidar movement detection and display

Re: piBeacon: 3- presence monitoring download

PostPosted: Thu Nov 21, 2019 5:32 pm
by kw123
v7.114.322 @ 2019/11/21

1. fixed global variable "currTZ not defined" error on RPI. This is a minor error.. the time zone is not set under certain circumstance, program continues to run

2. added warning in case /beacon_parameters file becomes too big.
moved that file from temp directory to pibeacon directory as it not written too often.
this is the history file for ALLLL beacons ever seen. If you set "do not accept new beacons" that file strops growing and if you do menu/ignore beacons/ forget history the older junk beacons get erased. When the file becomes > 900KB it blows the temp directory on the RPI.

3. also increased the temp directory ram disk to 2 Mbytes.. just in case.

and thanks to Charles for testing and patience

piBeacon: 3- presence monitoring download

PostPosted: Sun Nov 24, 2019 9:00 pm
by kw123
Code: Select all
1. improved rd-lidar sensor:
   - 1. added selection (UBS0...4) or autotdetect of USB port
   - 2. added auto restart when usb gets interrrupted or receonnected
   - 3. added option in rdlidar device edit to select if graph data is send from RPi to indigo. That reduces data by factor of > 10.
        That data is not needed if no plots are produced.
   - 4. compressed trigger parameter display in graph (list in one line, empty sections now shown..)
   - 5. added option to not suppresss values of no measurement in plot. Only meant to show how many gaps in data (angles with no godd quality values)
   - 6. fixed angle display in graph. The sensor spins clock wise while math.sin(phi) goes conter clockwise; the data in display are now also clockwise
   - 7. improved menus w explanations and tooltips.

2. fixed INPUTcount sensor, had one wrong index (integer instead of string for GPIO)

3. Added time stamp to temp/messageSend on RPI. That file contains the last message send to the RPI. It is overwritten by the next message.
   follow it with cd pibeacon <ret>  tail -F temp/messageSend <ret> (use -F not -f). looks like:
   15:15:18 beaconloop:  send -- {"msgs":[["24...
   15:15:19 rdlidar:  send -- {"pi":"0","se...

for RD-LIDAR see [url][url][/url][/url]


Re: piBeacon: 3- presence monitoring download

PostPosted: Mon Dec 09, 2019 9:01 pm
by kw123
Code: Select all
Added features / changes in v7.114.326 @ 2019-12-09

1. improved rd-lidar sensor:
   option to exclude certain angles from being used in move trigger

2. fix bug: i2c state in RPi, number were wrong for Hex > 20

3. re-wrote the sensor function
   now does automatic calibration, you can also request a new calibration from menu or an action
   the sgp30 sensor does sometimes not show in i2cdetect -y 1.

4. added indigo log entry warning:
   >>> piBeacon Warning                RPi# 0 has i2c error, not found in i2cdetect sensor: sensor:bme680 - devId:593268732 i2c:119/0x77 <<<
   when any sensors i2c address is NOT in i2cdetect (excluded is sgp30)
   you need to edit and save each i2c device to activate
5. added xattr setting for >>pngquant<< png compressing tool (included in the plugin directory
   used for images (rd-lidar, beacon position). If you select to have no compression selected for images, this tool is not used
   For it to work you need to have the proper user password set in config.


Re: piBeacon: 3- presence monitoring download

PostPosted: Wed Dec 11, 2019 3:40 pm
by kw123
Code: Select all
Added features / changes in v7.115.326 @ 2019-12-11

1. added states to sensor devices:
    eg TemperatureChange10Minutes shows the delta temperature now - 10 minutes ago
    available for  Temperature, humidity, pressure, airquality, CO2, VOC
    each has 3 states eg 5 minutes/1 hours /12 hours or 10 minutes /1 hour /6 hours ..
    depending on which timing makes sense: for co2 and airquaility you want to have fast reaction time (=5 minutes),
    for temperature and humidity 10 miutes is fine ..
    In addition you still have min / max today and yesterday

for a BME680 the states would look like this:
Screen Shot 2019-12-11 at 15.37.13.png
Screen Shot 2019-12-11 at 15.37.13.png (59.59 KiB) Viewed 511 times

You could use this for a trigger: eg when pressure falls in the last hour by > 50 mBar ==> panic go to basement