Maxmudjon / homebridge-mijia

Mijia plugin for homebridge
50 stars 7 forks source link

Sensors Named in Home App revert to default names and rooms #22

Open magichew opened 7 years ago

magichew commented 7 years ago

On two occasions I have have named the sensors in the Home app and assigned them to rooms and they have revered to the default room and their default names.

Latest version of Homebridge, I also have Mi-Light Plugin. Had Aqara plugin but uninstalled to get this working.

harmjanr commented 7 years ago

Same issue here.

magichew commented 7 years ago

I haven't been able to do any testing to see what causes this whether it be loss of network connection or rebooting Homebridge. I will look to do so shortly and hopefully this info will help more enlightened than I to track down and fix this.

timh1004 commented 7 years ago

I made a pull request with some bugfixing. You can try it out by installing my fork of this plugin via sudo npm install -g timh1004/homebridge-mijia. It works very well for me since a few days. The Wireless Button and the Light Switches only work reliable with the latest HAP-NodeJS version, otherwise it won't recognize if you press the same button multiple times in a row. It comes with the latest homebridge version, so update homebridge via npm.

harmjanr commented 7 years ago

Tnx @timh1004! Installed it just now, will let you know if it works within a couple of days!

harmjanr commented 7 years ago

@timh1004 Have it installed for a couple of days now. The names and rooms are still okay, but the Homebridge hub in homekit is very unreliable - can't reach my accessoires 9 out of 10 times. Did you encounter this as well?

EDIT: After checking the homebridge log, it is getting in a failure state all the time:

Cannot add a bridged Accessory with the same UUID as another bridged

I already tried to remove the cachedAccessoires dir..

UPDATE: After removing both the persist and cachedAccessoires folders, removing the homebridge from the home app and re-adding it, all the sensors are working. Weird thing is that it doesn't use the names from the config file anymore, but english sensor names (no idea where it get's those from). My experience is that some sensors are still being reset after a night (1 doorsensor, humidity sensor, occupancy sensor): both name, room and accessoire settings are back to default.

magichew commented 7 years ago

I've just done a fresh re-image and set up of Homebridge on my Raspberry Pi and gone through and configured the plugins.

None of my Mi devices showed in the Home app to begin with but then when I walked by a sensor it popped in and so all devices needed to have some event triggered for them to show in the Home app.

I wondering if this is part of the problem where if a device doesn't send signals via home bridge for X amount of time then homebridge forgets them until they are send a signal and are added again but with default values.

Interestingly I have 2 motion sensors, 2 door contact sensor and a button. I was able to edit all of them in home app (renaming and setting room etc) apart from one contact sensor. I get the message...

"Could not edit accessory" "The accessory is blocked"

And I have to reset the name back to the default to be able to back out of the setting screen.