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

I had to reboot mine yesterday, so probably a software issue. The only significant change was the update to the obsolete library, everything else was minor tweaks. Maybe the new library has a memory leak.
I will investigate tonight.

1 Like

Memory leak could be a plausible explanation of why this is happening, for now, ā€œresolvedā€ it with a power plug and a flow to reset it once a day :rofl: , but would be nice if you could figure out what is causing this issue :+1:

Hi there,

anyone with the same problem? All of my switchbot curtains stopped working and give the same error: INVALID_GRANT when i try to open them via the HomeyPro app.

Device: HP 2023

Try the repair option on one of the devices.

Hi @Adrian_Rockall , thanks for the awesome app! I integrated a hub 2 and two curtain 3ā€™s into my setup a couple of days ago and noticing that the hub 2 only updates values in Homey every time your switchbot app is restarted. What might be the cause of that? :blush: Thank you!

Sounds like the webhook is not working.
Could you open the app settings page, select the Log tab, set the option to Basic and then restart the app. Once the app has finished starting up, send the Log.

Thank you for the fast response! Just sent the logs as instructed.

I can see the webhooks are being registered successfully.
If you go back to Log and set it to Webhook Information and then monitor it, you should see Information appear when data changes. Note, the temperature on the hub has to change by one degree before it triggers a change.

It looks like they are getting updated independently after this restart! Is there any way to get more granular readings for e.g. the light sensor? Is that updating independently or also dependent on the temperature change? The SwitchBot app shows more intervals.

If registering with matter instead of the webhook via this app, would the reporting intervals increase? Thank you!

I havenā€™t had much luck using Mater with SwitchBot. I found it very difficult to pair and then it keeps breaking the connection. I donā€™t know if itā€™s Homey or SwitchBot or just Mater is still flaky.
When you have the SwitchBot app open it gets updates via BLE if possible and only falls back to the cloud if that fails.
The webhooks update when SwitchBot determines they will, so no control over that. For the best experience, I suggest getting one or more ESP32 modules and install my code on them. Typical update speed is about 1 to 2 seconds after a change in any value. Setting up the ESP32 is not simple though, but thatā€™s what I use.

thanx but this doenst work. same error. invalid grant.

one pair of curtains i deleted already to connect them again. same error.

The error message means the security token used in the call is not correct. Normally, thatā€™s because it has expired.
When you used the repair option, did you see the SwitchBot login screen again?
Are you using an email address to login to SwitchBot or a Google account?

All clear, thank you Adrian!

I have found the main memory leak, which is caused by BLE discovery items hanging around.
I am now trying to track down a smaller memory leak.
I have also added checks for failed memory allocation and allow the watchdog to reset the system to recover from memory drain.

The downside of my changes is I have switched the ota library as the old one is not compatible with the latest Web server library. So updating will be a little bit more complex.

As soon as I have documented the update I will let you know, but I thought I would keep you updated on progress.

1 Like

Thanks for the update :+1: For me it would be fine to update by just reinstalling, using the 2 methods as described on the Github page. So if you need any help testing feel free to let me know and I will just do a reinstall :+1:

Hello dear community

I have tried to use this app before but gave up. This time, I have a scenario where I actually would need the Switchbot Hub, thatā€™s why I tried to use the app again.

Hereā€™s the issue:
I install the app in Homey, my app on the phone works flawlessly and all the devices are there, just like my IR-devices. So everything works.

BUT: When I try to add a Switchbot device, click on ā€œadd deviceā€ in homey, select switchbot, it takes me to the login-website and no matter how often I try, I CANNOT log in, it always tells me that username or password are wrong. BUT: They are definately not.

I am clueless, I can login in the app, I can login on https://eu.switch-bot.com/ but it does not work in bloody homey.

Is anybody outthere who could help me out? I donā€™t know what information I may provide that could help, but whatever you need, youā€™ll get.

Regards
Nils

Please note the username and password are case sensitive, so you must enter them exactly as you register them.
So far the only issue I know of is with using Google or Apple logins.

Of course, I thought so. And I typed them exactly the way I did when I registered.

In that case I donā€™t know. The authentication is all handled by SwitchBot on their servers so I have no control.
All I can suggest is to contact SwitchBot support via the SwitchBot app and explain that when entering your credentials into their login system it fails. They will probably say they donā€™t support the Api issues, but be persistent that itā€™s their login system thatā€™s failing.

Are there maybe two different servers used? I registered at switchbot EU since I live in Germany and it directed me to that server. When homey redirects me to the login page, it seems like itā€™s a North American server ā€¦ Are they not synced, maybe? So do I need an American account? Could that be the reason? I donā€™t know, itā€™s just something I noticed while trying a zillion times ā€¦just a shot in the dark ā€¦