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

Support Request: Bot Reaction Time over BLE too slow (3s) #1038

Open
Sascha-L opened this issue Sep 2, 2024 · 5 comments
Open

Support Request: Bot Reaction Time over BLE too slow (3s) #1038

Sascha-L opened this issue Sep 2, 2024 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@Sascha-L
Copy link

Sascha-L commented Sep 2, 2024

Describe Your Problem

I'm using the latest homebridge version on a Pizero W 1.1. It's a clean installation, I'm using this only for two SwitchBot Bots. I also installed the prerequisites. Everytime I click on the button the homebridge UI to perform a press on any of my two bots it always takes exactly 3s until the bot reacts. The command is triggered instantly by the homebridge UI but until the bot is pressing it takes 3 seconds. The Pizero and both Bots are in a distance of 5-10cm. If I use my iPhone 14 Pro the bots are reacting instantly without any delay. I also tried to remove the bots from the SwitchBot App, so that they only connected to my Pizero. I also tried the plugin of glazo from GitHub, which says it would be the fastet plugin, but it also takes 3s. That's extrem slow and so I can't use the Bots. I don't undertand why it takes so long and why it is super fast with my iPhone. I also tried different options like "default" or "press" as method, also tried the new BLE scanning on/off (whatever this means...), tried allowPush on/off. It always takes 3s...

Relevant log output

[01/09/2024, 16:19:02] [SwitchBot] Bot: Bot Tuer auf On: true
[01/09/2024, 16:19:06] [SwitchBot] Bot: Bot Tuer auf On: false sent over SwitchBot BLE,  sent successfully
[01/09/2024, 16:19:15] [SwitchBot] Bot: Bot Tuer auf On: true
[01/09/2024, 16:19:18] [SwitchBot] Bot: Bot Tuer auf On: true sent over SwitchBot BLE,  sent successfully
[01/09/2024, 16:32:32] [SwitchBot] Bot: Bot Tuer auf On: true
[01/09/2024, 16:32:35] [SwitchBot] Bot: Bot Tuer auf On: true sent over SwitchBot BLE,  sent successfully
[01/09/2024, 16:33:37] [SwitchBot] Bot: Bot Tuer auf On: true
[01/09/2024, 16:33:40] [SwitchBot] Bot: Bot Tuer auf On: true sent over SwitchBot BLE,  sent successfully
[01/09/2024, 16:36:53] [SwitchBot] Bot: Bot Tuer auf On: true
[01/09/2024, 16:36:56] [SwitchBot] Bot: Bot Tuer auf On: true sent over SwitchBot BLE,  sent successfully

Config for homebridge-switchbot

{
    "bridge": {
        "name": "XXXXXXXXXXXXXX",
        "username": "XXXXXXXXXXX",
        "port": XXXXXXXXXXXXXX,
        "pin": "XXXXXXXXXXXXXXX",
        "advertiser": "avahi"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": XXXXXX,
            "platform": "config"
        },
        {
            "name": "SwitchBot",
            "credentials": {
                "notice": "Keep your Token & Secret a secret!"
            },
            "options": {
                "devices": [
                    {
                        "deviceId": "CF1EC668A715",
                        "configDeviceName": "Bot Tuer auf",
                        "configDeviceType": "Bot",
                        "connectionType": "BLE",
                        "bot": {
                            "mode": "press",
                            "deviceType": "switch",
                            "allowPush": true
                        }
                    },
                    {
                        "deviceId": "FC4376C368ED",
                        "configDeviceName": "Bot Tuer zu",
                        "configDeviceType": "Bot",
                        "connectionType": "BLE",
                        "bot": {
                            "mode": "press",
                            "deviceType": "switch",
                            "allowPush": true
                        }
                    }
                ],
                "BLE": true
            },
            "platform": "SwitchBot"
        }
    ]
}

Screenshots

No response

Device & Model

Pizero W 1.1 & SwitchBot Bot

Node.js Version

v20.17.0

NPM Version

10.8.2

Homebridge Version

1.8.4

Homebridge SwitchBot Plugin Version

3.7.0

Homebridge Config UI X Plugin Version

4.57.1

Operating System

Default Homebridge OS from Raspberry Pi Image Tool for Pizero

@Sascha-L Sascha-L added the question Further information is requested label Sep 2, 2024
@donavanbecker
Copy link
Collaborator

Can you try the latest beta:

npm version

Click here to find out how to install Beta

@donavanbecker
Copy link
Collaborator

Have you tried updating the pushRate on the device or the plugin?

@Sascha-L
Copy link
Author

Hi,

I tried 3.7.0, 3.8.0 (today) and 3.8.1-beta.1. It is always the same, it takes always exactly 3s.

The push rate is set to default. The plugin settings dialog shows, that the default value is 1s and it seems that this will be the lowest value, because the value is in seconds. I also tried to manually set it to 1s. There is no difference, it still takes 3s. The push rate can't be changed on the device itself. There is no option when I connect the SwitchBot App with the Bot. But as said, when triggering the Bot from the App the Bot reacts instantly without any delay. To the Bot is working great and as fast as possible. Only when using your homebridge plugin there is always a fix delay of 3s :-(

@donavanbecker
Copy link
Collaborator

donavanbecker commented Sep 12, 2024

Set the push rate in the Homebridge plugin config for the device.set it to 0.5 and see if that helps.

Send your config when you respond back with the results.

@Sascha-L
Copy link
Author

As said, the default push rate is 1s and I also manually set 1s without any difference. Also with 0.5 or 0.1, it always takes 3s, sometimes 4s.

All settings are default, the whole config is default. Also I tried ALL settings. None of the settings had any impact on this issue, it is always 3s.

Also when setting the log level to debug, nothing is shown between those two lines:

[01/09/2024, 16:36:53] [SwitchBot] Bot: Bot Tuer auf On: true
[01/09/2024, 16:36:56] [SwitchBot] Bot: Bot Tuer auf On: true sent over SwitchBot BLE, sent successfully

So what is happening between those two lines? What takes 3s until the command is sent to the SwitchBot?

If you have no idea and can't reproduce this, could you please add more log outputs in debug level, so we can figure out what is happening there and what is taking so long?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

6 participants