ostrya / PresencePublisher

An Android MQTT client that regularly publishes messages to notify about the device's presence
MIT License
83 stars 13 forks source link

Add iBeacon detection and publishing #6

Closed hubertbanas closed 4 years ago

hubertbanas commented 5 years ago

It would be great to integrate iBeacon detection and publishing as well.

Similar to: https://github.com/bjaanes/BeaconMqtt

ostrya commented 4 years ago

I agree that beacon detection would be nice. But as you mentioned, there is already BeaconMqtt for that. What would be the benefit in your opinion to add this functionality here? I'm asking because I currently do not own a beacon, so it is kind of hard to develop it with no way of testing.

hubertbanas commented 4 years ago

Presents detection using WiFi is just too slow which makes it unreliable. There are times user might be in WiFi range for some time but because their phone is in "deep sleep" state it will not even try to connect. See here for more details https://developer.android.com/training/monitoring-device-state/doze-standby

Connecting to Bluetooth Low Energy Beacons on the other hand is instantaneous. My idea would be to have inexpensive ESP32 modules act as iBeacon (see https://esphome.io/components/esp32_ble_beacon.html). Have multiple of them around the premises ex. one near the garage, the other close to the front door, etc. As soon as getting into their range the "PresencePublisher" would act accordingly.

BeaconMQTT I mentioned is missing MQTT user authentication therefore not usable to many. It also have not seen updates in a long time.

ostrya commented 4 years ago

All right, I will see what I can do.