hannseman / homebridge-mi-hygrothermograph

Homebridge plugin for the Xiaomi Mi Bluetooth Temperature and Humidity Sensor
MIT License
266 stars 52 forks source link

Doesn't connect to the device #100

Closed ArielZgo closed 4 years ago

ArielZgo commented 4 years ago

Expected Behavior

I should have seen the current temperature & humidity

Current Behavior

It says it's not connected. I cannot do anything with it in the Home App. Although no errors are shown in the Logs...

Steps to Reproduce (for bugs)

Installed the bluetooth library Installed your plugin Tried with both - Mac address and without Mac address

Versions

Configuration

{ "accessory": "Hygrotermograph", "name": "Room 1", "address": "MAC address of MJ_HT_V1" },


### Homebridge Log / Command Output
[4/5/2020, 7:04:44 PM] Loaded plugin: homebridge-mi-hygrothermograph
[4/5/2020, 7:04:45 PM] Registering accessory 'homebridge-mi-hygrothermograph.Hygrotermograph'
[4/5/2020, 7:04:45 PM] ---
fishray33 commented 4 years ago

Hello, the same problem, cannot connect to device.

valeraOlexienko commented 4 years ago

Same here. After updated stopped working. No errors.

hannseman commented 4 years ago

@valeraOlexienko after updating what?

If you’re not running node as root you need to give node access to bluetooth after updating node (if that’s the case):

sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)
fishray33 commented 4 years ago

@valeraOlexienko after updating what?

If you’re not running node as root you need to give node access to bluetooth after updating node (if that’s the case):

sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)

Thanks, this worked.

jannisberry commented 4 years ago

Hi, i have a problem with the MJ_HT_V1, where i start my Homebridge and everything starts normally but the sensors aren't showing up but I'm not sure if they just don't connect. Here is the Log in the Homebridge:

Apr 18 11:00:46 raspberrypi systemd[1]: Started Node.js HomeKit Server.
Apr 18 11:00:48 raspberrypi homebridge[3635]: [4/18/2020, 11:00:48] Loaded config.json with 2 accessories and 5 platforms.
Apr 18 11:00:48 raspberrypi homebridge[3635]: [4/18/2020, 11:00:48] ---
Apr 18 11:00:48 raspberrypi homebridge[3635]: [4/18/2020, 11:00:48] Loaded plugin: homebridge-config-ui-x
Apr 18 11:00:48 raspberrypi homebridge[3635]: [4/18/2020, 11:00:48] Registering platform 'homebridge-config-ui-x.config'
Apr 18 11:00:48 raspberrypi homebridge[3635]: [4/18/2020, 11:00:48] ---
Apr 18 11:00:51 raspberrypi homebridge[3635]: [4/18/2020, 11:00:51] Loaded plugin: homebridge-hue
Apr 18 11:00:51 raspberrypi homebridge[3635]: [4/18/2020, 11:00:51] Registering platform 'homebridge-hue.Hue'
Apr 18 11:00:51 raspberrypi homebridge[3635]: [4/18/2020, 11:00:51] ---
Apr 18 11:00:51 raspberrypi homebridge[3635]: [4/18/2020, 11:00:51] Loaded plugin: homebridge-mi-hygrothermograph
Apr 18 11:00:53 raspberrypi homebridge[3635]: [4/18/2020, 11:00:53] Registering accessory 'homebridge-mi-hygrothermograph.Hygrotermograph'
Apr 18 11:00:53 raspberrypi homebridge[3635]: [4/18/2020, 11:00:53] ---
Apr 18 11:00:54 raspberrypi homebridge[3635]: [4/18/2020, 11:00:54] Loaded plugin: homebridge-platform-wemo
Apr 18 11:00:54 raspberrypi homebridge[3635]: [4/18/2020, 11:00:54] Registering platform 'homebridge-platform-wemo.BelkinWeMo'
Apr 18 11:00:54 raspberrypi homebridge[3635]: [4/18/2020, 11:00:54] ---
Apr 18 11:00:54 raspberrypi homebridge[3635]: [4/18/2020, 11:00:54] Loaded plugin: homebridge-shelly
Apr 18 11:00:55 raspberrypi homebridge[3635]: [4/18/2020, 11:00:55] Registering platform 'homebridge-shelly.Shelly'
Apr 18 11:00:55 raspberrypi homebridge[3635]: [4/18/2020, 11:00:55] ---
Apr 18 11:00:55 raspberrypi homebridge[3635]: [4/18/2020, 11:00:55] Loaded plugin: homebridge-tahoma
Apr 18 11:00:55 raspberrypi homebridge[3635]: homebridge-tahoma API version: 2.4
Apr 18 11:00:55 raspberrypi homebridge[3635]: [4/18/2020, 11:00:55] Registering platform 'homebridge-tahoma.Tahoma'
Apr 18 11:00:55 raspberrypi homebridge[3635]: [4/18/2020, 11:00:55] ---
Apr 18 11:00:55 raspberrypi homebridge[3635]: [4/18/2020, 11:00:55] Loading 5 platforms...
Apr 18 11:00:55 raspberrypi homebridge[3635]: [4/18/2020, 11:00:55] [Config] Initializing config platform...
Apr 18 11:00:55 raspberrypi homebridge[3635]: [4/18/2020, 11:00:55] [Config] Spawning homebridge-config-ui-x with PID 3750
Apr 18 11:00:55 raspberrypi homebridge[3635]: [4/18/2020, 11:00:55] [Shelly] Initializing Shelly platform...
Apr 18 11:00:55 raspberrypi homebridge[3635]: [4/18/2020, 11:00:55] [Hue] Initializing Hue platform...
Apr 18 11:00:55 raspberrypi homebridge[3635]: [4/18/2020, 11:00:55] [Hue] homebridge-hue v0.11.62, node v12.16.2, homebridge v0.4.53
Apr 18 11:00:55 raspberrypi homebridge[3635]: [4/18/2020, 11:00:55] [WeMo Platform] Initializing BelkinWeMo platform...
Apr 18 11:00:55 raspberrypi homebridge[3635]: [4/18/2020, 11:00:55] [ConnexoonBox] Initializing Tahoma platform...
Apr 18 11:00:55 raspberrypi homebridge[3635]: [4/18/2020, 11:00:55] [ConnexoonBox] Fetch accessories...
Apr 18 11:00:55 raspberrypi homebridge[3635]: [4/18/2020, 11:00:55] [ConnexoonBox] Login Connexoon server...
Apr 18 11:00:56 raspberrypi homebridge[3635]: [4/18/2020, 11:00:56] Loading 2 accessories...
Apr 18 11:00:56 raspberrypi homebridge[3635]: [4/18/2020, 11:00:56] [Temperatur Bad] Initializing Hygrotermograph accessory...
Apr 18 11:00:56 raspberrypi homebridge[3635]: [4/18/2020, 11:00:56] [Temperatur Schlafzimmer] Initializing Hygrotermograph accessory...
Apr 18 11:00:56 raspberrypi homebridge[3635]: [4/18/2020, 11:00:56] [Shelly] 2 accessories loaded from cache
Apr 18 11:00:56 raspberrypi homebridge[3635]: [4/18/2020, 11:00:56] [Shelly] Admin server is running on port 8181
Apr 18 11:00:56 raspberrypi homebridge[3635]: [4/18/2020, 11:00:56] [ConnexoonBox] Unable to refresh states (not logged in)
Apr 18 11:00:56 raspberrypi homebridge[3635]: [4/18/2020, 11:00:56] [WeMo Platform] Online: Treppe [EC1A59785720]
Apr 18 11:00:56 raspberrypi homebridge[3635]: [4/18/2020, 11:00:56] [WeMo Platform] Online: Ladeschale [B4750E73A434]
Apr 18 11:00:57 raspberrypi homebridge[3635]: [4/18/2020, 11:00:57] [ConnexoonBox] [Philips Hue Bridge] type: ProtocolGateway > HueBridge, protocol: hue
Apr 18 11:00:57 raspberrypi homebridge[3635]: [4/18/2020, 11:00:57] [ConnexoonBox] No definition found for ProtocolGateway > HueBridge in mapping.json file
Apr 18 11:00:57 raspberrypi homebridge[3635]: [4/18/2020, 11:00:57] [ConnexoonBox] [Mamas Leselampe] type: Light > DimmerHueSatOrCTLight, protocol: hue
Apr 18 11:00:57 raspberrypi homebridge[3635]: [4/18/2020, 11:00:57] [ConnexoonBox] Instanciate Mamas Leselampe as Lightbulb
Apr 18 11:00:57 raspberrypi homebridge[3635]: [4/18/2020, 11:00:57] [ConnexoonBox] [Box] type: Pod > Pod, protocol: internal
Apr 18 11:00:57 raspberrypi homebridge[3635]: [4/18/2020, 11:00:57] [ConnexoonBox] No definition found for Pod > Pod in mapping.json file
Apr 18 11:00:57 raspberrypi homebridge[3635]: [4/18/2020, 11:00:57] [ConnexoonBox] [SUNEA io] type: Awning > PositionableHorizontalAwning, protocol: io
Apr 18 11:00:57 raspberrypi homebridge[3635]: [4/18/2020, 11:00:57] [ConnexoonBox] Instanciate SUNEA io as WindowCovering
Apr 18 11:00:57 raspberrypi homebridge[3635]: [4/18/2020, 11:00:57] [ConnexoonBox] Initializing platform accessory 'SUNEA io'...
Apr 18 11:00:57 raspberrypi homebridge[3635]: [4/18/2020, 11:00:57] [ConnexoonBox] Initializing platform accessory 'Mamas Leselampe'...
Apr 18 11:00:57 raspberrypi homebridge[3635]: [4/18/2020, 11:00:57] [Hue] Raspbee1: dresden elektronik deCONZ gateway v2.5.67, api v1.16.0
Apr 18 11:00:57 raspberrypi homebridge[3635]: [4/18/2020, 11:00:57] [Hue] Raspbee1: warning: not using recommended deCONZ gateway version 2.5.75
Apr 18 11:00:57 raspberrypi homebridge[3635]: [4/18/2020, 11:00:57] [Hue] Daylight: set homekit light level from 0.0001 lux to 100000 lux
Apr 18 11:00:57 raspberrypi homebridge[3635]: [4/18/2020, 11:00:57] [Hue] Raspbee1: 21 accessories
Apr 18 11:00:57 raspberrypi homebridge[3635]: [4/18/2020, 11:00:57] [Hue] masked debug info dumped to /var/homebridge/homebridge-hue.json.gz
Apr 18 11:00:57 raspberrypi homebridge[3635]: [4/18/2020, 11:00:57] [Hue] Initializing platform accessory 'Raspbee1'...
Apr 18 11:00:57 raspberrypi homebridge[3635]: [4/18/2020, 11:00:57] [Hue] Raspbee1: 2 services

I see the part where it says it initialises them ( Apr 18 11:00:56 raspberrypi homebridge[3635]: [4/18/2020, 11:00:56] [Temperatur Bad] Initializing Hygrotermograph accessory... Apr 18 11:00:56 raspberrypi homebridge[3635]: [4/18/2020, 11:00:56] [Temperatur Schlafzimmer] Initializing Hygrotermograph accessory... ) but then nothing shows up and it looks like it does not connect. The setcap command is not working as well bc it has its permissions. It was working before but suddenly stopped working after an Update from Node 10.6 or smth to 12.16.2. We had to reinstall the Plugin bc it had an error with a binary which was built with the old version of Node. I have really no idea what could cause the problem. Homebridge Version is the latest 0.4.53 and running on an Rpi 3. Maybe you guys have an idea on this. Thanks in Advance of course

bottlebug commented 4 years ago

Update: I managed to get this running by downgrading to Node v12 and disconnected the sensor from my phone. I'm not sure which one exactly fixed it. Also, the ID on debug mode was coming out as Id: 8560476eadcd4c6c83f5c84c132d2a48 and using that in the config for address worked.

I've got the same issues running on OS X 10.15.4 with the Hygrothermograph 2

[4/28/2020, 1:12:07 PM] [Temperature & Humidity] Initializing Hygrotermograph accessory...
[4/28/2020, 1:12:07 PM] [Temperature & Humidity] ** Fakegato-storage AddWriter : Temperature & Humidity
[4/28/2020, 1:12:07 PM] [Temperature & Humidity] Loading...
[4/28/2020, 1:12:07 PM] [Temperature & Humidity] ** Fakegato-storage read FS file: /Users/michael/.homebridge/fakegato-history_EBE0CCB0-7A0A-4B0C-8A1A-6FF2997DA3A6.json
[4/28/2020, 1:12:07 PM] [Temperature & Humidity] ** Fakegato-timer Subscription : Temperature & Humidity
[4/28/2020, 1:12:07 PM] [Temperature & Humidity] Registring Events Temperature & Humidity
[4/28/2020, 1:12:07 PM] [Temperature & Humidity] Accessory Temperature & Humidity
[4/28/2020, 1:12:07 PM] [Temperature & Humidity] Initialized accessory
[4/28/2020, 1:12:07 PM] [Temperature & Humidity] Start scanning.
[4/28/2020, 1:12:07 PM] [Temperature & Humidity] Started scanning.

Additionally, the Model shows as LYWSDCGQ01ZM whereas it should be LYWSD03MMC.

Config is

        {
            "name": "Temperature & Humidity",
            "temperatureName": "Temperature",
            "address": "EBE0CCB0-7A0A-4B0C-8A1A-6FF2997DA3A6",
            "humidityName": "Humidity",
            "fakeGatoEnabled": true,
            "timeout": 15,
            "forceDiscovering": true,
            "forceDiscoveringDelay": 2500,
            "disableBatteryLevel": false,
            "lowBattery": 10,
            "temperatureOffset": 0,
            "humidityOffset": 0,
            "accessory": "Hygrotermograph",
            "bindKey": "2fcf4ebccee4ded0b61e899c9b27e1b8"
        }

I suspect it has to do something with Noble not running correctly as is requires xpc-connection which is having build issues.

hannseman commented 4 years ago

I just released a new version (3.0.1) with updates to the bluetooth library. Please give it a shot.

hannseman commented 4 years ago

Closing this issue due to no response.