haywirecoder / homebridge-flobymoen

Homebridge Module for Flo by Moen Smart Water System
MIT License
14 stars 2 forks source link

Device Discovery Unsuccessful Error #11

Closed mikecwwells closed 4 months ago

mikecwwells commented 11 months ago

Describe Your Problem:

Every couple of days at least, the following error will appear in the Homebridge console: [Flo-by-Moen] Device Discovery Unsuccessful Error: getaddrinfo EAI_AGAIN api-gw.meetflo.com. Please check configuration and restart the plug-in After this point, the temperature and humidity values in the Home app will stop updating. Restarting Homebridge usually the problem until the next time the error appears. However, sometimes the error immediately reoccurs after a restart, requiring two in a row (as seen in the below example). I tried a huge variety of config settings for the plugin (hence the config below maybe appearing weird) but none seemed to resolve the issue.

Logs:

[9/26/2023, 2:37:20 AM] [HB Supervisor] Started Homebridge v1.6.1 with PID: 1484660
[9/26/2023, 2:37:20 AM] Loaded config.json with 0 accessories and 2 platforms.
[9/26/2023, 2:37:20 AM] Loaded 1 cached accessories from cachedAccessories.
[9/26/2023, 2:37:20 AM] ---
[9/26/2023, 2:37:20 AM] Loaded plugin: homebridge-flobymoen@1.0.9
[9/26/2023, 2:37:20 AM] Registering platform 'homebridge-flobymoen.Flo-by-Moen'
[9/26/2023, 2:37:20 AM] ---
[9/26/2023, 2:37:20 AM] Loading 2 platforms...
[9/26/2023, 2:37:20 AM] [Flo-by-Moen] Initializing Flo-by-Moen platform...
[9/26/2023, 2:37:20 AM] [Flo-by-Moen] Starting communication with Flo portal
[9/26/2023, 2:37:20 AM] Homebridge v1.6.1 (HAP v0.11.1) (Homebridge 4061) is running on port 51675.
[9/26/2023, 2:37:20 AM] [Flo-by-Moen] Flo Info: Using local cache Flo token.
[9/26/2023, 2:37:20 AM] [Flo-by-Moen] Flo Info: Token will refresh in 1 hour(s) and 59 min(s).
[9/26/2023, 2:37:20 AM] [Flo-by-Moen] Initializing Flo devices...
[9/26/2023, 2:37:30 AM] [Flo-by-Moen] Device Discovery Unsuccessful Error:  getaddrinfo EAI_AGAIN api-gw.meetflo.com. Please check configuration and restart the plug-in

Plugin Config:

{
    "bridge": {
        "name": "Homebridge 4061",
        "username": "FF:FF:FF:FF:FF:FF",
        "port": 51675,
        "pin": "555-55-555",
        "advertiser": "avahi"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "name": "Flo-by-Moen",
            "auth": {
                "username": "myemail@example.com",
                "password": "mypassword"
            },
            "disableCache": false,
            "showTemperatureAndHumidity": true,
            "enableValveControl": false,
            "showHealthTestSwitch": false,
            "treatWarningAsCritical": true,
            "deviceRefresh": 3600,
            "pingRefresh": 12,
            "offlineTimeLimit": 24,
            "retryErrorDisplay": 3,
            "platform": "Flo-by-Moen"
        }
    ]
}

Screenshots:

Environment:

haywirecoder commented 11 months ago

Hi,

"getaddrinfo EAI_AGAIN" is a DNS lookup timed-out error, which means it is a network connectivity error. When you are getting this error I would recommend checking to see if you able to resolve api-gw.meetflo.com address or put static route to get this address.

mikecwwells commented 11 months ago

Thanks, I can definitely resolve that domain from the machine but I put a static route to it just in case and will give that a try! I did some more looking and for various other external reasons, I think that server drops the network connection for a minute or two every once in a while. I think that may be coinciding with the DNS lookup errors - if both just so happen at the same time, maybe it causes the error. Either way, once the error happens, the plugin doesn't seem to try the request again until Homebridge is manually restarted. Is there a way to configure the plugin to "try again" after a certain amount of time?

haywirecoder commented 11 months ago

Hi, Yes the plug-in should try to fix the issue but will admit never saw this error prior, so something may have gone off the rails. I will try to simulate the same issue in my test environment. Additional question: Is the plug-in running as a child bridge? If so have you just tried restarting the child bridge? If that is successful, then it is something that I can try to fix in the plug-in (e.g. it can detect failure, clean up connection and restart).

mikecwwells commented 11 months ago

Hi! The plugin is not running as a child bridge. In fact, it is actually the only plugin I've had in Homebridge since I set it up (other than Homebridge UI, I guess).

github-actions[bot] commented 4 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.