[APP][Cloud & Pro] SwitchBot (Release 1.1.51, Test 1.1.56)

Thanks!

Donā€™t know if it helps, but I have resetted both devices tonight, added them again to the switchbot app and after that also to the Homey again.

Also updated the Homey to RC 133 (stable), and are using the latest experimental Switchbot app.

Unfortunately no differenceā€¦
Have send you a new log.

It looks like there is a bit more detail of the BLE send failure, so I will pass that on to Athom.

1 Like

Thinking of buying switchbot motion sensor and hub, nowadays how fast does homey register motion when using it with the hub? Thank you

The app now uses a webhook to get events, so notifications normally come through in about 1 to 2 seconds max.

For reference, via Homey BLE it can take up to 30 seconds as that is the minimum reliable polling rate.
If you use an ESP32 with my gateway code running on it, then it is also about 1 second (slightly faster than the SwitchBot hub but hardly noticeable). The main advantage is it is totally local, so still works when the internet is down.

Ok, and about lux update, it frequently updates or only when motion sensor is activated?

The sensors only have dim and bright for the light sensor, so no lux value. You can calibrate the level in the Switchbot phone app so it knows whatā€™s dark and whatā€™s light.
And to answer your question, the light level is only picked up by polling and is not included in any Webhook messages. The polling rate depends on the number of devices that require it, as Switchbot have a daily limit on the number of API requests.

1 Like

Ok Adrian, thank you for your help.

Hello, i have two switchbot curtain rod 2s and the ESP32 with the software loaded but i have alot of connection failures between the curtains and the ESP, it seems if i look in the log it cant connect to the switchbots but if i look at the esp at the connected devices it reports the info of the two bots.


* 2023-07-25T11:39:51.215Z
!!!!!! Peripheral Not Found: C94B2624272B
Error: Peripheral Not Found: C94B2624272B
    at Remote Process
    at HomeyClient.emit (/node_modules/@athombv/homey-apps-sdk-v3/lib/HomeyClient.js:44:23)
    at ManagerBLE.find (/node_modules/@athombv/homey-apps-sdk-v3/manager/ble.js:104:47)
    at CurtainsBLEDevice.getDeviceValues (/app/drivers/curtains_ble/device.js:330:63)
    at MyApp.onBLEPoll (/app/app.js:978:50)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

* 2023-07-25T11:39:51.216Z
!!!!!! Peripheral Not Found: CC711E05FA09
Error: Peripheral Not Found: CC711E05FA09
    at Remote Process
    at HomeyClient.emit (/node_modules/@athombv/homey-apps-sdk-v3/lib/HomeyClient.js:44:23)
    at ManagerBLE.find (/node_modules/@athombv/homey-apps-sdk-v3/manager/ble.js:104:47)
    at CurtainsBLEDevice.getDeviceValues (/app/drivers/curtains_ble/device.js:330:63)
    at MyApp.onBLEPoll (/app/app.js:978:50)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

* 2023-07-25T11:39:51.219Z
* ------------------------------------ Polling BLE Finished


* 2023-07-25T11:39:51.221Z
* Next BLE polling interval = 30000

* 2023-07-25T11:39:51.299Z
* Looking for BLE device: Curtain right

* 2023-07-25T11:39:56.317Z
!!!!!! Catch 1: Curtain right: Error: Peripheral Not Found: CC711E05FA09

* 2023-07-25T11:39:56.318Z
* finally 1: Curtain right

* 2023-07-25T11:39:56.319Z
* Retry command (0 of 3) for Curtain right in 5 seconds

* 2023-07-25T11:40:01.345Z
* Looking for BLE device: Curtain right

* 2023-07-25T11:40:06.361Z
!!!!!! Catch 1: Curtain right: Error: Peripheral Not Found: CC711E05FA09

* 2023-07-25T11:40:06.361Z
* finally 1: Curtain right

* 2023-07-25T11:40:06.362Z
* Retry command (1 of 3) for Curtain right in 5 seconds

* 2023-07-25T11:40:09.504Z
* server got: SwitchBot BLE Hub! 28:78:a0:9e:f0:c8 from 10.10.0.86:1234

* 2023-07-25T11:40:09.505Z
* Registering callback: http://10.10.0.142:80/api/app/com.switchbot/newData/

* 2023-07-25T11:40:09.506Z
* callback/add

* 2023-07-25T11:40:09.507Z
* {"uri":"http://10.10.0.142:80/api/app/com.switchbot/newData/"}

* 2023-07-25T11:40:09.507Z
* {
  "host": "10.10.0.86",
  "path": "/api/v1/callback/add",
  "method": "POST",
  "headers": {
    "contentType": "application/json; charset=utf-8",
    "Content-Length": 62,
    "connection": "Close"
  }
}

* 2023-07-25T11:40:09.519Z
* Post: retrieve data

* 2023-07-25T11:40:09.520Z
* Post response: {
  "message": "OK: 1",
  "statusCode": 200
}

* 2023-07-25T11:40:09.520Z
* POST complete

* 2023-07-25T11:40:11.370Z
* Looking for BLE device: Curtain right

* 2023-07-25T11:40:16.393Z
!!!!!! Catch 1: Curtain right: Error: Peripheral Not Found: CC711E05FA09

* 2023-07-25T11:40:16.395Z
* finally 1: Curtain right

* 2023-07-25T11:40:16.396Z
* Retry command (2 of 3) for Curtain right in 5 seconds

* 2023-07-25T11:40:21.226Z
* 
Polling BLE Starting ------------------------------------

* 2023-07-25T11:40:26.244Z
* BLE Finished Discovery

* 2023-07-25T11:40:26.245Z
* Polling BLE: waiting for devices to update

* 2023-07-25T11:40:31.270Z
!!!!!! Peripheral Not Found: C94B2624272B
Error: Peripheral Not Found: C94B2624272B
    at Remote Process
    at HomeyClient.emit (/node_modules/@athombv/homey-apps-sdk-v3/lib/HomeyClient.js:44:23)
    at ManagerBLE.find (/node_modules/@athombv/homey-apps-sdk-v3/manager/ble.js:104:47)
    at CurtainsBLEDevice.getDeviceValues (/app/drivers/curtains_ble/device.js:330:63)
    at MyApp.onBLEPoll (/app/app.js:978:50)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

* 2023-07-25T11:40:31.272Z
!!!!!! Peripheral Not Found: CC711E05FA09
Error: Peripheral Not Found: CC711E05FA09
    at Remote Process
    at HomeyClient.emit (/node_modules/@athombv/homey-apps-sdk-v3/lib/HomeyClient.js:44:23)
    at ManagerBLE.find (/node_modules/@athombv/homey-apps-sdk-v3/manager/ble.js:104:47)
    at CurtainsBLEDevice.getDeviceValues (/app/drivers/curtains_ble/device.js:330:63)
    at MyApp.onBLEPoll (/app/app.js:978:50)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

* 2023-07-25T11:40:31.272Z
* ------------------------------------ Polling BLE Finished


* 2023-07-25T11:40:31.273Z
* Next BLE polling interval = 30000

* 2023-07-25T11:40:31.457Z
* Looking for BLE device: Curtain right

* 2023-07-25T11:40:36.471Z
!!!!!! Catch 1: Curtain right: Error: Peripheral Not Found: CC711E05FA09

* 2023-07-25T11:40:36.472Z
* finally 1: Curtain right

* 2023-07-25T11:40:36.473Z
* Retry command (3 of 3) for Curtain right in 5 seconds

* 2023-07-25T11:40:41.499Z
* Looking for BLE device: Curtain right

* 2023-07-25T11:40:46.516Z
!!!!!! Catch 1: Curtain right: Error: Peripheral Not Found: CC711E05FA09

* 2023-07-25T11:40:46.520Z
* finally 1: Curtain right

* 2023-07-25T11:40:46.521Z
!!!!!! !!!!!!! Command for Curtain right failed


Ah, cancel that for now, i think i have a defective switchbot (battery defective, empty within a day) :sweat_smile:

1 Like

Hello. I am the owner of a SwitchBot contact sensor. I have encountered an issue where the native SwitchBot application responds to motion and door opening almost instantly (within 0.5 seconds). However, in Homey Pro23, the response takes around 4-5 seconds. This is very slow. The sensor is connected to Homey through the SwitchBot Hub Mini.

With ESP32 D1 BLE Hub response is normal!

Maybe Switchbot have a server issue. I will investigate today.
When you use the Switchbot phone app it receives updates via BLE if possible.

Has anyone managed to register the Switchbot Hub 2 in Homey via Matter?
I tried Homey and Home Assistant, but both attempts were unsuccessful. The Hue Bridge was recognised immediately, although it is still beta.

I have. It took a couple of attempts but did get there eventually.
Also not sure what versions of Hub 2 and Homey are required.
At the moment, only the temperature and humidity of the hub 2 are supported.

1 Like

By the way, I found out how to add Hub 2 to Homey.

Press and hold the on and off buttons for 15 seconds. Now the Hub 2 is in Matter setup mode. Homey then finds it immediately as soon as the code has been entered.

Screenshot_20230806-153624_Homey

1 Like

Just wanted to let you know that since the last updates from the homey (and your app) all curtains are working fine on the commands!! Thank you!

1 Like

Just bought my first Switchbot product this week. Iā€™m now trying to add my Bot BLE to my HP2023 but everytime I try I get the message that the app canā€™t find any devicesā€¦ every app is up to date, also tried to reinstall all apps but no luck m. The bot is also connected with the Switchbot iOS app. Just shared my log with the developer. Im out of options, any ideas what I can do?

What firmware version is your Homey on?
The logs that I can see show a few BLE devices being discovered, but none have any service data, which is where the identification of a Switchbot device is presented.
How far away is the Bot from Homey ?

Thnx for the quick reply! Homey is on v10.0.2. Bot is next to Homey (5cm).