[APP][Cloud & Pro] SwitchBot (Release 1.1.43, Test 1.1.48)

Oke, thanks! I will expand the time.
That will be a nice future!

Iā€™m trying to connect my switchbot bot directly through Bluetooth, but the homey says it cannot find any devices. It tried trough my phone and the switchbot app, that works. Should I set anything more it switch on discovery somewhere?

Bluetooth has a very short range. Please try to bring the devices close to Homey and start the search again.

I have also had an issue where Homey cached a corrupted version of the advertisement and the only way to solve it was to reboot Homey.

Homeyā€™s BLE implementation ignores devices if it thinks it has already seen it. The identity of a device is passed in a service block, so if that wasnā€™t received, the app doesnā€™t recognise it. However the unique id is one of the first things sent and that is what Homey uses to determine if itā€™s been seen before.
I donā€™t know how long the cache it kept but I waited well over 24 hours and the bad information was still there.

If anyone is interested I have written an app that can be loaded onto an ESP32 Arduino board. The app implements BLE to communicate with the Switchbot devices and a REST API that talks to Homey. So far itā€™s working well and is transparent to the user.
The Arduino board I have was Ā£16 from Amazon but I have ordered some cheaper ones to see how well they work.
If you think it could be useful I can publish the code on GitHub but you will need to know how to load it on to the board.
I can make some instructions if there is enough interest.
But also Switchbot have said they might have local access to the Hub by the middle of the year.

1 Like

Restarted my homey and it found it directly!

1 Like

Hallo Adrian,
Bedankt voor het ontwikkelen van de App. Werkt super!

1 Like

Thanks to @Ethaniael for providing a ā€˜fixā€™ for the BLE caching issue, the app is now much more responsive to updates. Iā€™m just annoyed at myself for not finding his solution earlier.
So a new test version is in the store, which I highly recommend if you are connecting via BLE.

I confirm that since this update the curtains really do work great on BLE.

I did have to move my homey to a more central location within my home to get a better BLE reception to all my curtains.
Since the last update all curtains respond much quicker but more important the position update also work within a few seconds. I am still not sure if it is the real actual position or just the set value which is used as final positionā€¦

Sadly for me this fix came 1 day to late, i just ordered (and paid) several aqara door sensors which i wanted to use for checking the position of the curtain motor (if they are in fully open or fully closed position on the rail), i did this trick already with 1 motor and this trick really works great, so i decided to use them on all curtain motors because the actual position tags where incorrectā€¦

But then came suddenly this great update and now the positioning tags works also fine, hahaha

Thanks for the feedback, itā€™s good to know itā€™s working better.
Sorry about the timing, I can appreciate the frustration. I spent days making the Arduino app and had just finished it when I found the workaround for Homey. Although for me it wasnā€™t completely wasted as they still provide the extended range and an even faster response with less load on Homey.
The reported position should be from the Switchbot motor. When you move the slider it sends the move command but then the slider position is updated by feedback from the motor. Hence, if you move the curtains position via an external method (Switchbot app or tugging on the curtains) you should see the slider position also updates.

I am considering the Arduino app, but i have no experience whatsoever with these boards, also no idea how to program them etcā€¦

Programming Is done from the Arduino IDE, which is free from https://www.arduino.cc/en/software. You install the IDE and connect the board to the computer via a USB cable. Then grab my code from Github and put it in a folder on the computer. I have it in C:\Users\Adrian\Documents\Arduino\SwitchBotBLEHub but obviously it can be anywhere you want. Then open the project in the Arduino IDE.
The remaining instruction about boards and libraries to install are on Github but let me know if you get stuck.

Thank you very much for this app!
Iā€™m using the curtains on BLE only.

I had a minimal working version of the app myself, but was having a lot of trouble with the BLE connectivity. Looking at the changelog, clearly so did you. :slight_smile:

Have you looked into a way to calibrate the curtains from Homey? I donā€™t like being dependent on the SwitchBot app for the calibration of the curtains. I captured a bluetooth trace on my Android phone during a calibration, but am having some trouble deciphering the protocol.

I havenā€™t looked at calibration. I was just concentrating on the ā€˜every dayā€™ usage.
Iā€™m not sure what your trace looks like so canā€™t suggest where to look, but I must admit I used codes that were published on SwitchBots GitHub. I havenā€™t seen any mention of other codes.
If you want to send me the trace I will see if it makes any sense to me.

I am looking to buy the switchbot bot to turn my coffee machine on and off. I donā€™t have any switch bot devices but I do have Homey.

The approx. distance between my coffee machine and homey is 7 meters. Would this work using BLE? I donā€™t want to buy the switchbot hub because this would be quite expensive just for this cause.

Unfortunately, it is not just distance that matters. 7 meters is a long way, but it ā€˜mightā€™ work if there are no obstructions for the signal. However, every wall will degrade the signal by some amount that depends on the wall construction. Also, signals from other devices can interfere, so it depends on what and where they are.

BLE is by name a Low Energy signal that is designed for prolonged battery life rather than long distance.

So to sum up, the answer is, the only way to know is to try it and see. Sorry itā€™s not the definitive answer you want, but there are just too many unknown variables for anyone to say yes or no.

To give some examples:
I have a curtain motor that is about 3 meters away, but it is in an extension to the house. The signal has to pass through a 350mm thick cavity wall that has plasterboard (dry wall) on both sides. Also the cavity is filled with thermal wall bats that have a foil coating. In this case the signal is on the limit. I have several retries in the code for sending the commands but in this case it will still often fail.

I have another curtain motor in a bedroom. That is probably about 5 meters away and has the ceiling / floor in between. The signal here is just OK and Homey rarely needs more than the 2 or 3 attempt to send commands.

To solve the problem in the extension I made my BLE Hub interface using a Ā£7 ESP32 Arduino board. I put that inside an old jewelry box that my wife had spare and it plugs into a USB port on that is built into a power socket. So total cost was Ā£7.

1 Like

Hello Adrian!

I have 2 curtain bots and a hub, can get both into the app wirhout any issue but then I get a ā€œdeviceā€™s cloud service not enabledā€, Iā€™m trying to figure it out but canā€™t.

Also, while Iā€™m hereā€¦ is there any way to get open/closed info via hub? Iā€™d like to group both sides in one curtain via VD and toggle them by touchā€¦ any clues?

Thanks a lot!

The Homey is in the living room and the coffee machine in the kitchen. If I draw a straight line from the homey to the coffee machine there is a 7 cm plaster wall between them.

I think Iā€™ll just take my chances and get the switchbot bot and see how it goes using BLE. I donā€™t see myself getting more switchbot products in the near future so the hub isnā€™t worth the cost for me.

Maybe the arduino solution can work for me as well.

Thanks for the reply!

1 Like

Your have to enable the cloud service in the Switchbot app. When itā€™s enabled you will see a small cloud in the top right corner of the tile in the Switchbot app. To enabled it, tap on the tile, tap on the more text, then tap on the gear :gear: in the top right corner. You should then see an entry for Cloud Service so you can tap on that to switch it on.

The app will get the open/close information but as the API is rate limited it can take a while for it to come through. The time between updates is approximately 90 seconds * number of devices in Homey. Hopefully Switchbot will fix this this year with a local API.

This would probably be better using the < group > app:

That should allow you to create a device that you can add ad many curtains as needed to.

Thank you so much! I knew that it was some minor box to tic!

As for grouping, itā€™s not neccesary it shows 2 curtains but one of them is the group so both can be triggered at the same time.

Only thing i canā€™t do is press a tile in homey devices to full open/close but I can get something similar via a flow :slight_smile: