Home Assistant Community

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

mqtt
automation
Tags: #<Tag:0x00007f3750697768> #<Tag:0x00007f3750697420>
#872

You have, this is likely a bug.

0 Likes

#873

What are others other for their NodeRed HA flows for at least 2 known trackers? I am trying to create the best method usind -tad only as i trigger using the front door and garage door.

  • I current have a HA script that runs arrive with 30 sec delays 3 times on a trigger and the same for a depart. But want to see what others are doing and maybe i tweak my setup
    Thank you!!
0 Likes

#874

I posted mine up above,

Changed a little bit with the latest HA node palette update, but not enough to warrant reposting.

0 Likes

#875

So for me i have 2 pi’s main floor and upper floor

  • I have a trigger on my main door and garage door
  • i am using Node Red in HA and i am using my confidence level of myself and my wife
  • when i open the front door it checks our conf level and if we are at 100 it will trigger the depart script which i have it calling the depart topic 4 times with 30 sec delays between them.
  • When we are at 0 it will run the arrive script

Here is the issue; i left the house first and i was at 100; so i got departed no problem; i am waiting in the car on the driveway now and my wife comes out from the front door and since she was at 100 it runs the depart script for her now - BUT… now that i am sitting at 0; it also runs the arrive script on me and brings me back home.

Thinking there has to be a better method to this all!!

0 Likes

#876

Hey guys!

I have everything setup but I’m having a hard time making work the depart or scan triggers when running monitor with -tad options.

I’m connected to the MQTT broker (Mosquitto add-on on my Hassio install) on 2 different clients so with one I can send the topics and with the other I can make sure it was received. Everything seems to be working fine in the broker, I even get RSSI messages from one of my phones meaning monitor is also connected correctly to the broker.

However when I send the topic monitor/scan/depart or monitor/scan/arrive nothing happens and monitor doesn’t show any new scans. The message In the broker is received tho.

No entirely sure how to debug or what to try, any ideas?

Thanks!

0 Likes

#879

Make sure you’re also using the -r flag for a full: -tadr - this will allow your nodes to communicate with eachother.

0 Likes

#880

these should both be blank variables if you do not use a password on your mmqtt broker

0 Likes

#881

Thanks @andrewjfreyer, I only have one node but I will try your suggestion and see if it makes a difference!

0 Likes

#882

I misread - the -r flag addition wont matter for a single node installation. Run monitor from the command line and see what happens when you send the mqtt messages.

0 Likes

#883

Yes, that is what Im doing, basically is not triggering anything :frowning:

0 Likes

#884

@andrewjfreyer I much appreciate your work on this, and the copious documentation. I have just set up Monitor and having it running on default parameters. I am trying to track a few beacons (these ones) and I am struggling. I have run
sudo bash monitor.sh -b
and can see several devices being reported by MAC address, including those in the known_static_addresses file. But I don’t see any of my iBeacons being reported by UUID for some reason. I am running the iOS app eBeacon and it can see the beacons as normal, and I can configure them to display a specific name or UUID. But I don’t see them popping up in the activity reported by monitor.sh.

I’m sure I’m missing something pretty obvious but I’m a newb on this stuff so I would really appreciate any pointers. Thanks again.

0 Likes

#885

What do you mean by blank variables ? A space, nothing after a =, no rows entirely , nothing between commas, nothing between apostrophe. Can you please write it down.

The only one that gives less errors is

mqtt_user=" "

but the script is causing lots of problems in my mqtt server, I opened an issue in github

0 Likes

#886

Has anyone started building a Hass.io addon for this?

0 Likes

#887

like this:

mqtt_user: ""

0 Likes

#888

@Craig_McGowan I’m having difficulty duplicating this issue. Try stopping the service via sudo systemctl stop monitor and running via command line.

0 Likes

#889

Like you say gives error

=================== DEBUG ======================
starting monitor.sh (v. 0.1.985)…

removing web request caches
removing public name cache
/home/openhabian/monitor/mqtt_preferences: line 11: mqtt_user::
command not found
/home/openhabian/monitor/mqtt_preferences: line 13: mqtt_passwo
rd:: command not found

0 Likes

#890

Perhaps you’d better post your whole mqtt_preferences file.

0 Likes

#891

I know this is your program, but shouldn’t it be

mqtt_user=''
0 Likes

#892

No gives error

.

  GN

=. [x1
  GNU nano 2.7.4       File: mqtt_preferences

# ---------------------------
#                                                             $
# MOSQUITTO PREFERENCES
#                                                             $
# ---------------------------

# IP ADDRESS OR HOSTNAME OF MQTT BROKER
mqtt_address=192.168.1.16

# MQTT BROKER USERNAME (OR BLANK FOR NONE)
mqtt_user=''
# MQTT BROKER PASSWORD (OR BLANK FOR NONE)
mqtt_password=''

# MQTT PUBLISH TOPIC ROOT
mqtt_topicpath=monitor

# PUBLISHER IDENTITY
mqtt_publisher_identity='office_pi3'

# MQTT PORT
mqtt_port='1883'

# MQTT CERTIFICATE FILE (LEAVE BLANK IF NONE)
mqtt_certificate_path=''

#MQTT VERSION (LEAVE BLANK FOR DEFAULT; EXAMPLE: 'mqttv311')
mqtt_version=''


                       [ Read 30 lines ]
^G Get Help ^O Write Out^W Where Is ^K Cut Text ^J Justify
^X Exit     ^R Read File^\ Replace  ^U Uncut Tex^T To Spell
0 Likes

#893

That’s on my hassio mosquitto log (it doesn’t stop until I stop the script)

92.168.1.238 on port 1883. 1549865767: Socket error on client <unknown>, disconnecting. 1549865767: New connection from 192.168.1.238 on port 1883. 1549865767: Socket error on client <unknown>, disconnecting. 1549865768: New connection from 192.168.1.238 on port 1883. 1549865768: Socket error on client

0 Likes