New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Local API Support #19
Comments
If you won’t develop this, then please publish the calls to the hub so that the community can do it. |
Give us local control! No cloud! |
A local API would be essential. |
I have written an app for the Athom Homey to integrated SwitchBot devices into users home automation systems. Currently the app has nearly 300 users but I get many that are disappointed by the slow response of devices due to the rate limit. Most users have at least 2 or 3 SwitchBot devices that need to be kept up to date and as the limit is on the total number of calls and each device needs one call to update it, it means each one only gets updated about every 5 minutes. |
Can we hop an official answer from Switch-Bot on this subject? |
Hello keen developers, this is Davidson from the dev team. We are aware of the needs for having a local API and the merits of it Unfortunately we currently cannot promise anything about it because tbh with you our dev resources are fully occupied with the R&D of new products and the maintenance of the app. We encourage you guys to find alternative solutions at this point but we will continue to keep a close eye at the community. Thanks! Davidson, SwitchBot Team |
And what would you suggest as an alternative solution? The rate limit on the current alternative solution (the official API) is crippling. It wouldn't be so bad if the rate limit was per device or there was an API to retrieve the status of all devices in one call. |
The alternative solution is to throw your switchbot devices in the trash and buy something that uses Zigbee or Zwave |
Sorry for my English. |
if anyone is looking for a local solution for bots/curtains/meters and you have an esp32 (about $5). no switchbot hub needed. uses MQTT and now supports HA MQTT discovery https://community.home-assistant.io/t/switchbot-bot-curtain-meter-mqtt-esp32-bridge-local-control |
fully aggree, so we have enough developers to maintain a useless cloud with rate limit of 1000 calls a day but not to ensure a device I bought in my house can be controlled locally without limitations. I am currently. developing integration to smartphone systems for SwitchBot and will finalize it for cloud api but will not support any consumers as this limit is, sorry to say that, absolutely ridiculous and absolutely moving the device from a 9-10 start rating down to 0 @Minsheng The device here will been returned right away due to this limitation In addition to topic startet, please (if local api come available) make it smart and support WS (web services) not only mqtt for integrations in other solution a stable protocol is needed with proper communication and that's not MQTT or a polling API |
Thanks for your message about your current load :). Will wait the news then about a local api support through the hubmini who knows... Regards, |
Just to let you know that in May 21 I got the following response from the switchbot twitter account: I'm indeed sending at least 5000 request every day from my domoticz installation to all my sensors and curtains. |
Hey folks. I wanted to bump this as 10000 requests per day is a great step forward for the cloud offering but I'd still like to be able to work with local control as right now the latency for closing my curtains is very long. |
Just wanted to add my support to us all having a completely local (no cloud) API for Switchbot |
+1 for local api support. Would reduce demand on switchbot servers as well |
SwitchBot products are scorned by the home assistant and home automation communities because of these limitations. Do you not realize how much your sales would grow by working to allow your products to have greater user control through a local API? Is it really practical for you to run Cloud servers with users needing to ping the Cloud API nearly 10,000/day? |
would definitely be more keen to buy the new blind bots if there was a local api, but i've got the hub and meter and a couple of curtain bots currently sat doing nothing because they're just not reliable enough via cloud |
@Minsheng given that this thread is nearly 2 years old now, do you have an update on this? It looks like the Home Assistant community has managed to implement local control for some devices, however some such as the smart lock and keypad have not been implemented. Smart locks in particular is kind of device that people don't like exposing to the Internet via 3rd party servers if it's not necessary. There is not much effort required from Switchbot, just to provide the relevant tech specs. It would be very helpful to provide HA developers with the information they need to build these integrations. There are over half a million users of Home Assistant now so it's something worth taking note of. |
I have been keeping an eye on this thread as well as the need to build local API. Some of our developers had internal discussions about this. Our marketing teams, who have closely collaborated with the community and KOLs, have also approached me regarding better integrations with Home Assistant. Many of your opinions are valid and I myself agree with you as a developer and consumer. We haven't come to a conclusion to when and how we will support local API control just yet, but we will definitely keep coming up with more updates. |
Local control would be great so automation can continue when the Internet connection is down. |
@Minsheng that's great to hear it's still on your radar, thanks for the update! |
@Minsheng - great to hear, and please don't just think about Home Assistant - the use goes way beyond that. A local rest api can be integrated into so many things. I for one build my own plugins for ezlo/Vera and openLuup, and I'm a big user of NodeRed too. A number of use cases around home automation I see are at holiday homes where internet can be patchy, but they need to know somethings are actively being monitored and responded to. For a company that provides door locks, temperature sensors, curtain openers etc. - your missing out on a load of off-grid places (by choice or circumstances) who can't use SwitchBot.. |
Just adding my voice to the local API. If they can start with Home Assistant, then at least there is room to build out from there as Home Assistant does use pretty standard API's, including REST APi's. Anything in the direction of local control is a good step. |
Finally Home assistant implemented BLE control for switchbot locks! it is available in the 2023.1 release.. I wasn't expecting that.. after the upgrade.. boom! the lock shows up! |
The good thing with Switchbot is you don't need the cloud API because it also has BLE so Home Assistant can grab it all via BLE as does the Switchbot app. I think the hubs can work locally via BLE, but that really makes little difference given the app connects BLE also |
@austwhite do you have any references for this? My understanding is the Hub Mini cannot be used locally for it's IR functionality. |
I don't use the IR blaster function, so can't comment on that. But I know I have to enable cloud for the individual switchbot devices I have for the hub to connect to them, otherwise the app just connects directly For BLE devices, yes the BLE devices use BLE to connect to the hub, but the app seems to use the API to connect to the hub, at least with the hub mini that I have. Can't comment on the newer hubs as I have no experience with them as yet. Sorry for my confusion on the last comment. I didn't quite finish my sentence properly. Brain fart. |
I use ESP32 modules running my own code |
Hi Andy, would the esp code be available? I just started with a homey pro 2023 and also have some SwitchBot products, so very interested. Able to compile the esp32 code myself if available. |
Yep, it's in my GitHub repo https://github.com/AdyRock/SwitchBotBLEHub. |
I use https://github.com/1technophile/OpenMQTTGateway/ to control my SwitchBot Curtains without the offical hub. Works fine for me. Reading is supported out of the box and you can send also send commands (see 1technophile/OpenMQTTGateway#1412). The biggest advantage is that many other devices are also supported. Maybe someone will find this useful. |
Either the api limit needs to scale with number of devices purchased or pay for be api limit if local api is never gonna happen. having 30 devices I can only poll like once every 5 minutes is pretty stale… |
Maybe a web hook can be a solution? |
I do an annual checkin on this issue to see if SwitchBot stuff is ready to buy yet, guess not yet. Cobbled together and reverse engineered Bluetooth command support that can disappear at any time is not adequate. Maybe next year |
The BLE API is official: https://github.com/OpenWonderLabs/SwitchBotAPI-BLE |
There are other technologies, i.e. YoLink use MQTT, ESPHome use EventSource, etc. |
You forgot to quote the part of my comment where I told a real local API would be better 😄 |
I totally agree. Just from my experience with these companies, if they against Local API for any reason (hopefully temporarily) - some kind of Server real time event is better than polling. I.e. YoLink MQTT status updates work fine (assuming internet connection works). BTW, YoLink polling rate limiting is much better - it only limits within 5 minutes, unlike SwitchBot - where once you hit the limit - you have to wait for a new day, which sucks. FYI, I'm the author of HomeSeer integrations |
Webhooks are available for a lot of things, but there are still key events that are still missing from the specification. |
Exactly right, @archer007. And their bloody GitHub bot closes issues as
"completed", after only 10 days of inactivity.
It's a great way to falsely make it look like you don't have any bugs. Quite
slimy and underhanded.
It has so much potential, but based on what I've been seeing in this repo over
the last year, we aren't buying either. It's just not trustworthy as it stands.
|
Three years later. Hi @Minsheng Davidson - any update? FYU - I'm the author of HomeSeer SwitchBot integration https://forums.homeseer.com/forum/hs4-products/hs4-plugins/lighting-primary-technology-plug-ins-aa/ak-switchbot/1620351-new-switchbot-plugin-using-latest-switchbot-api-v1-1 And I'm telling you - without the local integration you are just loosing sales big time. First question HomeSeer users ask - is it Local or Server? And then - "No, thank you". At least, without Local integration you should implement some real time status notifications which doesn't require port forwarding - i.e. YoLink using MQTT. Polling just doesn't work given the rate limiting. [EDIT]
You should set priorities right. You have good enough range of products. By adding Local API you will increase your sales 100 times. Then you can afford R&D of new products. |
Any update on this would be great. Even a non standard local API through wireless LAN would be enough and greatly appreciated. |
I urge you to add a local API! |
still no local API? wow ... |
In case somebody finds this helpful: I can control my switchbot lock pro locally using using Home assistant + Matter + switch bot hub mini.I think switchbot are adding matter support to their other products via firmware updates. 1)Install Matter add on in HA and Matter integration in HA |
How do you enable Matter on hub mini? Hub mini does not support Matter. Only Hub 2 can support Matter. |
You will have to enable Matter for the Hub Mini from the switchbot app. Under hub mini settings. |
Unfortunately, this feature seems to be available only for the newest version of the hub mini that is "Matter enabled". |
That is a shame with older hub mini's. Nevertheless I think Matter is the route switchbot seems to be going instead of a proprietary local API. They other way I can think of local control of switchbot devices is by using ESPhome Bluetooth proxy + HA. |
@am2pgs @MrXANA91 Well, this almost guarantee they're not going to upgrade the firmware for the old hub mini because that will impact the sale of their new one. The hardware of the old and new ones are probably the same, only the firmware is upgraded. |
I think Matter requires "Thread" chip? |
@am2pgs can you utilize the IR functionality of the Hub mini using matter? |
I don't use the IR function of hub mini. But I just tried adding a random TV remote to hub mini, and it shows up on matter as a single on/off switch on Matter/HA. Not sure if I M doing something wrong. |
No. Matter support multiple PHY standards. Thread is just one of them. WiFi and Bluetooth are all supported by Matter. |
Is your feature request related to a problem? Please describe.
It's extremely important to control this hub and products locally (preferably via mqtt or http). Having cloud dependencies doesn't work when networks go down or companies go under or kill a product line.
Describe the solution you'd like
I'd like to control my devices locally and get metadata about them (firmware version info, current state, etc).
Describe alternatives you've considered
Additional context
From reading I thought you were working on a local api for the hub but it's only a cloud api.
References #12, #13 where I asked a question if this for the cloud api or local control.
The text was updated successfully, but these errors were encountered: