OpenMQTTGateway with Mi Band 2

Hi @1technophile

Recently I started using Mi Band 2 and I plan to use it as room presence detection. I am wondering can your gateway support this?

Referring to the wiki; GitHub - 1technophile/OpenMQTTGateway: MQTT gateway for ESP8266 or ESP32 with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, Bluetooth, beacons detection, mi flora, mi jia, LYWSD02, LYWSD03MMC, Mi Scale, TPMS, BBQ thermometer compatibility & LORA. , it says

the BLE beacons must not be paired with other devices so as to be seen by the gateway.

does that mean my Mi Band 2 must not be paired with my phone in order for it to work?

Thanks.

Hello @masterkenobi. I’m using MI band 2 almost one year. It paired to my phone. It’s discoverable even after setting option hiden. So you can safely pair it and use gateway to discover presence of miBand.

1 Like

Hello @masterkenobi

For the devices I tested ; key finders, if they are connected to the phone the hm10 was not able to saw them. Regarding the mi band I can t say. I would refer to @Lapatoc.

1 Like

Thanks @Lapatoc for sharing your experience. I’m wondering how reliable is OpenMQTTGateway + Mi Band 2 as room presence detector? Are you happy with it? Do you put the gateway in every room?

I haven’t get to that part. I have only basic setup with owntracks.

I have a room presence setup using MiBand 2 and happybubbles and it works perfectly.
It detects within 1~2 seconds on entry and 4~10 seconds on exit.

1 Like

Thanks for suggesting happybubbles. It looks interesting even though it only does BLE. If OpenMQTTGateway can perform as good as happybubbles, then I see no reason to change to happybubbles because OpenMQTTGateway can do a lot more than BLE. I’m wondering has anyone compared the 2?

By the way, I notice at https://www.happybubbles.tech/presence/docs/rpi3_setup/ , I can install happybubbles on my existing RPi3. I’m wondering does it slow down the HA in the same RPi3? Is the performance same with the standalone happybubbles board?

The hardware detects the beacons and reports(through MQTT) to a server application which sorts through the beacons and selects the closest one to the room which is reported back to MQTT. The installation link you points is for the server part.
In my setup I have my HA, MQTT, FIND, HappyBubbles, KODI, MythTV and a bunch of other stuff on a Linux(Ubunu) server.
If the OpenMQTTGateway can publish the same details to the same MQTT channel then you can use HappyBubbles server software to select the closest beacon. Or you can use the RoomAssistant

I assume your Mi Band 2 is consider as a beacon, right?

Is it on Raspberry Pi 3?

Are you saying, other than the Presence Detector, I also need to install the Happy Bubbles Presence Server in a Raspberry Pi 3?

I think is very light, no problem on a pi3

I have happy bubble and fitbit.

It works, can’t say how long it takes to signal in and out (need to check)

1 Like

Yes

Not on RPi3, on a I7 machine but as claudio said the Presence server is very light on resources.

1 Like

Thanks guys. I think I understand the concept of happybubbles.

@1technophile, is it possible to include an option in your gateway to emulate happybubbles payloads? If I turn it on, it will publish the payload that happybubbles server can process. I want to stick with your gateway because it can do a lot of functions. I plan to include not only the Bluetooth module, but also DHT22 and IR.

By the way, is it possible to add support for ambient brightness module as well? If yes, it would be the perfect device to put in every rooms.

@masterkenobi yes possible, @happybubbles are you open to the fact making openmqttgateway compatible with happybubbles server? I could work on that if yes.

Regarding ambient brightness it is already supported with this sensor addon into the master:
https://github.com/1technophile/OpenMQTTGateway/blob/master/ZsensorBH1750.ino
Will be documented into the next release.

2 Likes

Thanks. While we wait for @happybubbles response, I notice that in the ZsensorBH1750.ino comment under “Connection Schemata:”, it says…

BH1750 ------> Arduino Uno ----------> ESP8266

Does that mean I need Arduino Uno on top of NodeMCU? Or can I just NodeMCU?

@1technophile if you can make your gateways publish BLE using the JSON format described here: https://www.happybubbles.tech/presence/detector in the “MQTT and Message Format” then the Happy Bubbles Presence server should be able to interpret it just fine.

Unfortunately, I just have way too much on my plate at the moment to modify the presence server to work with your code and format. So for this to work, you’d have to make your gateway publish BLE using the spec and format I created.

Very cool project BTW and great work on it!

2 Likes

A ESP8266/NodeMCU can talk (I2C) directly to a BH1750. I think the schema is just misleading. You must not drive the BH1750 with 5 volts. Please supply 3.3V. A TTL higher than 3.3V can damage the ESP8266.

Don’t forget a Hassio add-on for your happy bubble

agreed! I am seriously looking at getting some bubbles of the jovial variety.

You can use either nodemcu either arduino uno

1 Like