Hi all,
Recently SwitchBot has released their SwitchBotAPI.
I've created a small driver to control my Bot devices directly from my HE7 hub without IFTTT.
Personally, I would have loved to be able to interact with my SB hub directly, so I would my home-setup run locally. But alas.
On a positive note, using the SwitchBotAPI (instead of IFTTT), does make the bot respond significantly faster.
To all: I just did a small update to the driver so the on/off command will only be sent to the SB-API when there is actually a change in the state of the switch.
@damianm There is an instruction on how to get the token (you first need to get the app in developer mode), you can see it in the README. If that does not work, you can send an message to support of SwitchBot requesting your token.
I ha e the iPhone app and was able to get a token no problem. I have added the driver in to hubitat also. I’m just wondering how to add the bots into hubitat.
Hi @PhilDeez, @jim273. To add a bot to hubitat, you need to create a new virtual switch device. Once you have created the virtual switch, change the driver to the switchbot driver and update the device. Then you will see the three parameters (OpenToken, DeviceID and Press/Switch mode).
To get the DeviceID, I've mentioned a curl command in the README you can use to get these.
Hope this helps!
I also have a switch bot humidity sensor that was triggering a exhaust fan thru iftt. Is there anyway to bring that directly into hubitat using this driver?
It's a different driver, but I wrote support for H&T, curtain, and IR remote support (in addition to Bots). It's discussed and linked to in this thread and is also available on HPM: SwitchBot gets an open API!
Hi @PhilDeez,
I've only implemented the bot-devices (since I only have those). If you'd like to add other type of SB devices, I'd suggest to have a look at the driver tomw built.
Hi @_RiC, thanks for your comment. You're not giving me much to work with for me to understand why it is not working for you. But, if the other driver does work for you, that is also a solution
It's weird the status changes from on to off, everything works it's connected to the cloud, if I use the bot ID with "...." with quotes the debug in the log says it's wrong so everything is setup correctly. But the bots don't do anything. While the other app I posted works. But I only used the your driver app did I need something more?
The on/off state works but the push doesn't do anything if I push it.
So I needed the drivers from the tomwnpublic? Because now it works, I just tested
Mine and @toffehoff drivers are separate. You don't need both if one works.
What mode do you have for your Bot in the SwitchBot app (switch or press)? What mode did you select in @toffehoff's driver? I noticed that some commands take effect and others don't in various modes, so it is important for these to match.
If you only plan to use a Bot and if you can get @toffehoff's driver to work it is great because it's super lightweight- all is contained in one driver file that is easy to keep up to date. Mine is needed if you have multiple device types (curtain, IR, Bot, HT, etc) and is useful if you have a large system, because it helps you with some of the device ID management.