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

Just updated and tested the ESP32 update, and it works fine again :+1:

1 Like

Thank you - finally got the ESP work :wink:

But next question:

I added the ESP to my WiFi - everything fine. How Do I connect my switchbot device to the ESP and then to Homey?

If I open the Webinterface of the esp32 select registered devices, it only shows this:

How could I add the devices to the esp32 and how to add them in homey?

Sorry for these noob questions ;-(

The ESP32 automatically detects any SwitchBot devices, so nothing to do there.

The ESP32 also connects to Homey automatically via the WiFi by broadcast messages.

To add devices to Homey, just use the normal wizard and select the BLE variants of the devices. Homey will automatically try the ESP32 devices first and then the built in BLE. So, the ESP32 is basically transparent to the user and just works in the background.

hmmm - but it seems that the ESP32 does not detect my SwitchBot device.

No device is listed in the web interface.

I presume that’s when you click on the View the registered devices?
What SwitchBot device do you have?

yes.

What SwitchBot device do you have?

Bot(BLE)

Dear Adrian,

I noticed that I have several SwitchBot devices double when in detected through BLE on my Homey Pro (2023). The only differ in the on the name upper or lower case of the bluetooth mac-adress. But I also sometimes experienced a diuretic status of them.
Fir example the same Motion sensor had or had not detected a motion on the same time depending only the upper of lower case device that was added to Homey Pro (2023) through BLE. Which one is the current/correct/newest one ? The device with the upper or lower case BLE Mac adress ??:person_shrugging:t2::face_with_monocle::thinking:

Thank you. :pray:t2:

By the way : I have the Homey Pro 2023. But still also the Homey (real) Pro 2019 snd use on both the switchbot app en device (also thorough BLE) is there any difference or something (special) to keep in mind for this situation/setup ??

Athom did make some changes to the API so uuid’s where lower case but have changed to upper case. I have made changes to allow for that with my ESP32 but not sure if it affects the native BLE.

Using multiple Homey’s via BLE is fine, but cloud could exceed API quotas.

Hi Adrian,

I did some restarts, changed the location of the ESP32 (less distance to the Bot) but it seems the ESP32 still does not find the device (Bot).

Is there something that I can do to force a connection or a new search of Bluetooth devices? Or is it possible to get something like a log to see what’s the ESP does?

EDIT:

I just refreshed the web interface a few times and while doing that there appeared different Devices… but only WiFi-Devices.

Could it be that BLE must be activated somehow separately?

[0A
LOCATION.SMARTSPEAKER.AUDIO: lc_5c1d5675675679768e73a957b4
SECURELOCATION.UPNP.ORG: https://192.168.178.80:1443/xml/device_description.xml
X-SONOS-HHSECURELOCATION: https://192.168.178.80:1843/xml/device_description.xml

cription.xml

x-age = 1800
LOCATION: http://192.168.178.80:1400/xml/device_description.xml
NT: upnp:rootdevice
NTS: ssdp:alive
SERVER: Linux UPnP/1.0 Sonos/79.0-52294 (ZPS17)
USN: uuid:RINCON_C43875265B4A01400::upnp:rootdevice
X-RINCON-HOUSEHOLD: Sonos_ZXNAnf6756756756WoVdPcwl
X-RINCON-BOOTSEQ: 12
BOOTID.UPNP.ORG: 12
X-RINCON-WIFIMODE: 1
X-RINCON-VARIANT: 2
HOUSEHOLD.SMARTSPEAKER.AUDIO: Sonos_ZXNAnfNOqFuZ676767WoVdPcwl.7zc28Uqk26676767Da0A
LOCATION.SMARTSPEAKER.AUDIO: lc_5c1d80b1d1954j6667678e73a957b4
SECURELOCATION.UPNP.ORG: https://192.168.178.80:1443/xml/device_description.xml
X-SONOS-HHSECURELOCATION: https://192.168.178.80:1843/xml/device_description.xml

OK, I just found my Bot and replaced the battery :slight_smile:
It seems they have added an extra byte to the data and the ESP32 code was checking for an exact match on the length for validation. I have fixed that I am testing it now and will then push an update to GitHub.

The Bot does have to be initialised via the SwitchBot mobile app to make it start sending status updates, so provide you can see it and control it in the phone app then it should be capable of appearing in Homey.

OK, I have updated Github and you should be able to update your device using the OTA methos.

Note: if you plug in the ESP32 to your computer and connect a serial port monitor to the port it creates, you can see error messages and status updates.

Thank you will give it a try! :wink:

I have to upload the SwitchBotBLEHub.ino.merged.bin file via OTA, correct?

No, just the SwitchBotBLEHub.ino.bin

Thank you!!!
Now it seems to work:

[{"hubMAC":"4c:53:2f:b3:a3:a0","address":"D5:35:33:34:4C:5E","rssi":-61,"serviceData":{"model":"H","modelName":"WoHand","mode":false,"battery":100,"state":0}}]
1 Like

Hi @Adrian_Rockall,

One of the 3 Meter Plus devices I have, does give a good temperature value on the device and in the SwitchBot phone app, but a wrong reading in the Homey App. It roughly gives 13 degrees more (say 24 versus 37).

To try and resolve that, I have restarted the app without effect. Next I removed that device and added it again to Homey. Problem persists. Still all fine in the SwitchBot phone app and on the device.

Next I restarted Homey to see if that would change things. It did but not for the better.
Still the devices are present in Homey and still the wrong temperature is reported.

When I go to the configuration in the SwitchBot app on Homey (v 1.1.51) and click Get Hub Devices it says No OAuth2 Client Found. This might be OK as I have connected them through BT and don’t have the Hub.

When I go to Get Status and past the ID of a device, Homey returns an error: Error: No OAuth2 Client Found. This applies to all 3 devices.

The log doesn’t read very well because of the huge amount of backslashes. What I can see is that the SwitchBot app still reads data from the devices but only gets 2 actual values.

  • Parsed Temperature BLE: temperature = 37.5, humidity = 48, battery = 89
  • Parsed Temperature BLE: temperature = 25.4, humidity = 47, battery = 93
  • Parsed Temperature BLE: No service data

In the developer pages I can see that there is old data (from before the Homey restart). That device was updating normally before.

I don’t know if it useful but I just did send the log through the app.

To complete the story: I’m running Homey Pro (Early 2019) on version 11.0.0
All apps are on their latest version. For the SwitchBot app that is 1.1.51 as there is no later version available to me.

So, the big question now is: where to go from here?

Thanks for your help.

Best regards,
Ed Steenhoek

Hi @Adrian_Rockall

Question… Can you tell me if the range and stability/reliability of the esp module is better than the Switchbot Hub?

Asking because using the hub, it happens quite often that a command is missed. I allready tried to send some commands a couple of times but it still happens. I also tried to add some delay between all commands that goes to the hub.

I get a message after 3 minutes after I leave my house when the locks are not locked. And that happens to often and I have to lock them true the Switchbot app myself.

Range should not be the problem as the devices are in a range of 3/4 meter of the hub.

I would say the ESP32 has about the same range as the hub, but it works completely locally via WiFi and BLE.
However the Lock is not available via BLE due to the encryption and therefore doesn’t work with the ESP32.
Also, I think the reliability issues are with cloud connection rather than the hubs BLE.

1 Like

That message is normal if you haven’t added any HUB devices as it won’t have tried to authenticate with the cloud.

So that is the response from all three devices and the last one is not able to get all the data. Often that is due to the device being on the limit of the BLE range, but also can be down to Homey’s BLE implementation.

I have eventually spotted the issue. The temperature data has an extra bit set in one of the bytes, so I have now masked that off. There is a new test version in the store.

The new version also tidies up the logging a bit.

Thanks for the update Adrian,

I’ve installed v 1.1.57 and the meters now give their correct values again.
The values have been consistent during the past hours so I hope it stays that way.

The log is also readable again.

Thanks for the quick patch!

Regards,
Ed

1 Like

Everything seemed fine, but over the last couple of days noticed that the ESP isn’t always working. Also noticed that the /update URL is not available sometimes as well, after a reboot of the ESP it seems to work again for about a day or 2. (tried multiple ESP’s, and doesn’t seem to be a network issue). Any clue what else I can do to resolve this? Never had this issue with the previous version, started after updating to 1.9.