SwitchBot gets an open API!

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)?

I used HPM. I just went through HPM and modified the 'hubitat_switchbot' to include the Humidifier as it was missing the device driver for it.
That change did the trick! Thanks for the pointer.

1 Like

I added MeterPlus support in version 0.9.10. Thanks @failmatic for your help with testing.

2 Likes

Please let me know if this is not allowed, but is anyone here interested in any or all of the 3 Switchbot curtain robots (rod) in white that I am selling? I also have the grommet kits and solar panels as well. PM me if you are interested. In the Los Angeles area if you want to pickup or we can workout shipping arrangements.

Might get better exposure as its own topic in the Lounge area.

4 Likes

I fell for their email marketing and bought an RGB Strip Light to play with.

Strip Light driver support was added in v0.9.11 of my drivers. If you use HPM, be sure to install the optional Strip Light driver component.

2 Likes

@tomw - first of all, thank you for this awesome integration -- it's a huge win!

I may have missed it on your github, but if you have a paypal for donations, please let me know -- I'd love to contribute for your work here and with Flume!!

I'm excited about the ability to use SB scenes, since my window fan remotes have unorthox buttons... I've got 6 control-related scenes working fine in the SB app and they've all successfully been integrated to HE using your driver here.

I can use the (indicated) "Execute Scene" option below to successfully run a scene.

But can you please tell me how I can leverage/access that same "Execute Scene" capability via RM or Button Controller or something like that?

For the life of me, I'm not able to connect the dots... I'm sure I'm missing something obvious.

Thanks in advance!

Edit - replaced original screenshot since it had some hub/device IDs that I'm not sure were vulnerable or not - better safe than sorry!

2 Likes

Thanks for your kind words. No need to donate to me -- just try to find a way to pay it forward to someone that needs it.

Good catch on this not being ready for use with Rule Machine. You'll have to use "Run Custom Action" to execute this command.

I had to make a quick change (added "Actuator" type so you can select that in Rule Machine). I didn't update the version number, so just use a "Repair" in HPM to get the update and you should be good to go.

I didn't try this myself, but it should work:

1 Like

Perfecto - so much winning! Between this and Flume, you are my hero for delivering on a couple of great API integrations here. Thank you again - your work on these projects is much appreciated.

This switchbot HubMini IR remote integration is allowing me to automate a couple dumb window fans that I wouldn't otherwise be able to integrate at all - I love it.

And for anyone considering a SwitchBot hub or Broadlink RM4 for IR remote stuff, the SwitchBot crushes the RM4 on better range and more forgiving placement options, but this integration is definitely the biggest win!

Thanks again, @tomw!

2 Likes

I got a great deal on Switchbots to finally put them on a few things in the house. I set one up but can’t control it through Hubitat. Do I need to have a Switchbot hub? If I do, which one? Do I need one in every room where a switchbot is located?