SwitchBot gets an open API!

Thank you for these drivers, really appreciate it.
I am not sure how to use Switchbot events or webhooks, so probably not the person to test this...
But, I get an error when trying to add switchbot events. I believe there is no logs as the switchbot events app does not get created?

Summary

image

Summary


The lock worked for me with this updated version of your integration. I noticed the Secret Key as new in the Switchbot Android app and wondered what that was for. Now I know.

Awesome job! Thank you.

1 Like

If you open the Logs window and leave it open as you try to add the app, do you see any additional detail on the failure? Please PM me anything you see there so that we can troubleshoot.

What version of the app opens the new API. I'm showing 6.14 with no way to update it. Switchbot may make some unique devices but their software is utter crap.

6.14 is the required minimum version. You have to tap App Version in the app ~10 times to get the developer options to show up, and then you'll see the token and secret key there.

2 Likes

I've had "Live Logs" window open whilst adding Switchbot events.
Unfortunately, there is no details on the failure.
I am currently running Hubitat beta 2.3.3.117.

Your screenshot shows that the main app page was loaded. When did it actually fail? Was it when you clicked Done?

It works for me in the release version of 2.3.2.x. Does it work for you in that version?

I'll need to find a way to reproduce the issue and get Logs, else I don't know how to even begin debugging it.

Yes, it fails when I click done.

Which version of my SwitchBot System driver and SwitchBot Events app do you have? Just check the revision history in the two source files on your system.

This ended up being a bug in Hubitat 2.3.3.

@gopher.ny fixed it in 2.3.3.122: Release 2.3.3 Available - #3 by gopher.ny

@iEnam, please try the new version again of my SwitchBot Events app. Just uninstall your current version from Apps first.

1 Like

It's working now!
Thanks

1 Like

It has a switchbot hub mini and curtains.
Switchbot system, curtain, and switchbot event were installed with HPM.
I received tokens and secret keys from the switchbot app and input them into the switchbot system device, but an authentication error occurs.
It was the same even if you regenerated the token and entered it.
The app version is 6.14.
What did I do wrong?


Everything looks correct to me, assuming the token and key are the most up-to-date version you have pulled from your SwitchBot app. I sent you a PM with some ideas to troubleshoot further.

Thank you for your answer.
The Switchbot Hub Mini has two Switchbot curtains connected and the cloud service is also on.
I tried initializing the hub mini and reinstalling the app, but it's frustrating because it doesn't work.

I did as I said, but it's the same.
Is the switchbot token value a problem?

I'll write down the method I installed again.

  1. Install hub mini and curtain on switchbot application.
  2. Connecting the Switch Curtain Cloud Service
  3. Tap the app version continuously to receive the token value
  4. Add hubitat driver code and install virtual device (switchbot system)
  5. Enter token value into switchbot system device



Both of your configuration examples look correct to me, and the fact that it falls with both v1.0 and v1.1 authentication methods (using both the old and recently updated version of my driver for Hubitat) makes me wonder whether there's an issue with your SwitchBot account for some reason.

Some users reported authentication errors that showed up randomly and were resolved by rebooting their SwitchBot hubs. Please give that a try if you haven't already.

Otherwise, you may need to contact SwitchBot to ask for any help getting this resolved with your account. Sorry that I don't have other suggestions, but it looks like you are doing everything correctly and it just isn't working for some reason.

Looks like I'm getting hit with this issue as well.. I'll try rebooting their hubs, etc. Can't even get an api key from their app.

Update, it wasn't the hubs.. I'll give it some time maybe their API is down right now. I get a "Failed to load, please try again later" When opening the developer options in the app, or tapping on the "Get Token" button.

I was able to pull a new token and key just now. Maybe give it another try?

1 Like

Yeah I did, no luck.. I opened a support ticket.

I proceeded yesterday because there was a mini update of Switchbot Hub.
And when I received a new token and secret key and entered it, the authentication was completed.
I don't know why it was suddenly authentication.
What's certain is that I updated the Switchbot Hub Mini and it worked.

I wrote a reply because I thought it might help someone.

2 Likes