evgolsh / homebridge-crestron-home

Homebridge plugin for Crestron Home
Apache License 2.0
5 stars 2 forks source link

HomeKit says no response after power outage #3

Closed kinergy closed 6 months ago

kinergy commented 1 year ago

Describe The Bug: When my home loses power unexpectedly something gets messed up after bootup. All the lights in Apple's Home app lose connection and say "No Response". Restarting Homebridge or this Homebridge plugin doesn't help. The Homebridge plugin maintains connectivity to Crestron because I can turn lights on/off in the web UI. The only solution I have found is to remove the bridge from Apple Home and then rescan the QR code and add everything back in. Doing this for about 120 lights and scenes is really painful...

I also use another Homebridge plugin connecting Ubiquiti cameras, that plugin doesn't lose connectivity to Apple Home during an unexpected power cycle.

To Reproduce: Power cycle everything at once

Expected behavior: After an unexpected power cycle, I'd expect the lights to continue working in the Apple Home app.

Logs:

Show the Homebridge logs here, remove any sensitive information.

Plugin Config:

{
    "bridge": {
        "name": "Homebridge E5B2",
        "username": "<deleted>",
        "port": 51560,
        "pin": "<deleted>",
        "advertiser": "ciao"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "auth": "form",
            "theme": "auto",
            "tempUnits": "f",
            "lang": "auto",
            "platform": "config"
        },
        {
            "platform": "UniFi Protect",
            "_bridge": {
                "username": "<deleted>",
                "port": 34330
            },
            "controllers": [
                {
                    "address": "192.168.1.1",
                    "username": "<deleted>",
                    "password": "<deleted>"
                }
            ]
        },
        {
            "name": "Crestron Home Platform",
            "crestronHost": "192.168.1.196",
            "token": "<deleted>",
            "enabledTypes": [
                "Switch",
                "Dimmer",
                "Scene"
            ],
            "updateInterval": 30,
            "platform": "CrestronHomePlatform",
            "_bridge": {
                "username": "<deleted>",
                "port": 46599
            }
        }
    ],
    "disabledPlugins": []
}

Screenshots:

Environment:

evgolsh commented 1 year ago

Hello,

From time to time I experience the same behavior. I didn't find the root cause yet because it happens very rarely.

You don't need to remove the bridge, deleting cached accessories will help. In my case (running Homebridge on Raspbian):

Ssh to the Raspberry Pi cd /var/lib/homebridge/accessories/ sudo hb-service stop sudo rm cachedAccessories.[YOUR-BRIDGE] sudo hb-service start

The Homekit should work properly after this. I'll try to debug the issue since it happens not only to me.

kinergy commented 1 year ago

That worked, thanks! Would be amazing if there was a fix for this - I bought a battery backup to prevent the RPi from power cycling but the recent storms and power outages in CA drained that as well :)

evgolsh commented 1 year ago

Trying to debug it. Are you using Apple TV as a hub for the HomeKit?

kinergy commented 1 year ago

I have two Apple TVs and two HomePods. I've noticed that the hub tends to end up on a HomePod consistently with the other devices as backups.

evgolsh commented 1 year ago

Please try 1.1.5, I made a few fixes, see if it helps

evgolsh commented 6 months ago

fixed in 1.1.8