I agree to use the API, but I think it shouldn’t replace bluetooth completely.
I have four SwitchBot Meters. Since the number of the API calls is limited to 1000/day, I reach it when I obtain the value for each meter every 5 minutes. This limitation is tight because I might add more meters and need to retain the calls for other SwitchBot devices.
Therefore, in my implementation, I try Bluetooth first, and then call API if Bluetooth fails. By this way, unnecessary API calls are suppressed and API calls are used for only devices that Bluetooth cannot reach.
Yes I completely agree with using api. Would be great if an official integration option existed like that.
I currently have to use smarthings integration as a workaround to control Switchbot with HA (Switchbot is integrated sith smarthings)
But Smarthings is only syncing automatically once every 6hours with Switchbot which is annoying especially for thermomters
Yes but with Bluetooth we have distance problem. I cannot get all my meters temperature and humidity using bluetooth.
I totally agree the rate limit is bad for meters, looks like Switch-Bot have not taken them in account when deciding it. The best for that is to hop for them to create a local API, with no rate limit or to contact them to suggest to have a higher limit.
If it was possible to use the BLE mesh network Switch-Bot use Bluetooth could be used without problem for me. But it is not the case or I have not found how to do so.
I’m trying to use the API through curl to control my curtains. Bit messy, but should do the trick. This is what I’m sending to close one of the curtains
But…nothing happens at all. I’ve tried turnOn/turnOff and setPosition. The API sends a ‘success’ response everytime, without anything happening. Any idea’s on what’s going wrong?
If you have two curtains opposite each other covering one window, it’s easier if you link them up so they act as one.
Find out the deviceID of the curtain you want to control by running the following command on the Windows command line. In the output you should see the identifier of your curtain
Thanks for this! I was struggling with range so using the API has worked a treat.
Although based off your work I was the able to set up using a template cover.
And I have managed to get setPosition working as well
That’s so much better than what I managed to come up with. Very cool I would increase the scan_interval though, there’s a 1200 requests/day limit. With as 60 sec interval, you’ll cross that.
But I keep getting a unauthorized message…But i am sure the api key is correct. Did they change the version or does it take some time for the api key to be validated?
This is great everyone. I’m having a hell of a time trying to get switchbot curtains integrated and this gets me very close. I followed the configuration provided by @gdeboos and i see the integration and can interact with it. However, it only closes the shades and the open is greyed out. Also, when using the slider, the switchbot kinda clicks and then does nothing if setting it to completely closed. Additionally, the Curtain position never changes, even closed its stating 100.
The slider seems to work and the open (up arrow) button but the close (down arrow) doesnt seem to work. Additionally when opening with the arrow button, the position (slider) doesnt change so i have to slide it back and forth for it to be in the right position
I see different configs here… which is the one that would work best? Any chances of a structured summary as in “this goes in secrets.yaml and this in config.yaml”?
Note that in the above example ki_coffee_machine is what I named my SwitchBot entity.
Basically, I just cleaned the code for all the curtain specific stuff. I’m not smart enough to tell whether or not a template is even needed at this point but I’m satisfied that it works well for now.