fantasytu / homebridge-mijia-thermometer

Homebridge plugin for the Xiaomi Mi Bluetooth Temperature and Humidity Sensor
Apache License 2.0
25 stars 2 forks source link

Not connecting to two LYWSD03MMC ads the same time #1

Open firewhank opened 3 years ago

firewhank commented 3 years ago

Hi,Screenshot 2021-08-16 at 14 57 14 1 I have two LYWSD03MMC and I´m able to connect to one at a time but when I put the two in the json file, it only connects to one.

I verified and i can connect to both individually by only put one in the json file.

The MAC Addresses and correct

Screenshot 2021-08-16 at 14 55 26

Running

firewhank commented 3 years ago

Bluetooth chipset BCM20702A0

ahmadnazirafiq commented 3 years ago

Hi firewhank,

How did you manage for it to be discovered? Mine just says 0.0 degrees in HomeKit. In Homebridge log, it says:

[17/08/2021, 17:48:32] [Foyer Temp] Stopped scanning. [17/08/2021, 17:48:33] [Foyer Temp] Stopped scanning. [17/08/2021, 17:48:33] [Foyer Temp] XX:XX:XX:XX:XX:XX (LYWSD03MMC) Connecting [17/08/2021, 17:48:34] [Foyer Temp] XX:XX:XX:XX:XX:XX (LYWSD03MMC) Connected

firewhank commented 3 years ago

Hi Nazir Try this sudo hcitool lescan. I think it forces the plug in to search the BLE devices.

I had to do this every time I rebooted the homebridge

pzim-devdata commented 3 years ago

I have exactly the same issue. I have 5 LYWSD03MMC. I can make 4 LYWSD03MMC works not more :

  1. I have created a script named "connect_bluetooth.sh" in /home/pi/startup/ with inside :

    #!/bin/bash
    "my_first_command_to_start (if you have already a command to start at startup with rc.local)";
    "my second command";
    while true;do
    sudo hcitool lescan
    sleep 2
    done

    Make it executable of course

  2. I have edited /etc/rc.local : "sudo nano /etc/rc.local" with inside the path to script :

    
    #!/bin/sh -e
    #
    # rc.local
    #
    /home/pi/startup/connect_bluetooth.sh

exit 0

Charmandrigo commented 3 years ago

Same problem too, I have two of those sensors but the plugin stops looking for more when one of them has connected, I mean this is Bluetooth LE, it should support several devices at a time

fantasytu commented 2 years ago

Support for multiple devices will be tested in the following two weeks but the new version I pushed just now has fixed the 0.0 degree & humid issue.