oogje / homebridge-i6-bigAssFans

A Homebridge plugin which allows you to control a Big Ass Fan.
MIT License
18 stars 3 forks source link

Fans that are not yet online when the plugin starts are left in a weird state #35

Open knmorgan opened 5 months ago

knmorgan commented 5 months ago

Describe The Bug: Fans that are not immediately reachable when the plugin starts seem to remain stuck in Homebridge indefinitely. This was shortly after shutting off my house's main breaker, then turning it back on. The fans would have come online shortly after this, but were not online when the plugin first starts.

Strangely, no fan accessories are shown in the homebridge UI when it's in this state, but the fans are still in the home app with their previous settings. I can appear to alter fan state in the home app (adjust speed, light brightness) and these settings "stick" but do not actually update the fan.

Restarting homebridge fixes this issue.

To Reproduce: Shutoff main breaker, then turn back on. Some alternative would work, as long as Homebridge comes online before the fans do.

Expected behavior: The plugin is able to retry after a period and discover the fans once they're online. Similarly, if the fans are truly offline this should be reflected in the home app.

Logs:

[02/02/2024, 10:52:08] [BigAssFans-i6] Init - initializing devices
[02/02/2024, 10:52:08] [BigAssFans-i6] Restoring existing accessory from cache: X Room Fan
[02/02/2024, 10:52:08] [BigAssFans-i6] Restoring existing accessory from cache: Y Room Fan
[02/02/2024, 10:52:08] [BigAssFans-i6] Restoring existing accessory from cache: Z Room Fan
[02/02/2024, 10:52:08] Homebridge v1.7.0 (HAP v0.11.1) (Homebridge BEED) is running on port 51107.
[02/02/2024, 10:52:08] [BigAssFans-i6] X Room Fan (192.168.5.210) is unreachable [ENETUNREACH].  Check the correct IP is in json.config.
[02/02/2024, 10:52:08] [BigAssFans-i6] Y Room Fan (192.168.5.211) is unreachable [ENETUNREACH].  Check the correct IP is in json.config.
[02/02/2024, 10:52:08] [BigAssFans-i6] Z Room Fan (192.168.5.212) is unreachable [ENETUNREACH].  Check the correct IP is in json.config.

Plugin Config:

{
    "fans": [
        {
            "name": "X Room Fan",
            "ip": "192.168.5.210",
            "mac": "8c:4b:14:b7:13:fd",
            "fanModel": "Haiku H/I Series",
            "showWhooshSwitch": false,
            "showFanAutoSwitch": false,
            "showLightAutoSwitch": false,
            "showDimToWarmSwitch": false,
            "showEcoModeSwitch": false,
            "disableDirectionControl": true,
            "uplightEquipped": false
        },
        {
            "name": "Y Room Fan",
            "ip": "192.168.5.211",
            "mac": "8c:4b:14:53:ae:45",
            "fanModel": "Haiku L Series",
            "showWhooshSwitch": false,
            "showFanAutoSwitch": false,
            "showLightAutoSwitch": false,
            "showDimToWarmSwitch": false,
            "showEcoModeSwitch": false,
            "disableDirectionControl": true
        },
        {
            "name": "Z Room Fan",
            "ip": "192.168.5.212",
            "mac": "e8:31:cd:8b:14:ed",
            "fanModel": "Haiku H/I Series",
            "showWhooshSwitch": false,
            "showFanAutoSwitch": false,
            "showLightAutoSwitch": false,
            "showDimToWarmSwitch": false,
            "showEcoModeSwitch": false,
            "disableDirectionControl": true,
            "uplightEquipped": true,
            "downlightEquipped": false
        }
    ],
    "platform": "BigAssFans-i6"
}

Screenshots: N/A

Environment:

oogje commented 5 months ago

Hello. How many retries at what interval do you think would be good before a fan is thought to be truly offline in this case ?

knmorgan commented 5 months ago

My general expectation would be fans that are unreachable show as No Response in HomeKit. If the fan becomes reachable it should reflect in HomeKit. If a fan is in the homebridge plugin config it should be continually retried.

That is, I should be able to tell if something is wrong with the fan by observing its state in HomeKit, without having to look at homebridge logs. Attempting to update a seemingly-functioning fan with no response is a frustrating experience.