Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: [SwitchBot] [DEBUG] Failed to Discover Devices #757

Closed
secj-eng opened this issue Jul 4, 2023 · 20 comments
Closed

Bug: [SwitchBot] [DEBUG] Failed to Discover Devices #757

secj-eng opened this issue Jul 4, 2023 · 20 comments
Assignees
Labels
bug Something isn't working

Comments

@secj-eng
Copy link

secj-eng commented Jul 4, 2023

Describe the Bug

After installing plugin on Homebridge on raspberry pi zero, I add the device (bot) to the config using the

I receive the following errors in the boot log of Homebridge:
Failed to Discover Device

Cloud Services are enabled and I can control the device through Amazon Echo without issue.

I've reinstalled plugin and device to no avail. Do I have to do anything special with the mini hub?

To Reproduce

  1. Install as normal and add device to plugin configuration page

Expected Behavior

I would expect the device to register

Relevant Log Output

[SwitchBot] [DEBUG] Executed didFinishLaunching callback

[SwitchBot] [DEBUG] Failed to Discover Devices, Error Message: "Connect Timeout Error", Submit Bugs Here: https://tinyurl.com/SwitchBotBug

[SwitchBot] [DEBUG] Failed to Discover Devices, Error: ConnectTimeoutError: Connect Timeout Error

Config for homebridge-switchbot

xxxx is substituted for pasting
{
            "name": "SwitchBot",
            "credentials": {
                "token": "xxxxxxxxxxxxxxxx",
                "secret": "xxxxxxxxx",
                "notice": "Keep your Token & Secret a secret!"
            },
            "options": {
                "devices": [
                    {
                        "deviceId": "CA011Axxxxxx",
                        "configDeviceName": "Button",
                        "configDeviceType": "Bot",
                        "connectionType": "OpenAPI",
                        "bot": {
                            "mode": "press",
                            "deviceType": "switch",
                            "doublePress": 1
                        },
                        "logging": "debug"
                    }
                ],
                "logging": "debug"
            },
            "platform": "SwitchBot"
        }

Screenshots

No response

Device and Model

Switchbot Bot and mini hub

Node.js Version

v18.16.1

NPM Version

v9.5.1

Homebridge Version

v1.6.1

Homebridge Switchbot Plugin Version

v2.6.2

Homebridge Config UI X Plugin Version

v4.50.4

Operating System

Raspbian

@donavanbecker
Copy link
Collaborator

Seems like a network issue

@secj-eng
Copy link
Author

secj-eng commented Jul 5, 2023

Seems like a network issue

Maybe, but I can't find one. Homebridge and SwitchBot Mini are on the same WiFi and network. The other service (Amazon) does not have a problem. Open to any other checks you can suggest

@secj-eng
Copy link
Author

secj-eng commented Jul 9, 2023

Fwiw - I tried changing to BLE and am getting the same error. I can still control the switchbot through Alexa but not through Homebridge. I'm happy to troubleshoot if you have any ideas

@Niklas31
Copy link

I am having the same issues! Tried cleaning my cache and nothing. Hero is the debug log:
13/07/2023, 11:08:27Switchbot PonteSwitchBotWARNING[DEBUG] Using Config Logging: debug 13/07/2023, 11:08:27Switchbot PonteSwitchBot[DEBUG] Finished initializing platform: 13/07/2023, 11:08:27Switchbot PonteSwitchBotPlatform Config: {"logging":"debug"} 13/07/2023, 11:08:27Switchbot PonteSwitchBotWARNING[DEBUG] Using Default Refresh Rate (2 minutes). 13/07/2023, 11:08:27Switchbot PonteSwitchBotWARNING[DEBUG] Using Default Push Rate. 13/07/2023, 11:08:27Switchbot PonteSwitchBot[DEBUG] Config OK 13/07/2023, 11:08:27Switchbot PonteSwitchBot[DEBUG] Executed didFinishLaunching callback 13/07/2023, 11:08:31Switchbot PonteSwitchBot[DEBUG] Devices: undefined 13/07/2023, 11:08:31Switchbot PonteSwitchBotUnknown statusCode, statusCode: 401, Submit Bugs Here: ' + 'https://tinyurl.com/SwitchBotBug 13/07/2023, 11:08:31Switchbot PonteSwitchBot[DEBUG] Headers: {"date":"Thu, 13 Jul 2023 14:51:20 GMT","content-type":"application/json","content-length":"26","connection":"keep-alive","x-amzn-requestid":"b8843cec-e185-435d-8d38-9f0695ff54b6","x-amzn-errortype":"UnauthorizedException","x-amz-apigw-id":"IAdYWHQ5IAMFWSA="} 13/07/2023, 11:08:31Switchbot PonteSwitchBotERRO[DEBUG] Failed to Discover Devices, Error Message: "Cannot read properties of undefined (reading 'deviceList')", Submit Bugs Here: https://tinyurl.com/SwitchBotBug 13/07/2023, 11:08:31Switchbot PonteSwitchBotERRO[DEBUG] Failed to Discover Devices, Error: TypeError: Cannot read properties of undefined (reading 'deviceList')

@donavanbecker
Copy link
Collaborator

Are your devices enabled for Cloud? In the SwitchBot app

@Niklas31
Copy link

Yes! Everything was working fine and nothing changed. Looking trough the other opened bugs, 4 of them are the same #757 #756 #753 #742

@Niklas31
Copy link

Niklas31 commented Jul 19, 2023

log.txt
Here is the DEBUG log. Hope it helps, if it seems to be a firewall issue on my side, please let me know.

Here is my config:

    "platform": "SwitchBot",
    "name": "SwitchBot",
    "credentials": {
        "token": "xxx",
        "secret": "xxx"
    },
    "options": {
        "logging": "debug",
        "devices": [
            {
                "deviceId": "C8:F1:15:DC:06:0C",
                "configDeviceName": "Cortina ",
                "configDeviceType": "Curtain",
                "connectionType": "BLE",
                "curtain": {
                    "set_min": 5,
                    "set_max": 95,
                    "setOpenMode": "0",
                    "setCloseMode": "0",
                    "hide_lightsensor": true
            },
            {
                "deviceId": "CE:51:38:BF:D6:3E",
                "configDeviceName": "Dedinho",
                "configDeviceType": "Bot",
                "connectionType": "BLE",
                "bot": {
                    "mode": "press"
                }
            }
        ]
    }
}

@francescosabia
Copy link

having same bug. all stopped working so i deleted and readded from scratch the plugin and re configured all but hoobs wont find my switchbot devices anymore. nothing appens in log

@donavanbecker
Copy link
Collaborator

HOOBs isn’t supported. So that could be your issue.

@francescosabia
Copy link

francescosabia commented Jul 25, 2023 via email

@francescosabia
Copy link

Now magically it starts working again! All device are in my hoobs instance. Maybe network issue?

@francescosabia
Copy link

Now doesn’t work again! I don t think it s hoobs related. There is something wrong with the plugin itself! Because hoobs is the same than homebridge

@donavanbecker
Copy link
Collaborator

@francescosabia I am not going to continue to go back and forth on this but HOOBs is different then Homebridge.

If you choose to use HOOBs, I will not support.

@francescosabia
Copy link

@francescosabia I am not going to continue to go back and forth on this but HOOBs is different then Homebridge.

If you choose to use HOOBs, I will not support.

sorry, don't get nervous. i don' t understand why the plugin worked good since yesterday also in hoobs... i think that also people with homebridge are having problems.

@donavanbecker
Copy link
Collaborator

@francescosabia, HOOBs isn't support

@donavanbecker
Copy link
Collaborator

donavanbecker commented Jul 26, 2023

@secj-eng can you try the latest beta?

@Niklas31 please open your own issue.

@secj-eng
Copy link
Author

secj-eng commented Aug 6, 2023

@donavanbecker Sorry for the delay. I've moved switchbot from Raspberry PI to another Homebridge instance. It works there without issue, but I'll go back and test on Raspberry platform when I get a chance. I'm running v2.7.1 on the new instance, is that what you want me to try or the latest beta?

@donavanbecker
Copy link
Collaborator

@secj-eng Latest beta

@secj-eng

This comment was marked as off-topic.

@donavanbecker
Copy link
Collaborator

v2.8.0 is released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants