turbo-lab / android-beacon-mqtt

Simple android application for notifying MQTT server when iBeacon is in range or lost
GNU General Public License v3.0
23 stars 7 forks source link

MQTT settings for Version 0.3 Build 21(android 10 on oneplus5T) #37

Closed GGW42 closed 3 years ago

GGW42 commented 3 years ago

Hi, I am trying to use your program with Home assistant but have yet to see any MQTT messages, I suspect I have configured them wrong but what I see on my screen doesn't in any way match what you have on your site.

2021-04-05 10 23 25

Your site mentions "MQTT Settings" Server & Port Username/Password - These are fine I have used MQTT for a while now and can populate these ok. then shows examples of these Beacon Enter topic Beacon Enter Message Beacon Exit topic Beacon Exit Message

but My Android App asks for MQTT templates instead.

Beacon State topic Master Topic
Master Enter Message
Master Exit Message Track Topic
Track Message
I have tried various combinations of %beacon% / %mac% but have yet to see a message in MQTT explorer? The Log says it has sent heaps but if MQTT explorer sees nothing I don't see how theses are really sent. I am not sure what the Master Topic is supposed to be for or the Track Topic. Could someone please give me an example of how I should fill in the MQTT templates in a meaningful way.

As you can see on the next image I have a beacon a few meters away and that works, ok BeaconMQTTS1 As a side note the Logs on my phone are very hard to see, they are always a dull gray colour and only populate the bottom 1/3 of the screen, not the full available space. This can be seen in the image above.

turbulator commented 3 years ago

Try my settings:

Screenshot_2021-04-05-17-15-43-870_org turbo beaconmqtt

GGW42 commented 3 years ago

Hi @turbulator Thanks that was a help. I have left [Beacon State topic] , [Track Topic] & [Track Message] all blank and just used the [Master Topic and messages] settings. It displayed location and a 12 digit Hex number which doesn't seem to be related to the MAC of the beacon or my phone but I can live with that. <%group%> did nothing but I replaced it with the word "present" and it then displayed the hex number <%mac% = present>. Thanks again.

turbulator commented 3 years ago

%group% is the beacon's group which you configured when added beacon. I have two beacons in my house with the same group. It is really useful.

turbulator commented 3 years ago

I confugured groups like zones in my Home Assistant. Home, work, car, etc.

Also you can confugure unique tag for each beacon and use %tag% in templates. It makes sense for wrong mac addresses.

GGW42 commented 3 years ago

Thanks, I only have a single beacon, so hadn't bothered with the groups, I hadn't thought of them as similar to zones. I am still trying to work out how to get Home Assistant's presence detect to use it, I find the examples are often less then useful for a beginner.