AdyRock / com.switchbot

GNU General Public License v3.0
11 stars 6 forks source link

Unable to trigger SwitchBot Curtains in Homey #19

Closed RS792 closed 2 years ago

RS792 commented 2 years ago

Hi all,

I have just added my two SwitchBot Curtains to Homey. They both show up in the device overview, however I am not able to trigger them to open or to closed position (or to any position for that sake, as they are not responding to any instruction). The Homey is located just 2-3 meters from the units/Bots. I have tried most troubleshooting to see if I can resolve it, incl. restarting the Homey, removing the units/bots and re-adding them, uninstalled and reinstalled the app etc. Unfortunately none of the actions have resolved the issue.

Anyone that have had similar issues and know how to resolve this? Any inputs are highly appreciated.

AdyRock commented 2 years ago

So, I presume you have added them via BLE?

What version of the app are you using?

In the Homey app, could you open More > Apps > Switchbot > Configure App and select the Log tab. Then, select Detailed information from the drop list. Now, go to the devices and try to control them. Finally, go back to the Log tab and tap on Send Log. Hopefully, I will see what is failing.

RS792 commented 2 years ago

@AdyRock, thanks for the swift reply!

Correct, I connected them via BLE. App version: SwitchBot v0.3.20 / Homey 7.2.1

I tried performing the described steps. However, I was unsuccessful in trying to control them (i.e. no movement). I just submitted the log just now. Hopefully that will provide you with some details on what is failing.

Just give me a shout if you want me to perform any special actions. Happy to do some additional testing, if required.

Thanks for looking into this.

AdyRock commented 2 years ago

The log shows that the command is timing out, which would suggest a bad signal, but I can see other things going on. Could you install the test version from the Athom store (just add /test to the URL). I made quite a lot of changes to optimise the BLE routines for Homey v6 and higher in the new version.

RS792 commented 2 years ago

@AdyRock, sure thing!

Installed, tried and tested with the test version (v1.0.2). Unfortunately not any improvement, i.e. still no movement and command is still timing out on both SwitchBots. I have sent through an updated log (after having cleared the previous log i submitted). Note that I got some feedbacks during testing that it was still working on the previous requested action - guessing this will show up in the log as well.

The other things you see going on, anything I can do with these to potentially resolve the issue?

Thanks again!

AdyRock commented 2 years ago

It still looks like a bad signal. There are also a lot of messages saying no service data, which is where the status information would live. That is normally a sign of a weak signal. I must confess that I don't use the Homey BLE for normal operation as I have my ESP32 modules. My curtains are about 20m away from Homey as Homey is in my lounge, and the curtains are now in a bedroom, so the signal is too weak for Homey.

AdyRock commented 2 years ago

Just out of interest, what is the firmware version of the curtain bots? Mine are on v3.2.

RS792 commented 2 years ago

Happy to give adddtional inputs. I actually have two different versions, v3.1 ("Curtain 1") and v.3.5 ("Curtain 2"). And I am experiencing similar issues for both unfortunately.

20 meters sounds impressive. Just using my phone and BLE I can use the curtains everyone throughout my apartment, but the Homey just 3 meters away is struggling.. I'm a curious, these ESP32 modules. I presume these are like extenders for BLE? Are these "out of the box" so these are easy to use for people without too much technical expertise? Price?

AdyRock commented 2 years ago

ESP32 modules are generic processor modules. I have the code in GitHub to program into them but it is quite complicated as you need to install the Arduino IDE and modules. There are instructions on how to do it in the readme https://github.com/AdyRock/SwitchBotBLEHub

The modules I recommend (as I have them so it's tested) are https://www.amazon.co.uk/dp/B08DR5T897/ref=cm_sw_em_r_mt_dp_1JMZDAYK05AJWEYVM1HS?_encoding=UTF8&psc=1 Which are currently £24 for a pack of 3.

Once the modules are programmed and connected to the same WiFi as Homey, the app will automatically detect and use them. They are especially good for use with the contact and motions sensors as they report to homey in 1 or 2 seconds.

AdyRock commented 2 years ago

Haha, I just realised I was thinking in feet but put meters, so make that about 6m. But, there is a floor and two walls in between, hence Homey can't reach them.

RS792 commented 2 years ago

@AdyRock thanks for all the inputs, much appreciated!

I'm not really a techy, but I am a quick learner. Last saw anything similar to the ESP32 was when I was switching out components in my laptop, well guided by a YouTube video that is.. getting these ESP32 modules up and working I am presuming they will need to be connected to something else as part of something bigger (as the modules cannot simply be plugged into the wall). Would you be able to direct me to a good guide to get me starting? Or would you rather recommend simply adding a SwichBot hub?

Any inputs would be highly appreciated.

AdyRock commented 2 years ago

The guide I linked to above explains the steps required to get up and running. If you have any questions while going through that, then just ask, and I will do my best to help.

Once the module is programmed, you just need a normal USB phone charger to power it and a box to put it in. I can provide an Amazon link to a box if you want. So basically, once programmed, the box connects to your WiFi and passes BLE message to the app. If you are interested, I can supply one all programmed and ready to go, but depending on where you are, the postage cost will probably be more than the components.

RS792 commented 2 years ago

All depends on cost (and curiosity) right? ;)

both options could be interesting to hear more about. What would be the cost of the box? And if sending the entire thing to me in Norway, what would be the cost of that? singe you were referencing feet above here i an guessing somewhere in the UK, but i could be mistaken.

AdyRock commented 2 years ago

These are the boxes I used Box. The modules fit snuggly inside and I just had to put one hole in the end for the power cable to go through. 20220204_073058

Cost

Module £9 Box £5 Delivery approximately £20 (UK to Norway). I'm not sure if you would need to pay local taxes and import duties and I wouldn't be able to provide any warranty.

So, as I thought the delivery is more than the components :-) The only other thing you would need is a USB power supply (phone charger) and a micro USB cable, but it would be easier for you to get those locally so it has the correct power plug and doesn't put the delivery cost up even more.

I don't know how much the SwitchBot hub would be in Norway (£29 in the UK), but it might work out cheaper.

Pros and cons

SwitchBot hub:

ESP32 module:

Summary

As a DIY project, it is a solid and economical solution, but as a supplied option the cost of postage makes it less attractive.

RS792 commented 2 years ago

@AdyRock Love the dedication and the length of the response! Much appreciated.

I think your estimates are very accurate. In terms of the SwitchBot Hub, it more expensive here, just short of £40. All things considered I am leaning against the DIY option, simply for the sake of trying something new and also for the local access.

In terms of the ESP32 module, are there large differences from the various brands? I am thinking if I am able to source something from a local store/website I could potentially wave a bit on the delivery.

AdyRock commented 2 years ago

Wikipedia has a good page that shows the main difference https://en.wikipedia.org/wiki/ESP32

The modules I have used are 2.4Ghz dual core with 4Gbytes of flash. The main criteria is the flash as the app is quite large. It will probably run on the single core modules but I'm not sure how well and the price difference is so small you would be better off with the dual core.

The hardest part of the project is gathering the libraries together in the Arduino environment.