SwitchBotAPI Driver for SwitchBot Bot

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

Thank you very much Tom

1 Like

in the returned curl command i can only see the hubs id but not the connected bot id but an interesting line: enablecloudservice: false, thou i can see the cloud icon on the hub and the bot as well.

Nice work. Worked first time on a Mac. (Terminal)

"we've now added our SwitchBot Meter Plus interface and a related description"

My driver integration has Meter support, and if I'm reading the updated API reference the only change I'd have to make is to update things related to names.

Does anyone have a Meter Plus that could help me work out the kinks? Drop a line or PM in the other thread that I linked to.

1 Like