[monitor] Reliable, Multi-User, Distributed Bluetooth Occupancy/Presence Detection

I am using a similar script, and have it setup to trigger on state change of my Garage or Front door,

- alias: Monitor MQTT Departure
  trigger:
  - entity_id: binary_sensor.door_window_sensor_158d00027b3daa
    from: 'off'
    platform: state
    to: 'on'
  - entity_id: binary_sensor.door_window_sensor_158d000239432d
    from: 'off'
    platform: state
    to: 'on'
  action:
  - data: {}
    service: script.mqtt_depart

cool thank youā€¦ obviously really. what about the script please? does it contain ā€œservice: mqtt.publishā€

As Benā€™s doesnā€™t appear to? or maybe I am having an old man minute?

Nope thatā€™s all you need, mine is the same, just different timings :smiley:

1 Like

so how does it cancel the depart script before it runs please?

Sorry you lost me there, cancel the depart script before it runs ?

You want the depart script to run when you open the door. If you are going away, it will detect your phone as not here, if you just open the door to greet someone, you will still be there, so the depart script wont return a 0 value.

ah just something that was said in another post not by you :slight_smile:

Yeah, but you canā€™t buy 7 of them. They limit them at one per customer.

Who does??

In my region, the barebones Pi Zeros are indeed limited to one per customer, but bundles with cases, psus etc do not have any limits.

Hi Guys! I want the monitor service call depart scan periodically (like a cron each 1 minute for example). Seems from everything that I read, I need to start it with flags monitor.sh -r -a -x. I already did it, and also subscribe to appropriate topic in node-red. But I see from logs that messages publishing not so often. I have some other solution (can actually publish scan command from my node red server each minute, or from HA), but I think would be better use this feature in monitor. So, does anybody know how to do that?)

But then, itā€™s no longer cheap. which mean you are better of with ESP32s.

Monitor is a bash script running on linux. Porting to esp32 will not be as simple as just running it on a different platform.

If you build it for esp32 then people will love you, but I think it is unlikely to just appear without a knowledgable enthusiast stepping in.

@andrewjfreyer regarding this:

an mqtt message is sent to Home Assistant reporting that the scanned phone is ā€œhomeā€ with a confidence of 100%. In addition, an mqtt message is sent to the second and third floor to trigger a scan on those floors as well.ā€

Is the MQTT message that triggers the others to scan an internal setting in Monitor or is an automation via Node red or Hassio?

How exactly do you set the flag?

Is it this setting?

#AMOUNT AN RSSI MUST CHANGE (ABSOLUTE VALUE) TO REPORT BEACON AGAIN
PREF_RSSI_CHANGE_THRESHOLD=5

I have been monitoring some Nut 3 tiles for awhile with this excellent script and decided to extend this to some other items I would like to track. I have some Tile and generic beacons which require to be synced to an app first. I know there is a Tile component but it isnā€™t what Iā€™m looking for. I can put the beacons into pair mode and ā€œMonitorā€ can see them but the beacons go to sleep after that and always show ā€œ0ā€. Does anyone know if there is a way to have these beacons periodically probe like the Nut 3 ones do? Just want to know if my items are home or not not actually track their actual whereabouts.

Solved Nevermind they do this until they have actually been paired with a device

I allways get a empty rssi ("rssi":"") from my phone, my wifes phone and the tv im tracking.
Is there any flag i need to set, or is the rssi only for some devices?
I would like to get my rssi into grafana to be able to compare some curves over a longer time.

I got a CC2640 today, but confidence stays on 0 in monitor with -b and the mac-address in known_beacon_addresses. Have you succeeded ?

Yeah Iā€™m using the beta and apart from occasional restart needed it works great.

2 Likes

Interesting, and you have it in known_beacon_addresses ? Perhaps the CC2640 I have is flashed differently than yours. I purchased one on AliExpress that I believe you linked to earlier.

yes, i have the beacon address added to known_beacons_addresses.
Ibought from that exact seller/listing but it is possible something changed and they shipped different devices.
can you seee the beacon in nrf explorer and hcidump lescan ?