alexryd / homebridge-shelly-ng

Homebridge plugin for the next generation of Shelly devices
GNU General Public License v3.0
121 stars 44 forks source link

[Shelly NG] Failed to add discovered device #71

Open MrSteffens opened 1 year ago

MrSteffens commented 1 year ago

Hi there,

unfortunately i am getting the error that Shelly NG failed to add discovered devices. They have been connected before but it seems random of when they do. Sometimes I can restart the HB and it just connectes correctly, then other times restarting doesnt help and the error occurs in the terminal over and over. The biggest problem to that is, when it doesn't "add" the device, they are unreachable for HB and homeKit.

[Shelly NG] Failed to add discovered device (id: shellyplus2pm-c049ef8d49e4): Error connecting to device (code: 1006) [13/04/2023, 03:16:32] [Shelly NG] Failed to add discovered device (id: shellyplus2pm-441793ce65fc): Error connecting to device (code: 1006) [13/04/2023, 03:16:56] [Shelly NG] Failed to add discovered device (id: shellyplus2pm-c049ef8d49e4): Error connecting to device (code: 1006) [13/04/2023, 03:17:01] [Shelly NG] Failed to add discovered device (id: shellyplus2pm-441793ce65fc): Error connecting to device (code: 1006)

wasnertobias commented 1 year ago

Same problem here. On startup of this plugin my wifi network is not yet up. Therefor it only tries to connect to the device once, throws this error and never retries. Manual restart of this plugin fixes it until my raspberry pi and network is restarted - which happens daily on purpose to save electricity when I don’t have any usage.

[13/07/2023, 20:39:56] [Shelly NG] Failed to add discovered device (id: shellyplus2pm-5443b23f
3£38): Error connecting to device (code: 1006)
[13/07/2023, 20:39:56] [Shelly NG] Failed to add discovered device (id: shellyplus1pm-441793ac
88ac): Error connecting to device (code: 1006)

My config is pretty static, will try to activate mdns:

           mdns": {
                "enable": false,
                "interface": "eth0"
            },
            "devices": [
                {
                    "id": "shellyplus2pm-5443b23f3f38",
                    "exclude": false,
                    "hostname": "192.168.178.140",
                    "switch:0": {
                        "exclude": false,
                        "type": "switch"
                    },
                    "switch:1": {
                        "exclude": false,
                        "type": "switch"
                    },
                    "switch:2": {
                        "exclude": false,
                        "type": "switch"
                    },
                    "switch:3": {
                        "exclude": false,
                        "type": "switch"
                    },
                    "cover:0": {
                        "exclude": false,
                        "type": "window"
                    }
                },
                {
                    "id": "shellyplus1pm-441793ac88ac",
                    "exclude": false,
                    "hostname": "192.168.178.141",
                    "switch:0": {
                        "exclude": false,
                        "type": "switch"
                    },
                    "switch:1": {
                        "exclude": false,
                        "type": "switch"
                    },
                    "switch:2": {
                        "exclude": false,
                        "type": "switch"
                    },
                    "switch:3": {
                        "exclude": false,
                        "type": "switch"
                    },
                    "cover:0": {
                        "exclude": false,
                        "type": "window"
                    }
                }
wasnertobias commented 10 months ago

mDNS does not fix this. It just fails on startup with the mentioned error message and never re-tries! I will look into switching to HomeAssistant I guess.