SwitchBotAPI Driver for SwitchBot Bot

Thanks for the advice!

It was definitely an issue with the switchtbot hub mini. I could get the curtains to work intermittently if I connected it to the other switchbot hub with the working curtains (opposite side of the house). I ended up having to reset the swittchbot hub mini a couple times and eventually resetting my wifi network before things finally started working again.

It was definitely strange that hubitat could still see status changes to the curtains though. I could even control the AC that was linked to the malfunctioning switchbot hub. Just the curtain commands were failing for some reason.

Yeah, that is odd.

The commands are a one-time thing, whereas the attributes are refreshed periodically. So my guess would be that it's just a lot more likely that you'd notice a command failing whereas the attributes might just have updated on the subsequent refresh before you noticed the difference.

Anyway, I'm glad it is working again now. :slight_smile:

1 Like

Hello! I bought my first Switchbot bot (the button pusher) a few days ago, to turn on a Rinnai direct vent heater in an external building. I've noticed using the Switchbot app that occasionally it fails to work on the first try, and I have to press the button in the app a second time (seems either the hub doesn't get the command through the cloud, or the bot doesn't receive the bluetooth command, but I don't know which). The actual mechanical button press works perfectly once the little arm on the bot is activated. When it does work, the app says, 'Bingo!", so I have a confirmation that it worked and I've turned on the heat. Is there any confirmation received by the driver, that lets it know the button was actually pushed? I'd like to just set up a tile for my Hubitat device that I use to activate the Switchbot, rather than use the Switchbot app, but I need to know the heat is actually on. Thanks!

Hi @Madcodger, which Hubitat driver are you using? Just check the device type on the virtual device page to be sure.

Hi @tomw . I haven't installed either driver yet, but was wondering if the one you created had this "acknowledged" feature, before I install it. Thanks!

Sure thing.

My integration reflects the Bot status when it is configured in "switch" mode on the SwitchBot side. The SwitchBot API does not report any status (for either state and/or success) when it is in "button" mode, so that info isn't presented in my integration.

I do not know if @toffehoff's integration for the Bot behaves differently or if they are still supporting it.

If you are interested in trying my integration, let's continue the discussion over here: SwitchBot gets an open API! - #17 by tomw

1 Like

I’ve read a few things about the IR devices. I use Switchbot to control my eufy robot vacuum, and although I have the Switchbot IR device driver installed it doesn’t seem to create it as an IR device, any ideas?

Do your IR commands show up under infraredRemoteList in the State Variables section on the device page of your SwitchBot System virtual device?

If so, please enable logging and then press createChildDevices. What happens?

In fact they do not show under the state variables, does that mean the device type is not supported?

Does the switchbot API report battery levels for curtains? It would be great if I could see them in hubitat and add their tiles to my "batteries" dashboard. Also my curtains are all in paired sets so I'm not sure if that makes things more complicated since there'd be 2 separate battery levels per device in hubitat. I can check the levels in the switchbot app but it'd be so much nicer to have everything in one place in hubitat.

Thank you!

No, unfortunately there does not seem to be battery reporting for any of the SwitchBot devices.

Also, to avoid hijacking this thread, let's continue any further discussion over here: SwitchBot gets an open API! - #17 by tomw

1 Like

Hi Tom,

I have several IR devices. I used your IR driver and createChildDevices for those IR devices accordingly. But I do not see " infraredRemoteList in the State Variables section". It's empty! Should I delete them and re-create Child devices again? How can I get the SwitchBot driver to discover all IR commands for all the IR devices?

Thanks,

How do I get a SwitchBot API token?

just found this -

Getting the Switchbot token

Download the SwitchBot app on App Store or Google Play Store. Register a SwitchBot account and log in into your account. Generate an Open Token within the app a) Go to Profile > Preference b) Tap App Version 10 times. Developer Options will show up c) Tap Developer Options d) Tap Get Token.

I just got the Switchbot Indoor Cam.
It is recognized in the system, but I do not have a driver for it.

Any help appreciated.

Creating child devices from main Switchbot system doesnt seem to work, but likely because I do not have the driver code installed?

You couldn't have it installed, because I haven't written a driver for it yet. :wink:

I looked at the API reference, and there isn't much there in terms of status or commands. But it does claim to have webhook (events) support. It looks like at least motion events may be supported.

Are you using my SwitchBot Events app? If so, enable logging in the app and see if you can catch some events in the logs to see what pops out.

Alright everyone, I am brand new to Hubitat and this has been a fun process getting everything in and setup. @toffehoff you are the man for making this API and making it so easy. Your documentation is on point, I'm an IT professional and there are many software development companies that could learn from you lol. Anyways....

Question, I'm using the SwitchBot Contact Sensor, love the sensor and use it for turning on some outside lights. I was hoping there was a way that when I'm done with the outside lights, I could just hit the button on the sensor to turn them off, instead of doing the "exit" action of hitting the button and opening the door. Is that possible and I just havent figured it out, or is this a Switchbot limitation?

i think you mean @tomw

1 Like

@tomw I am so sorry if I've given credit to the wrong person.....

Don't worry @bulltipper . There are two drivers. I've made a very lightweight driver for the Bot device (which is the start of this topic). Separate to that, @tomw made another driver which supports many different switchbot devices. It is a bit confusing, I understand.
Regarding your question about the contact sensor, I assume you're not using mine, but the other driver. Therefore I can't answer that specific question.
Welcome to the club anyways :slight_smile:

2 Likes

@toffehoff beat me to it, but this thread is for their Bot driver which is great.

My thread and integration has support for the Bot plus many other devices including the contact sensor: SwitchBot gets an open API! - #17 by tomw

And just for the record, the API that both integrations are based on is provided and maintained by the SwitchBot team, not either of us. :slight_smile:

1 Like