SwitchBotAPI Driver for SwitchBot Bot

Apologies for the noobie question, but I just got my first (and likely only) bot and just realized it was only bluetooth. So I suppose I need the hub to integrate it with hubitat, but curious if I am able to use something more universal like the Bond or Broadlink instead of the bot one..?

The Broadlink is IR and RF only, no bluetooth.

1 Like

@toffehoff is there anyway to pass the battery percentage into HE? I have a Webcore piston that checks battery levels and it shows all my bots as 0%.

Hi @bpgd486 , interesting question. It would be an interesting feature for sure. However, this battery percentage value is not send back from the hub using the local api :slightly_frowning_face: So, unfortunately no....

1 Like

Didn't realise it was local :grinning: cool. As the battery is of lower importance, couldn't the remote API be used for that?
But then for me when it comes to the battery life of my meters they were showing zero bars for months before they died.

Oh wait, sorry @damianm, I mixed up to different tools. The driver is using the online switchbot API via api.switch-bot.com. Sorry for the confusion.

So the API just is not exposing the battery percentages that can be utilized in your driver? Anyway to use webhooks or something else? Not a big deal but this is the only device(s) that doesn't report in HE.

Unfortunately the battery percentage is not exposed by the API. I don't know of any other alternative ways to get this value. Sorry.

i Realize this is a old post but i'm trying to get the switchbot meter ( with temp and Humidity ) to work with hubitat but i'm not having much luck, i can get my device id for both the hub and meter but all i can get is commStatus : good with no other data,or i can get humidity and temp displayed as unknown but then comms says error.

can someone please tell me what i'm doing wrong

Tony

Hi @tony4mikki . Thanks for you question. There are two drivers for switchbot. Mine (this thread) is a lightweight driver for the Bot only. If you have questions about the driver which also supports other device, please ask them in this thread.

1 Like

I’ve ordered a SwitchBot contact sensor to try this method. Will give me fully local in HA, then I should be able to get the entities to sync with HE using Home Assistant Device Bridge.

No need for this. Just a project for fun.

1 Like

the windows CMD doesnt recognise the curl command.

Hi @zsolt.toth.39, just a couple of things to check.

  • You are in the Command Prompt window where you see C:\Users<USERNAME>

  • Do the curl command by just typing in curl followed by an enter.

  • If you see "curl: try ...." then the curl command itself works.

  • You have copied the whole token from the Switchbot app. Note, the token is one long string.

  • In the curl-command, replace (including the <> signs) with the token.

  • Make sure the whole command is just one line (no new-lines or enters)

Hope this helps.


So as you can see windows command prompt doesn't accept curl.

try

%SYSTEM32%\curl…

thanks , but didnt work

Are you running Windows 8? You may need to install curl yourself: curl - Download

Under Windows 10 it should be at c:\windows\system32\curl.exe

I agree. However, his screenshot says Windows 6.3.9600, which seems to correspond to Windows 8.1.

1 Like

Missed that :sunglasses:

1 Like