homebridge / homebridge

HomeKit support for the impatient.
https://homebridge.io
Apache License 2.0
24.04k stars 1.98k forks source link

Favorite and Room State won't stick #874

Closed maddox closed 6 years ago

maddox commented 8 years ago

Does anyone else have issues where a device will loose which room it's set to and also get marked as a favorite without you having marked it as such?

When this happens, I un-favorite it, or move it to the appropriate room, only to have it show back up in Default Room or be favorited again. It seems like some terrible sync bug, but I wanted to see if anyone else is having this issue.

I'm managing everything in the iOS 10 Home app.

KhaosT commented 8 years ago

Does the name of accessory also get reverted?

Sent from my iPhone

On Oct 26, 2016, at 9:17 AM, Jon Maddox notifications@github.com wrote:

Does anyone else have issues where a device will loose which room it's set to and also get marked as a favorite without you having marked it as such?

When this happens, I un-favorite it, or move it to the appropriate room, only to have it show back up in Default Room or be favorited again. It seems like some terrible sync bug, but I wanted to see if anyone else is having this issue.

I'm managing everything in the iOS 10 Home app.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

maddox commented 8 years ago

You mean if i change it manually IN the home app from what it was when it was created via the homebridge plugin?

I haven't tried that.

maddox commented 8 years ago

It doesn't look like it.

I edited the name in Home and it looks like it's both kept it's name and it hasn't gotten it's fav and room state reset.

KhaosT commented 8 years ago

Yeah, I mean rename in Home app and see if next time when fav state is gone, check and see if the name also get reverted. If the name also get reverted then it's a sync issue otherwise it might just be HomeKit dropping Home app's application data.

Apollon77 commented 8 years ago

I also have such an effect. I have some devices that loose it's room connection after some time (somtimes days, sometimes longer) and are then ion "standardroom" again.

Interestingly it are the same devices any time! All others stay as defined.

I can check the "favorite" thing, but not noted it so far.

NorthernMan54 commented 8 years ago

I was having the same issue for the last few weeks, but since roughly the weekend it has stopped. On a almost daily basis, I was having one or two devices move to the "Default Room". The devices that kept moving seemed to be the most recently added to the environment. I'm not 100% sure, as I keep tinkering, but they were definitely recent ones.

In my environment I have the following:

iPhone with IOS 10 and using Home and Eve app's iPad with IOS 9 and using the Eve app Apple TV4 On my network I'm running two separate instances of homebridge, and for plugins am running homebridge-heyu homebridge-suncalc homebridge-dht homebridge-mcuiot

( I'm the author of these plugins except suncalc, so far a while I thought it was problem with my own code, or the nodemcu devices I deployed. )

And for invited guests two iPhone's with IOS 10 and both the home app and Eve

For a while I thought it was an issue that only occurred when I used the iPad. But the last "change" I made was un-invite and re-invite one of my guests. I had looked at their phone, and found it was showing a bunch of duplicate accessories, so I removed their access then added again. Since then the problem seems to have stopped.

Hope this helps others

EMCSizl commented 8 years ago

All good here. I have 4 rooms with 5 devices & the bridge in the "default room"

iOS 10, with Apple TV 3 ( no automation) and homebridge running on docker.

Apollon77 commented 8 years ago

It all worked also on my side with only some devices ... but feeled >50 it got problems ... I have 64 or so at the moment

KhaosT commented 8 years ago

I mean when you change the name in Home app. If the name also get reverted then it's a sync issue otherwise it might just be HomeKit dropped Home app's application data.

Sent from my iPhone

On Oct 26, 2016, at 10:16 AM, Jon Maddox notifications@github.com wrote:

You mean if i change it manually IN the home app from what it was when it was created via the homebridge plugin?

I haven't tried that.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Apollon77 commented 8 years ago

I will test it now and give feedback in some days :-)

Apollon77 commented 8 years ago

Ok, it happened again. The Device moved back to the standard-room. The changed Name of the device is still changed, so not reset. And is still only affects some of the devices and not all.

joergs-git commented 8 years ago

I am currently running more than 90 devices administrated via zwave.me and bridged to homekit via homebridge. No such effects at all. But I must say, I am using the original homekit-App from apple just for minor things (e.g. Favorite screen). For all the assignments and associations between rooms and devices I am using Eve as it much more comfortable to deal with. Maybe that's the major difference?

Apollon77 commented 8 years ago

I also normally use Eve, but I also tested with the Home App from Apple. When it is moved back then for all - ans also on other devices with the same Apple Account on it

joergs-git commented 8 years ago

Well, of course it's the same, because both apps are simply accessing the same/identical apple-homekit-database behind. But I could imagine, that the Apple-Homekit-App (which is just another frontend as eve) is messing up things. Which also affects what eve can show of course. So I'd suggest to try to only use eve to assign rooms/devices etc. and check if the Apple-App is causing all this.

P.S. I already had the feeling in the past, that the Apple Homekit-App is kind of "slow" before things become active. My impression is that's not the case when doing the same with the eve app....

Apollon77 commented 8 years ago

I had that room-moving effect also with ios 9 ... so Home app can not be the reason from my feeling/opinion

joergs-git commented 8 years ago

Well why not? Homeapp existed also already with IOS9, correct? But however, doesn't seem to be a generic problem, as I don't have such "effects" at all....

Apollon77 commented 8 years ago

Home App was officially introduced in ios 10

rehafer commented 8 years ago

Could it be that devices are 'dropping out' of Homebridge and when it's re-acquired it's added as new? Just a thought.

NorthernMan54 commented 8 years ago

Well I spoke too soon with my setup. Over the weekend I had 2 devices move back to the default room ;-).

snowdd1 commented 8 years ago

@Rehafer if that would be the case there names would be reset as well.

jsg4 commented 8 years ago

Seeing this whenever homebridge is rebooted.

Apollon77 commented 8 years ago

I also see it without an homebridge restart ...

jsg4 commented 8 years ago

Possibly to do with iOS 10.1/10.2 beta? I believe that's around when I noticed it. Anyone else?

jsg4 commented 7 years ago

Anyone still seeing this? Restarted and favorite/room location didn't stick again.

Apollon77 commented 7 years ago

I still have this problem

merlinmah commented 7 years ago

I saw this issue after adding a new (Z-wave) accessory: the newcomer would revert to Default Room within a minute or two of being assigned to another room. The accessory name would usually revert at the same time as the location, although this seemed sporadic--at least one name change was preserved through a few room reverts and became the new name that subsequent changes would be reverted to. I finally made the accessory's room assignment stick by removing and re-adding the Homebridge accessory and thus setting up all accessories in HomeKit from scratch, although this workaround is obviously not ideal.

Setup: iOS 10.1.1 on all clients, management done via Apple Home app and Elgato Eve, HomeKit access family-shared among two Apple IDs, one each of Apple TV gen 4 and iPad as hubs (tested the reverting bug to occur with either hub independently), and Homebridge on FreeBSD 11.

lukescott commented 7 years ago

It happens to me when I reboot homebridge. I'm using the homebridge-homeseer plugin. Happens every time I change the config. I am using uuid_base. Also on iOS 10.1.1.

jsg4 commented 7 years ago

Same thing, any way to fix this so rooms stick on reboot?

maddox commented 7 years ago

I'm still seeing this. I just added a bunch of accessories and I can't configure them at all.

Is this even a homebridge thing, or is it a HomeKit thing?

snowdd1 commented 7 years ago

Seems to be somewhat plugin dependent because I am not experiencing that at all. Using (hw) iPad Air (central), iPhone 7, iPhone 6s & iPad Air 2 (as guests, my wife's iCloud account), and (sw) homebridge on a raspberry with homebridge-knx only. Usually runs without restarting for several months on production environment.

lukescott commented 7 years ago

On the homebridge-homeseer plugin you have to configure each device manually. I am including a uuid_base on each device. I randomly generated each of them (once) in Atom using a plugin. I'm wondering if somehow Homekit is seeing each device as a new device somehow and the statically defined uuid is not sticking.

kabadabra commented 7 years ago

Possible to add the devices manually to the accessories{} parameter in config.json? Just had the same issue now where I restarted homebridge and all devices were moved to default room again. Hoping that possibly adding these manually might resolve the issue temporarily.

DJay-X commented 7 years ago

First of all sorry for maybe a stupid question. I'm more a user than a professional but I would like to bringt this to somebody's attention. I noticed since a couple of weeks that my harmony hub devices like Live TV, Apple TV, Fire TV ... automatically move to the HomeKit default room (Standardraum). I move them back to living room (Wohnzimmer) but when I check back the other day they are again in the default room. Also they are removed from scenes. I'm on iOS 10.2 (14C90) and the Harmony Hub is on 4.12.36. The homebridge-harmonyhub is on the latest version also as hombridge itself on my Raspberry Pi2 Just want to let you know so it seems some more people running into something like this.

lukescott commented 7 years ago

I think the issue is if HomeKit sees the bridge device has 0 accessories, it deletes all your devices. Then when it comes back with the devices, HomeKit sees all of them as new devices, which resets everything.

I had an issue where homebridge was starting up before homeseer, and then it reported to homebridge 0 devices. Restarting homebridge manually brought the devices back, but they were all in the default room.

With homebridge-homeseer, I forked it and modified it to retry the http request if it gets a connection error. It won't report back to homebridge until it has retried the http request a few times with a delay. My rooms seem to be sticking now.

Fork here for that here: https://github.com/lukescott/homebridge-homeseer (Install with npm install git+https://git@github.com/lukescott/homebridge-homeseer.git -g)

You can probably accomplish the same thing by delaying homebridge startup by a few seconds. Although it depends on how long it takes each device to be ready, which can be variable. Which is why I added a retry thing to the plugin I use.

Is it possible other plugins are suffering the same problem? What does the homebridge log look like?

Apollon77 commented 7 years ago

The problem is that only some (and then always the same!) devices move to the default room ... not all!

lukescott commented 7 years ago

In that case it sounds like Homebridge is not reporting some of the devices. HomeKit assumes if the bridge is available all devcices should be. So when some devices don't show up HomeKit deletes them. When they show up again they get added as new devices.

It's possible in earlier versions of HomeKit it didn't delete the devices from its own internal list.

The solution is to prevent Homebridge from advertising an incomplete device list. If the bridge itself is inaccessible (offline) and then comes back with all devices the rooms stick. If at any point HomeKit can get to the bridge but there are fewer devices than before HomeKit deletes them.

That's my observation so far. Hopefully it holds. Don't have anything else to offer :)

SpeedmaxX commented 7 years ago

Hi, Luke's description seems possible to me. Would adding accessoires to config.json perhaps help here?

snowdd1 commented 7 years ago

Sounds to me as if lukescott is right. If you use platforms that do not yet use the dynamic style but discover devices dynamically they are missing intermediately. That was exactly the reason why the new API approach caches all devices so the platforms can set them to reachable or unreachable but not delete them before being sure they won't come back.

DJay-X commented 7 years ago

Just to inform I noticed after two weeks of testing, that the room state won't stick even when not using the Apple Home App. I only use Eve App moved my "Harmony Hub" Devices to "Wohnzimmer". Even with reboot the Raspberry every hour the Devices ARE available in the Wohnzimmer every time. But out of the blue they move back to default room after a few days with no reason.

snowdd1 commented 7 years ago

@DJay1 Harmony hub is known to fail from time to time, so it very likely that it had an action removed or something similar at the time that Homekit asks for it (doesn't have to be apples home app, can be completely be triggered in the background/iCloud service or by any other Homekit app).

I had never such an issue, and my homebridge runs perfectly stable (no reboots unless forced to for updates), as you can see from the uptime report

pi@knxd2-raspberry:~ $ sudo systemctl status homebridge
● homebridge.service - Homebridge Automation Service
   Loaded: loaded (/etc/systemd/system/homebridge.service; enabled)
   Active: active (running) since Fr 2016-11-11 10:28:13 CET; 2 months 4 days ago
     Docs: https://github.com/nfarina/homebridge
 Main PID: 25895 (homebridge)
   CGroup: /system.slice/homebridge.service
           └─25895 homebridge

So it not an issue of homebridge or hap-nodejs, but of the plugins that

So have a look at your plugins, and for those accessories that move into default room contact the plugin author to implement the "new" API (it's about a year old, now) and make their platforms "dynamic". KhaosT is already thinking of making this mandatory, see #1039 (initial issue text)

SpeedmaxX commented 7 years ago

In my case it fails when plugging off the power supply and not shutting down correctly. HTH

WinceWe commented 7 years ago

Hi,

I´m having this issue since the beginning (Dec16). On different devices, with different plugins, behaving differently. On the one device (iPhone 6) I can choose the rooms, it stays about 5-10 sec and then switches back. On the iPad (which is set as control center) I cant even choose a room different than "Standard". In detail, on my devices it is like this (in order of plugin installation): homebridge-hue plugin: no problems at all, all settings are stored homebridge-http plugin: worked at the beginning, doesn´t store rooms and favs anymore now (after homematic plugin was installed?) homebridge-homematic plugin: does not store rooms or names, can set favorites. homebridge-humidity-file plugin: works fine

I first had problems with "homebridge-hue", more or less the same problem i have now. It was a problem of iCloud and it was solved by turning off iCloud for Home on every device, except the control center iPad, set the rooms and names on it and bring back all other devices to iCloud again. This does not work for all the other plugins.

WinceWe commented 7 years ago

Ok it´s weird but as a deed of desperation ;) I just shut down the iPad (my control center) and rebooted it, which seems to have solved all the problems described :o I can set all the names, rooms, favorites and scenes on the iPad as it should be. Also for the homematic devices, which haven´t worked since the beginning. The settings stay for almost 2 days now. Maybe some of you can try it with rebooting the control center...

blalor commented 7 years ago

So far I'm having this problem with homebridge-suncalc, homebridge-people, and homebridge-wunderground, but not homebridge-hs100 or homebridge-statefuldummy. My dependencies look like:

  "dependencies": {
    "homebridge": "^0.4.17",
    "homebridge-hs100": "^2.0.0",
    "homebridge-suncalc": "^0.0.1",
    "homebridge-people": "^0.5.0",
    "homebridge-wunderground": "^0.0.5",
    "homebridge-statefuldummy": "^0.0.1"
  },

[edit] the problem persists with 0.4.19.

naofireblade commented 7 years ago

I can confirm that this is an iOS 9 sync issue. After i disabled Homekit -> Use iCloud in settings on the only iOS 9 device in my home, I have no more room state issues even after a lot of homebridge restarts.

Furthermore this cannot be plugin related, because i use the plugin "homebridge-delay-switch" and my 2 old switches there are working fine, while 2 later added switches had the sync issues.

blalor commented 7 years ago

I don't have any iOS 9 devices.

imperialjoy commented 7 years ago

I see this problem with wireless-sensor-tag plugin, and no others. Very strange.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity, and will be closed if no further activity occurs. If this issue was overlooked, forgotten, or should remain open for any other reason, please reply here to call attention to it and remove the stale status. Thank you for your contributions.

mikebronner commented 6 years ago

I'm experiencing this issue when restarting the homebridge service: all device names and rooms are reset to default. Reading through the entire thread up-top didn't provide any solutions. Has anyone been able to work around this?

matteos1 commented 6 years ago

same problem