I’m having mosquito issues with some of my mqtt devices and it’s difficult to debug because monitor connects/disconnects rapidly many many times per minute with a different client I’d every time. Is there any way to reduce or stop this behaviour without impacting the effectiveness of the script?
I’ve found this post to scan for beacons which should include the tile mate. I have not purchase the tile mate yet and wanted to know if it will work for just presence detection when at home and not if outside. A few post down happybubbles suggest to forget the tile from the mobile app if you don’t use the app at all.
@ Mikefila thx for answer. i added it like this in known_static_beacons:
00:00:00:00:00:00 Nickname
But i dont understand where i should add random?
thx
“random” made it work! Works really good with my tile. BUT not with my phones. tile updates when it leaves home but phone BT sensor is always home. same on 3 phones in my home.
Do you know why maybe?
This is how i start monitor: sudo bash monitor.sh -x -b -tdr
This is how i start the script from CMD on my windows machine after ssh to RPi2
The first time I started, I wrote like this:
sudo bash monitor.sh -x -b -tdr -u
and now like this:
sudo bash monitor.sh
automation:
- initial_state: 'on'
alias: 'Front door open/closed BT helper atm'
trigger:
- platform: state
entity_id: binary_sensor.pi3_front_door_sensor
to: 'off'
action:
- service: script.scan_bt_depart
- service: script.scan_bt_arrive
im going to split them up to two automatins like your guide. one when i unlock door from inside (depart) and the other when unlocking with tag/code from outside.
EDIT
now i see i have wrong entity in that automation :'D
changing to this for now:
- initial_state: 'on'
alias: 'Front door open/closed BT helper atm'
trigger:
- platform: state
entity_id: lock.dorrlaset
to: 'unlocked'
action:
- service: script.scan_bt_depart
- service: script.scan_bt_arrive
This is just a short version, you should really read up on how to work on ubuntu-like systems that use systemd.
monitor.sh is the file, that does the work. If you setup a monitor.service file, this is the one that is needed to autostart the monitor.sh file, eg. after a restart. This service file is for the OS to know, how to handle this “autostart”. As this service is controlled by the OS, you can enable, disable, start or stop this service.
So after setting up monitor.sh you have to make it autostart. Setup the file monitor.service and check the contents. After that enable the service and you are good to go.