SwitchBot gets an open API!

Thanks. I decided to hold off for now. I feel like, unless these work flawlessly, this will be an automation my wife makes me rip out.

Driver is working great for curtains and hub.

Will there be additional drivers for the motion sensor and camera?
If there are details needed about those devices, let me know and I will do my best to help.

Thanks.

It looks like the contact sensor and motion sensor are waiting as a request for support in the SwitchBot API. Once those are added by the SwitchBot team, I can add them to my Hubitat integration: SwitchBot Motion Sensor & Contact Sensor API support · Issue #40 · OpenWonderLabs/SwitchBotAPI · GitHub

I would guess that the camera connects differently, directly to your home wifi and to the SwitchBot cloud. What are you hoping to do with the camera?

For the camera right now, nothing. However, I suppose it depends on what could be made available with the API. (I haven't set the camera up yet, but suppose it is WIFI as you suggest. I will connect a plug to control it's power.)

I am more interested in the motion and contact sensor being added to the driver and accessible via API calls. Thanks for the link to the issue. I'll monitor here and there as well.

1 Like

Hi I purchased Smartbot Curtain
Firstly.
Can the bots work without the WiFi hub on hubitat?
Secondly.
I would like to integrate them and use them with hubitat, but don't know how to do any of it as I'm not very good with this stuff!!

I've done all of this below bar the very last part as I have'nt a clue

  • In the Drivers Code section of Hubitat, add the switchbotSystem, switchbotBot, switchbotCurtain, switchbotIRDevice, and switchbotMeter drivers.
  • In the Devices section of Hubitat, add a New Virtual Device of type SwitchBot System
  • On the configuration page for the newly created Device, enter these details and then Save Preferences:

It's like I need a step by step guide on how to install drivers and adding new device and get it working for me through hubitat.
I'm clueless to be honest
Regards John F

Hi John, welcome.

You can't use the SwitchBot Curtain directly with Hubitat. You need to pair it to a SwitchBot hub, which requires internet/cloud access, and then interface it to Hubitat via the hub.

Beyond that, can you give more insight into where you are running into confusion? From my perspective, that is a step-by-step list.

Go to the Hubitat web interface for your hub. Complete the steps in Drivers Code, and Devices tabs as described. When you create the Virtual Device, you can then load the device page for that device in Hubitat (in the Devices) section and enter the Open Token. You have to get the Open Token from the SwitchBot app, using the steps described in the GitHub article in the link.

EDIT: one other note - I encourage you to pair the curtain device to your hub and make sure it is working in the SwitchBot app before you try to use it in Hubitat. If it doesn't work in the SwitchBot app, it won't work with my Hubitat integration.

Maybe this guide will help: How to Install Custom Drivers - Hubitat Documentation

Thank you Tom
So are you saying I need to install the smartbot hub first on the smartbot app and then link it up to my hubitat hub?

Is this what this means?

An SwitchBot app feature that 1. enables SwitchBot products to be discovered and communicated with third-party services voice control services, 2. allows users to create customized smart scenes and Android widgets. For BLE-based devices such as Bot and Curtain, you MUST first add a Hub/Hub Mini/Hub Plus and then enable Cloud Service on the Settings page in order to make use of the web API!

So with the smartbot hub hooked up to my hubitat hub, would I then be able to automate my smartbot devices through my hubitat hub?

You need to install the SwitchBot hub and pair any SwitchBot devices to it. You can tell that everything is set up correctly by confirming that the devices work correctly when you control then using the SwitchBot app.

Once they work in the SwitchBot app you can then install and use my Hubitat integration, which talks to the SwitchBot cloud to access all of the devices.

i love the integration for my curtains you did a great job. I was wondering if there was any way to get the battery status from my switchbot curtains to show up in either my dashboard or by using notifications so i know i have to charge them soon?

1 Like

Thanks -- I'm glad it is working for you.

Unfortunately the battery status is not in the status reporting provided by their web API, so I can't add it to this integration unless they add it to the API someday.

1 Like

Question for the group -- The SwitchBot team just added new API documentation for their motion, contact, and color bulb devices.

I am thinking that motion and contact are not that useful because they still require polling the SwitchBot cloud to check for updates. But they seem easy to add if someone would find them useful.

Color bulb also looks relatively easy to add, and I can see the usefulness of adding it (even with its cloud dependency). But I can't find one to buy anywhere, so I can't tell if they actually exist yet in the wild.

Summarizing: are there any requests from Hubitat SwitchBot users to support these devices?

I am absolutely not interested in any Cloud-based services and specifically for the HA.
Currently I am using 5 Switch Boat Curtain rollers with yours drivers.
My BIG dream is to get rid of this Cloud ASAP.
So, it will be extremely nice and helpful if Switch Boat can/will release Local API

2 Likes

For the motion and contact, could they change that later? I say add it.

1 Like

Hi @tony4mikki , I saw your post here: SwitchBotAPI Driver for SwitchBot Bot - #49 by tony4mikki

If you installed my drivers using HPM, make sure you installed the optional drivers for each device type that you plan to use.

If you have a SwitchBot System virtual device configured, you then have to click the createChildDevices button. That should create a SwitchBot Meter child device for your HT meter.

I just tested my meter and it is still returning readings as expected.

Hi tomw,

I would appreciate the motion and contact drivers if they are straight forward to write.

I am looking to use the motion sensor from the switchbot door contact to turn on lights in the hallway when movement is detected between certain hours. Currently the switchbot app only allows any motion from this sensor to trigger another switchbot device, whereas I want it to trigger a zwave or zigbee device instead.

I tried a workaround which I have in place with the switchbot standalone motion sensor where when it detects motion, Alexa is alerted and then Alexa triggers the zwave and zigbee devices via Alexa/Hubitat integration. Unfortunately the same cannot be done with the switchbot door contact and Alexa as it does not differentiate between the motion and contact functions of the switchbot device.

Many thanks,
Keith.

1 Like

I could add the motion and contact sensors using the cloud API, but I have held off because I'm worried about the responsiveness and likelihood of missing events (due to the cloud polling required). Switchbot is able to support the types of use cases more effectively that you described because they would be able to see each event on their cloud backend and drive the automations from there.

There is a official local API now that could make their BLE devices a lot more useful for integration with Hubitat, but it would require a separate BLE-capable Python host (like a Raspberry Pi or always-on PC) on your local network. Is that something you would consider using?

Edit: I'll also note that there are plenty of cheap Zigbee or Z-Wave sensors that work well totally locally and don't have some of these external requirements or concerns. So, unless you rely heavily on the SwitchBot automations support in their system, those other devices might be a better option.

It would be nice to have local control of the SwitchBot Curtain.

1 Like

Did the Humidifier change?
I have one but am not able to add it as a child device.

I turned on debug and see this in the logs:
[debug] createChildDevice() failed: Device type 'SwitchBot Humidifier' in namespace 'tomw' not found
[debug] device = [deviceType:Humidifier, hubDeviceId:000000000000, deviceId:xxxxxxxxxxxx, deviceName:Humidifier, enableCloudService:true]
(deviceId obsfucated)

To be thorough, it also finds the Hub Mini and Indoor Cam too.
Those return as 'not supported' which I believe is expected:
[debug] createChildDevice() failed: deviceType not supported
[debug] createChildDevice: deviceType not supported)

The Humidifer (and other child devices) are optional components in HPM. Did you select them when you installed (or copy them manually if you did not use HPM)?