[Monitor] Reliable, Multi-User, Distributed BT Occupancy/Presence Detection

automation
mqtt
Tags: #<Tag:0x00007f1ba6cdb590> #<Tag:0x00007f1ba6cdb3d8>

#708

Are you running the master branch or the beta?


#709

how often is the sensor.home_occupancy_confidence supposed to update? every time there’s a mqtt pusH?

also it doesn’t seem to be picking up my iphone7+ even though its right next to the rasberry pi :frowning: confidence level is still showing 0 and sometimes 18…


#710

Is there any way of using the rssi data published to he MQTT topics to give some idea of distance from each of the detectors? I understand it would probably be a pretty low confidence in terms of distance, but may be useful to feed into the “confidence” %?


#711

That was the master branch. I wasn’t aware there was a beta branch so I’ve switched to that and it seems to be working well now.


#712

How would I configure a sensor in HA to monitor the heartbeats? Will be a simple be useful monitor to know if I’ve not received a heartbeat from either of the detectors over a period of time…


#713

is it possible to change the confidence level? my phone is 20 feet away and still shows 100…% any chance this can be lowered depending on how far away it is?


#714

For beacons, yes. For other devices, I’m working on a solution in the beta branch.


Use monitor app to show if im home or not?
#715

No, confidence is a mark of the binary “home” or “away” decision.

I’m working on a solution for RSSI for known devices.


#716

can we change this to a higher number like 60?
this is when it first starts:

preference: beacon rssi change required for reporting = 10


#717

Fantastic! Thank you for your work on this!


#718

I finally got this to work with my own mqtt server, seems to be an issue with username/password since i had to leave it blank…, anyways

can you explain how this sensor works?

- platform: min_max
  name: "Home Occupancy Confidence of 00:00:00:00:00:00"
  type: max
  round_digits: 0
  entity_ids:
    - sensor.media_room (does not exist in home assistant)

I changed the entity_id’s to sensor.media_room, but where does the information pull for sensor.media_room if i don’t have one?


#719

so…you have to create the template sensor first!
the name you give it is the name you will put here.

Did you create a platform: mqtt sensor like mentioned in the guide?


#720

Yes, i have this successfully reporting 100
but ther is no sensor.media_room??

  - platform: mqtt
    name: "Media Room Presence"
    state_topic: "monitor/media_room/9C:E6:5E:0B:4B:C9"
    value_template: "{{ value_json.confidence }}"
    unit_of_measurement: '%'

#721

You sensor is named “Media Room Presence” so guess what you have to put as entity_id :wink:

sensor.media_room_presence

#722

so the underscore names it automatically?


#723

If you want to check the entity name look in the dev-state page.


#724

I don’t understand what you are saying but as I said you named the sensor “Media Room Presence” yourself.
See this https://i.imgur.com/n8b0HGT.png

So that means you need to put here as well:

- platform: min_max
  name: "Home Occupancy Confidence of 00:00:00:00:00:00"
  type: max
  round_digits: 0
  entity_ids:
    - sensor.media_room_presence

#725

i got it, thank you! i just didn’t realize that became the name of the new sensor :wink:

now if only you could modify the sensistivity level of the bluetooth on the pi w’s instead of 30’ it would be nice if it was 10…


#726

My monitor has started to sometimes have this HCI error, same as this (https://github.com/andrewjfreyer/monitor/issues/25) but it’s not all the time. I don’t know if it has to do with this but the raspberry also disconnects from my Mosquitto broker after a short while. Making the whole home/away not working for me. I tried to do bash monitor.sh - E and all seems fine there, finding my phone etc. But still 0% in my Home assistant. What can I do to solve this?

Edit: I did some research in the long long thread here and found out that it could be solved with pairing to a bluetooth device first. Now everything it’s working just perfect :slight_smile:


#727

Question: I suspect that arrive triggers aren’t actually starting an arrive scan. When I trigger a scan from HA or directly through MQTT I can see this popping up in the logs:

mqtt trigger arrive {monitor/scan arrive

yet it doesn’t fire of a scan, I can’t see the message

**** Started arrival scan. [x2 max rep] ****

This does work consistently with the depart trigger, just not with arrive. Am I missing something? Or could it be that I don’t send the right MQTT message (which seems unlikely, but who knows)? I’ve tried this with both “-t” on and off with same results. Any help is much appreciated!