SwitchBot gets an open API!

Trupid question now tath I ordered a couple of Tilt devices on BF deal.
Looked like the driver was direct toHE but now I'm wondering if I need the Hub still?
Back to the 380 posts for some hint.

You can't connect them directly to Hubitat.

You can use a SwitchBot hub and a cloud-based integration like the one discussed in this thread. That is probably the option with the most "out of the box" experience.

Or you may be able to use a third party hub and get a local integration, for example with Home Assistant and a hardware configuration that their integration supports.

Thanks. There is a Hub 2 (overkill?) and a Hub Mini.
Looks like the mini is fine as I just need the cloud for the API?

Looks like, ordered from the Jungle website.

Yes, either hub is fine. I'd get whichever is cheaper.

Where would I begin troubleshooting if my integration suddenly stopped working for all devices in hubitat? I can control everything normally in the switchbot app but nothing responds in hubitat. I had multiple curtain 2 devices that were working perfectly for the past several months.

Thanks!

I don't have a good guess offhand.

Please enable debug logging on the SwitchBot System virtual device and save. Then press Initialize and send a PM to me with the output from Logs.

Well, I have had some issues that I'm trying to resolve. I used HPM to install the integration. It did not install the SwitchBot System. So I downloaded that from GitHub and installed manually. I was able to get the token and secret from the iPhone app and comms are good now. It created SwitchBot Hub2-meter and I can read the temp and humidity from that. But, what I'm really trying to get figured out is the curtain 3 bot. It did not create that child device. I think it should work, but doesn't. Gotta admit, I'm finding this integration difficult to understand.

Here's what I'm seeing in the manually created system state.

Any help would be much appreciated.

The Curtain 3 does not work correctly with their API. It was discussed a bit earlier in this same thread. If they fix that issue, I think the Curtain 3 will begin working with my integration.

I'm not sure what might have happened with HPM. The SwitchBot System driver is marked as required and it should not have installed anything else if that didn't work. I'd advise doing a Repair of the package in HPM.

What else is confusing? Have you checked out my readme on GitHub for setup and usage instructions?

Yes I read it. Nothing in there about getting a token, finding the secret password, creating child devices. Had to figure all
That out from breadcrumbs in this thread.

About my curtain bot 3. My best option for automation? Alexa?

That is all described in detail in my readme on GitHub. If you see any important steps missing there, please let me know.

I haven't used it personally, but the post I linked to in this thread says that you can create a scene in the SwitchBot app and then activate it using my integration. I thought that was a clever suggestion from @fredpd to work around their API bug.

2 Likes

All the info about token and secret password are linked to in the Git under this line:
"On the configuration page for the newly created Device, enter these details and then Save Preferences:
Your Token and Secret Key, which can be acquired as described in the SwitchBotAPI reference: GitHub - OpenWonderLabs/SwitchBotAPI: SwitchBot Open API Documents"

Regarding automation, Yes, Alexa and Switchbot can talk to each other, so that would work.

Earlier in this thread they talk about setting up an open and close scene, and then that can be used in Hubitat Rule Machine

Lastly if you use HomeKit, you could also use matter if you have a Hub 2.
https://support.switch-bot.com/hc/en-us/search?utf8=✓&query=How+to+set+up+Matter+with+SwitchBot+Hub+2

2 Likes

I think I must have found the wrong GitHub entry or something. This morning (busy day yesterday) I did an HPM matchup and it found the latest version of the code and updated it. Anyway, now trying to figure out how to use scenes. Thanks for your help.

2 Likes

For scenes, you have to first create the scene in the SwitchBot app on your phone. Select the devices you want and enter their desired states (open, closed, on, off, ...).

Then go back to Hubitat on the SwitchBot System device and hit Initialize to update the local cache of scenes and devices info.

Then refresh the browser page in Hubitat and your new scene should show up in the list. Note its ID number and then try that with the executeScene command on the SwitchBot System device.

1 Like

I really wish SwitchBot would just update the API for Curtain 3. It's a TINY CHANGE (needs a device type listing) and it's been on their issue log for months. Its super frustrating to have to use all these work arounds.

1 Like

Got everything setup and it works fantastically well. H/T to @fredp for coming up with the workaround. I'm all set now. I only needed 3 "scenes" anyway. Open all the way, Open Halfway and Closed. So now I'm in business. Thanks to everyone.

1 Like

I got things working again by re-adding the child devices. Not sure what happened. I did have to rebuild my rules though.

Thanks

1 Like

I got my Tilts working and they are great. I paid 1000.00 CDN for 5 iBLinds and these were 50.00ish on BF! One quarter the price if you don't care about the installation being hidden.
WIfe says they stand out (her only care) so out came the brown spray paint to "match the drapes" :rofl:

I wish the motion was 0-100 (open - closed) not 99-0 up and 99-0 down, that's weird.
I also got stumped on the install until I found the Github readme. :slight_smile:
They also need to tell you not to add the solar panel until the are fully working but I found a comment to just remove/re-insert the connector and the battery reporting started.

@tomw
Can the driver also provide battery status?
I only see it in the app but I would like to add that to my device check app for possible recharging in the winter.

Last time I checked he said it still wasn't supported in the API.

Driver reliablility question @tomw
I have my new tilts working on a WebCore piston along with my IBlinds drapes.
I have tried multiple delays to stagger the Open commands, up to 10 seconds, for the tilts but every so often one of the 2 will fail to Open or Close. I have to use the app to fix the failed operation.
Is there a bit of a secret to a successful command push?

Cheers.