nicoduj / homebridge-harmony

Harmony websocket plugin for homebridge
The Unlicense
215 stars 23 forks source link

[BUG] All Homebridge accessories disappear form Homekit after 30seconds #280

Closed vincentanthony closed 3 years ago

vincentanthony commented 4 years ago

30 seconds after homebridge restart, all accessories on home bridge disappear from HomeKit. Narrowed it down to harmony plugin. Not seeing any errors in the logs. Tried reinstalling everything, still no fix

vincentanthony commented 4 years ago

Seeing this in debug mode:

[6/7/2020, 11:04:31] [Harmony Hub] (Harmony Hub)INFO - refreshCurrentActivity : Refresh needed since last update is too old or current Activity is not set : -1 [6/7/2020, 11:04:31] [Harmony Hub] (Harmony Hub)keysMap is :{"0":"{\"command\":\"Rewind\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","1":"{\"command\":\"FastForward\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","2":"{\"command\":\"Next\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","3":"{\"command\":\"Prev\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","4":"{\"command\":\"DirectionUp\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","5":"{\"command\":\"DirectionDown\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","6":"{\"command\":\"DirectionLeft\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","7":"{\"command\":\"DirectionRight\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","8":"{\"command\":\"Select\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","9":"{\"command\":\"Return\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","10":"{\"command\":\"Home\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","11":"{\"command\":\"Play\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","15":"{\"command\":\"TopMenu\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1"}

[6/7/2020, 11:04:43] [Harmony Hub] (Harmony Hub)INFO - GET Characteristic.Active [6/7/2020, 11:04:43] [Harmony Hub] (Harmony Hub)INFO - refreshCurrentActivity : Refresh needed since last update is too old or current Activity is not set : 16571369 [6/7/2020, 11:04:43] [Harmony Hub] (Harmony Hub)INFO - GET Characteristic.ActiveIdentifier [6/7/2020, 11:04:43] [Harmony Hub] (Harmony Hub)INFO - refreshCurrentActivity : Refresh needed since last update is too old or current Activity is not set : 16571369 [6/7/2020, 11:04:43] [Harmony Hub] (Harmony Hub)INFO - refreshCurrentActivity : Cancelling refresh since a refresh is allready in progress 16571369 [6/7/2020, 11:04:43] [Harmony Hub] (Harmony Hub)INFO - refreshCharacteristic : updating Characteristic.ActiveIdentifier to 16571369 [6/7/2020, 11:04:43] [Harmony Hub] (Harmony Hub)INFO - GET Characteristic.CurrentVisibilityState : DEFAULT - 0 [6/7/2020, 11:04:43] [Harmony Hub] (Harmony Hub)INFO - GET Characteristic.CurrentVisibilityState : DEFAULT - 0 [6/7/2020, 11:04:43] [Harmony Hub] (Harmony Hub)INFO - GET Characteristic.CurrentVisibilityState : DEFAULT - 0 [6/7/2020, 11:04:43] [Harmony Hub] (Harmony Hub)INFO - GET Characteristic.CurrentVisibilityState : DEFAULT - 0 [6/7/2020, 11:04:43] [Harmony Hub] (Harmony Hub)keysMap is :{"0":"{\"command\":\"Rewind\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","1":"{\"command\":\"FastForward\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","2":"{\"command\":\"Next\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","3":"{\"command\":\"Prev\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","4":"{\"command\":\"DirectionUp\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","5":"{\"command\":\"DirectionDown\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","6":"{\"command\":\"DirectionLeft\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","7":"{\"command\":\"DirectionRight\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","8":"{\"command\":\"Select\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","9":"{\"command\":\"Return\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","10":"{\"command\":\"Home\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","11":"{\"command\":\"Play\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1","15":"{\"command\":\"TopMenu\",\"type\":\"IRCommand\",\"deviceId\":\"30808578\"}|1"} [6/7/2020, 11:04:43] [Harmony Hub] (Harmony Hub)INFO - refreshCharacteristic : updating Characteristic.Active to true

nicoduj commented 4 years ago

Hi, can you share your config and environment ? What do you mean by all accessories ? In no way this plugin can interfere with devices it does not expose itself

vincentanthony commented 4 years ago
Timezone GMT-0700

Raspbian GNU/Linux Buster (10) homebridge 192.168.7.199 fe80::c1c8:32dd:f3cc:3841 v12.17.0 v6.14.5 pi /var/lib/homebridge /var/lib/homebridge/config.json Yes

Any other info?

As an example, I have the nest and nest cam plugins installed. When harmony is uninstalled, those plugins work fine. As soon as I install Harmony, everything shows up fine for 30 seconds, then everything disappears from the home app

nicoduj commented 4 years ago

Are you using regular homebridge ? What is your config.json file ?

vincentanthony commented 4 years ago

{ "bridge": { "name": "Homebridge 17B1", "username": "0E:7C:7F:6E:17:B1", "port": HIDDEN, "pin": "HIDDEN" }, "accessories": [], "platforms": [ { "name": "Config", "port": HIDDEN, "auth": "form", "theme": "auto", "tempUnits": "f", "lang": "auto", "platform": "config" }, { "name": "Nest", "googleAuth": { "issueToken": HIDDEN, "cookies": HIDDEN, "apiKey": HIDDEN }, "platform": "Nest" }, { "googleAuth": { "issueToken": HIDDEN, "cookies": HIDDEN, "apiKey": HIDDEN }, "ffmpegCodec": "libx264", "options": { "alertCheckRate": 10, "alertCooldownRate": 180, "motionDetection": true, "streamingSwitch": true, "doorbellAlerts": true, "doorbellSwitch": true, "disableAudio": false }, "platform": "Nest-cam" }, { "name": "Harmony Hub", "hubIP": "192.168.7.77", "hubName": "Harmony Hub", "platform": "HarmonyHubWebSocket" } ] }

nicoduj commented 4 years ago

when you say disapeear, they are no more there ? DO you see harmony exposed activities at all ? Do you have any devices on an old ios version that could cause some Icloud sync issues ?

vincentanthony commented 4 years ago

They aren't there anymore. I don't see them anywhere in the Home App. Don't know if there's any old devices causing issues, but again, everything with home bridge seems to work fine when I uninstall Harmony.

nicoduj commented 4 years ago

i would need the full log while in debug mode when it happens, and check if it is on all your ios device or only one. Please also check if you have any old device (priori to ios 10) on your icloud account with home syn enabled. But once again, if oher devices disappears than the one exposed form harmony, it seems very strange ... Such kind of issue was never reported ...

nicoduj commented 4 years ago

And by the way, is it a standard homebridge or hoobs install ?

vincentanthony commented 4 years ago

I believe it's just the standard

vincentanthony commented 4 years ago

Also had one device on iOS connected to iCloud / Homekit, so took it off.

vincentanthony commented 4 years ago

Removed the iOS device, still been having the same problem since yesterday. Have removed all plugins to make sure there's nothing else causing the issue.

nicoduj commented 4 years ago

Hi, I am sorry but I don’t know what to do with this . Are they still visible in homebridge itself (config ui ?) did you try eve app ? It could be some cache messed up issue but you would see in your log some removers accessory , still you can try deleting the cached accessory folder .

vincentanthony commented 4 years ago

They are still visible in Homebridge and turn on / off. I've deleted cached accessories multiple times. Anything else I can try? definitely something specific with the Harmony plugin.

nicoduj commented 4 years ago

reboot your phone ? Do you have multiple ios device in your home ? Or maybe you have some problem with permission, what are the settings of your home app concerning access autorization (everyone, users of the same network, users of the same home, any code ? )

vincentanthony commented 4 years ago

only 2 iPhones in the house, both with full permissions. Two Apple TVs and 3 HomePods that are hubs.

nicoduj commented 4 years ago

and both iphones have the same behavior ? one thing however in your config : remove hubName if you have hubIP set (and fixed on your network)

vincentanthony commented 4 years ago

same behavior on all of our devices. Even computers with home app. Will try the removing hub name

nicoduj commented 4 years ago

and I'd like to know the version of your homebridge / Hap by the way.

vincentanthony commented 4 years ago

1.1.1. Same behavior after removing the name

nicoduj commented 4 years ago

last thing you can do is to launch homebridge on full log (DEBUG=*) and check events when it disappears but like I said first time I hear of such issue.

nicoduj commented 4 years ago

1.1.1 ? It is not released, only 1.1.0 . You checked that it is not back in another room / default room ? Do you have any file named harmony* in the root dir of your homebridge ? If yes you can try to delete them. Also, you did not make multiple trials and error on the same install with config change like publishAsExternalAccessory ?

vincentanthony commented 4 years ago

Sorry. 1.1.0. Attached a log.

I've tried a number of different settings with the config, still the same thing. Haven't checked for any files in the toor directory. Not in another room either.

testlog copy.docx

vincentanthony commented 4 years ago

No harmony file in the root dir

nicoduj commented 4 years ago

Everything seems fine in your homebridge log as far as I can tell . You could try to stop homebridge (first), modify your config to add cleanCache to true, start again. (if it works, set the option back to false, without stopping homebridge) If that doe not work, stop again, and set publishAllTVAsExternalAccessory to true, and launch . Then, in home app, add a new device, by code, and enter the code that was in homebridge log.

You can also try to not publish a tv at first, but only switches (see corresponding options)

vincentanthony commented 4 years ago

Not publishing as a TV and just publishing as an external accessory did it. It seems to be working now. Wonder why that would be the issue. It was working like that before for about a month or so.

nicoduj commented 4 years ago

I don't understand what you did. If you don't publish as tV it will not publish anything at all if you don't expose siwtches. Do you have a Tv accessory or not ? If you publish As external accessory, you have to add it manually after.

I think you have messed up your cache at some point, but I don't know in what state is your config.

vincentanthony commented 4 years ago

I switched off TV Accessory and switched on Switches Accessory in HomeKit. On restart it published one switch with my activity options as different switches inside of it. Didn't need to add anything manually.

nicoduj commented 4 years ago

Config and screenshot in home app, not sure I understood what you said . because if I understand you don’t have any tv accessory anymore but only one switch per activity

vincentanthony commented 4 years ago
Screen Shot 2020-06-08 at 10 51 43 AM Screen Shot 2020-06-08 at 10 52 31 AM
nicoduj commented 4 years ago

ok, and if you try to add the option to publish a tv accessory, does it shows up and stay (don't remove switch, you can have both)

vincentanthony commented 4 years ago

Did what you suggested and it disappeared again

nicoduj commented 4 years ago

when it "appears", where does it appear ? in which room ?

vincentanthony commented 4 years ago

Default Room. I'm looking in the home section, see it show up, then disappear. Attached a screen capture of what happens. Just hitting restart on home bridge, not doing anything else. Screen Recording 2020-06-08 at 11.47.17 AM.zip

vincentanthony commented 4 years ago

So, been testing this all morning. Disabled the TV Accessory and went back to the switch. Reinstalled my Nest plugins, everything is working as expected. There's clearly something up with the TV Accessory option, or at the least, the way it's interacting with my HomeKit. Not sure if you have any other suggestions, or if I should just stick with the switch options.

jlg89 commented 4 years ago

Same issue here, except it didn’t affect other homebridge accessories, only the Harmony accessories would disappear from the Home screen after ~30s. Disabling “TV accessory in homekit” and enabling “Publish all TV as external accessory” seems to be a workaround.

{ "platform": "HarmonyHubWebSocket", "plugin_map": { "plugin_name": "homebridge-harmony" }, "name": "Harmony Hub", "hubIP": "192.168.77.9", "hubName": "Harmony Hub", "publishAllTVAsExternalAccessory": true, "TVAccessory": false, "mainActivity": "Watch Apple TV", "switchAccessories": true, "publishGeneralMuteSwitch": true, "publishGeneralVolumeSlider": true, "linkVolumeControlToTV": true, "publishSwitchActivitiesAsIndividualAccessories": true, "publishDevicesAsIndividualAccessories": true, "publishSequencesAsIndividualAccessories": true, "publishHomeControlsAsIndividualAccessories": true, "showCommandsAtStartup": false, "addAllActivitiesToSkippedIfSameStateActivitiesList": false, "playPauseBehavior": false, "cleanCache": false, "activitiesToPublishAsInputForTVMode": [], "remoteOverrideCommandsList": [], "activitiesToPublishAsAccessoriesSwitch": [], "skippedIfSameStateActivities": [], "devicesToPublishAsAccessoriesSwitch": [], "sequencesToPublishAsAccessoriesSwitch": [], "homeControlsToPublishAsAccessoriesSwitch": [], "otherPlatforms": [] }

beckern commented 4 years ago

Hello, i think, i have the same issue. After installing the plugin all harmony and homematic devices disappear after a few seconds in my homekit. Sometimes the devices appear after reconnect wlan. In homebridge-config-ui-x v all devices are to controlable. In the log file are no obviously mistkake. Now i unistall this plugin (and install harmony plugin from @kraigm) and everythink is fine. It is very bad because this plugin is more versatile and offers more functions. I would be happy if the error can be fixed. Please contact me for further questions.

beckern commented 4 years ago

PS: Maybe nice to know, only the Xiaomi roborock appear in HomeKit. It is configured as Accessoires in config.json, all other devices are configured in platforms.

nicoduj commented 4 years ago

Sorry to hear that it is spreading. I don’t have the issue and using a lot of accessories so I can’t figure out what is happening. Could you try downgrading the plugin maybe to the one that was not causing the issue ? Are you all on external accessory mode or bridge mode ? All platform accessories are affected ? Is it an upgrade of harmony or an upgrade of homebridge that made it happen ? Is it happening on a fresh install ?

beckern commented 4 years ago

I don't use your plugin before, so I can't say it is caused by an upgrade/downgrade.

nicoduj commented 4 years ago

@beckern can you share your config please ?

nicoduj commented 4 years ago

@all Try latest version, I removed AccessControl on TV accessories to see if it helps, not sur however ...

And for those who have an old IOS Device (IOS 10 or prior) in your home, please try to remove it from homekit (disable homekit on that device through settings) . Since TV Accessory was not available, it seems to mess things up.

beckern commented 4 years ago

Hello,

sorry, it doesn`t work. I installed the latest version. Still only the accessory XiamoiRoborock is in homekit. Other accessories disappaer.

This is my config.json

{

"bridge": {

    "name": "Homebridge",

    "username": "CC:22:3D:E3:CE:30",

    "port": 51826,

    "pin": "031-45-154"

},

"accessories": [

    {

        "name": "Staubi",

        "ip": "192.168.178.63",

        "token": "72347636414c554149367545424f437a",

        "waterBox": true,

        "pause": true,

        "dock": true,

        "delay": false,

        "cleanword": "clean",

        "autoroom": true,

        "rooms": [

            {

                "name": "Wohnzimmer",

                "id": 1

            },

            {

                "name": "Küche",

                "id": 2

            },

            {

                "name": "Bad",

                "id": 3

            },

            {

                "name": "Flur",

                "id": 4

            },

            {

                "name": "Büro",

                "id": 5

            }

        ],

        "accessory": "XiaomiRoborockVacuum"

    }

],

"platforms": [

    {

        "name": "HomeMatic CCU",

        "ccu_ip": "192.168.178.32",

        "subsection": "Siri",

        "ios10": true,

        "windows": [

            "BidCos-RF.MEQ0332793:1",

            "BidCos-RF.MEQ0332995:1",

            "BidCos-RF.NEQ0049735:1",

            "BidCos-RF.NEQ0050591:1",

            "BidCos-RF.NEQ0081450:1",

            "BidCos-RF.OEQ0541692:1",

            "BidCos-RF.OEQ0891151:1",

            "BidCos-RF.OEQ0984465:1"

        ],

        "programs": [

            "Homebridge Subwoofer an",

            "Homebridge Subwoofer aus",

            "Harmony Jalousie hoch",

            "Harmony Jalousie runter",

            "Das Haus verlassen",

            "Gute Nacht",

            "Homebridge Licht an",

            "Homebridge Licht aus",

            "Homebridge Licht TV",

            "Homebridge Licht TV aus"

        ],

        "platform": "HomeMatic"

    },

    {

        "name": "Config",

        "port": 8080,

        "auth": "none",

        "theme": "auto",

        "tempUnits": "c",

        "lang": "de",

        "sudo": true,

        "standalone": true,

        "log": {

            "method": "systemd",

            "path": "/var/log/homebridge.log"

        },

        "platform": "config"

    },

    {

        "name": "Harmony",

        "hubIP": "192.168.178.21",

        "hubName": "Wohn",

        "TVAccessory": true,

        "mainActivity": "Fernsehen",

        "switchAccessories": true,

        "publishGeneralMuteSwitch": true,

        "publishGeneralVolumeSlider": true,

        "platform": "HarmonyHubWebSocket"

    }

],

"id": "config"

}

Von: Nicolas Dujardin [mailto:notifications@github.com] Gesendet: Sonntag, 5. Juli 2020 18:39 An: nicoduj/homebridge-harmony Cc: beckern; Mention Betreff: Re: [nicoduj/homebridge-harmony] [BUG] All Homebridge accessories disappear form Homekit after 30seconds (#280)

@ALL https://github.com/ALL Try latest version, I removed AccessControl on TV accessories to see if it helps, not sur however ...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nicoduj/homebridge-harmony/issues/280#issuecomment-653910280 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AP4UYP5HVSMIJQ5YND76XWLR2CUDPANCNFSM4NXPLONQ .Das Bild wurde vom Absender entfernt.

nicoduj commented 4 years ago

@beckern which version your iOS device are on ? iOS 11 at least ?

beckern commented 4 years ago

Version 13.5.1

Am 05.07.2020 um 21:19 schrieb Nicolas Dujardin notifications@github.com:

 @beckern which erosion your iOS device are on ? iOS 11 at least ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

nicoduj commented 4 years ago

Version 13.5.1

Am 05.07.2020 um 21:19 schrieb Nicolas Dujardin notifications@github.com:

 @beckern which erosion your iOS device are on ? iOS 11 at least ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Ok, but do you have any device in your home on iOS 10 or lower ? I saw on one of your config that you set ios10 mode for a plugin

beckern commented 4 years ago

No, there is no device with ios 10 or lower.

https://github.com/thkl/homebridge-homematic#programs

Von: Nicolas Dujardin [mailto:notifications@github.com] Gesendet: Sonntag, 5. Juli 2020 22:14 An: nicoduj/homebridge-harmony Cc: beckern; Mention Betreff: Re: [nicoduj/homebridge-harmony] [BUG] All Homebridge accessories disappear form Homekit after 30seconds (#280)

Version 13.5.1

Am 05.07.2020 um 21:19 schrieb Nicolas Dujardin notifications@github.com:

 @beckern https://github.com/beckern which erosion your iOS device are on ? iOS 11 at least ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Ok, but do you have any device in your home on iOS 10 or lower ? I saw on one of your config that you set ios10 mode for a plugin

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nicoduj/homebridge-harmony/issues/280#issuecomment-653933735 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AP4UYP464SZKZI4RKRUPNOTR2DNITANCNFSM4NXPLONQ .Das Bild wurde vom Absender entfernt.

beckern commented 4 years ago

Today I have had unistall all plugins and install the harmony plugin first. With enableing "TV Accessory in homekit" the accessory disappear after 30 seconds. No other plugin was installed. With disableing "TV Accessory in homekit" and enableing "Switch accessory in homkit" the switches don't disappear. Now I have installed the other plugins and all accessorys (homematic/harmony/Roborock) no more disappear. harmony

nicoduj commented 4 years ago

Hi all, I am curious about this one, Is it still occuring for some of you ? (with Tv accessories) ?

beckern commented 4 years ago

It only works with this configuration:

https://github.com/nicoduj/homebridge-harmony/issues/280#issuecomment-640780107