Beacon MQTT is the simple android application for notifying MQTT server when iBeacon is in range or lost.
Beacon MQTT will be useful for Home Assistant users and interacts with HA through the MQTT Device Tracker module.
Main screen | New beacon | Timing settings | MQTT settings
Since v0.2 Beacon MQTT is available on Google play.
Before adding the first beacon
The detecting process is time critical. You have to disable any application activity restrictions in your android. Without this action you will have lots of false beacon losses.
Great! You are ready to add your first beacon. Press “ADD NEW BEACON” button and wait some time. You will see all beacons in the range. You can differ beacons by the distance. Tap on beacon which you want to add. In dialog write the name of beacon and click save.
Note for HA users: you should enter the same name as the name of corresponding zone. See MQTT Device Tracker for more details.
Also you can add beacons that are not in range. Click on plus button of action bar and fill fields manually.
Scan in process | New beacon | Context menu | Delete beacon | Edit beacon
To modify or delete the beacon just use long press on it to show context menu.
I suggest next timings:
- 1000 … 2000ms for scan
- 9000 … 15000ms pause between scans
- 180000 … 300000ms loss timeout
This allows you to have a small discovery time and save battery power. Anyway you can play with timings.
You have to configure the parameters of your MQTT server. Toasts will help you with connection state. Beacon MQTT will reconnect to the MQTT server in case of network problems automatically. MQTT messages will be stored in buffer and delivered after reconnect will be done.
I’ve made templating subsystem for MQTT topic and payload. %mac% - is my WiFi mac. %beacon% - is the name of beacon in saved beacon’s database. These keywords will be changed by actual values before sending.
To be compatible with MQTT Device Tracker module use next:
- %beacon% - for enter payload
- not_home - for lost payload
- location/%mac% - for both topics
The log screen shows last 1k lines. It helps you with debugging of interaction. You can clear journal by pressing clear button.
- Only iBeacon is supported now
- Just 4 beacons can be added
- You shouldn’t have overlapped beacons
Please visit my github page to list known issues. Do not hesitate to open new ones. Thanks in advance for your feedback, guys!