Skip to content
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

Open
niemyjski opened this issue Jan 7, 2021 · 102 comments
Open

Add Local API Support #19

niemyjski opened this issue Jan 7, 2021 · 102 comments
Labels
enhancement New feature or request pinned pin important issues

Comments

@niemyjski
Copy link

niemyjski commented Jan 7, 2021

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.

@niemyjski niemyjski added the enhancement New feature or request label Jan 7, 2021
@donavanbecker donavanbecker changed the title Add local api support Add Local API Support Jan 12, 2021
@donavanbecker donavanbecker added the pinned pin important issues label Jan 12, 2021
@nigels0
Copy link

nigels0 commented Jan 14, 2021

If you won’t develop this, then please publish the calls to the hub so that the community can do it.

@mvevitsis
Copy link

Give us local control! No cloud!

@Nardol
Copy link
Contributor

Nardol commented Mar 3, 2021

A local API would be essential.
Moreover, with no rate limit as 1000 per day is really poor, especially for meters. Having the temperature updated without the ability to do it even one time per minute is not enough precise. A local API doesn't need to take in account servers charge so it is another argument to make it or to communicate users how to communicate with a Switch-Bot hub (every models).

@AdyRock
Copy link

AdyRock commented Apr 29, 2021

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.
If a user wants to turn on lights when the curtains close via a remote, 5 minutes is a long to to wait in the dark. I am trying to educate users to dump the SwitchBot remotes and use Homey to control everything.
My app also communicates directly via BLE if the devices are close enough to Homey which does solve some of the issues. If Homey is not in range, then I encourage users to buy a £7 ESP32 module and load my Arduino code. That can interface to the devices via BLE and reports back to Homey via an HTTP callback over WiFi.
However, if the SwitchBot hub supported a good local API then I could recommend that instead of the other inconveniences that put users off.

@Nardol
Copy link
Contributor

Nardol commented May 7, 2021

Can we hop an official answer from Switch-Bot on this subject?
To know if it is planned, excluded or something else...

@Minsheng
Copy link
Collaborator

Minsheng commented May 8, 2021

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

@AdyRock
Copy link

AdyRock commented May 8, 2021

We encourage you guys to find alternative solutions at this point

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.
Maybe the dev team could add in a callback method where an address could be registered in the API to post events to. E.g. when a curtain position changes or the temperature measurement changes, send a message to the callback address. Then at least the rate limit would just be for sending commands to control devices, which would be usable.
If you don't have time to implement a full local API at least spend a little bit of time making the cloud API useful.

@mvevitsis
Copy link

The alternative solution is to throw your switchbot devices in the trash and buy something that uses Zigbee or Zwave

@Damianeq90
Copy link

Sorry for my English.
I have a problem with curtains and hombridge, when I manually close the curtain, the status in HomeBridge does not update - it helps to enter the SwitchBot iPhone application, scroll down (refresh) and after two minutes Homebridge updates - has anyone dealt with this problem? I bought a hub on purpose, hoping that the update would be trouble-free

@devWaves
Copy link

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

@DutchmanNL
Copy link

DutchmanNL commented Sep 2, 2021

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.

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

@Zwordi
Copy link

Zwordi commented Nov 22, 2021

@Minsheng

Thanks for your message about your current load :).

Will wait the news then about a local api support through the hubmini who knows...

Regards,

@rafa-esco
Copy link

rafa-esco commented Dec 3, 2021

Just to let you know that in May 21 I got the following response from the switchbot twitter account:
"... our API limitation has been increased to 10000 per day..."

I'm indeed sending at least 5000 request every day from my domoticz installation to all my sensors and curtains.

@funkymonkeymonk
Copy link

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.

@nodecentral
Copy link

Just wanted to add my support to us all having a completely local (no cloud) API for Switchbot

@slimninja
Copy link

+1 for local api support. Would reduce demand on switchbot servers as well

@JGKarlin
Copy link

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

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?

@andhya
Copy link

andhya commented Oct 21, 2022

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

@asknoone
Copy link

@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.

@Minsheng
Copy link
Collaborator

@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.

@AdyRock
Copy link

AdyRock commented Nov 23, 2022

Local control would be great so automation can continue when the Internet connection is down.

@dcousens
Copy link

@Minsheng that's great to hear it's still on your radar, thanks for the update!
I know that at least I am holding out from buying SwitchBot products until I have local control 💛

@nodecentral
Copy link

@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..

@austwhite
Copy link

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.
The Home Automation industry has come full circle on this, with more platforms, such as Smartthings, going to more local control and Matter is also local control. To have that local control would be to be keeping up with the game now. Two years ago it would have been leading the field, but now it is essential for you to keep up with the other guys.

@jpconfessor
Copy link

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!

@MrXANA91
Copy link

MrXANA91 commented May 5, 2024

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".
I can't find that Matter option in the hub mini settings in the SwitchBot app, for the hub mini that I currently own.

@am2pgs
Copy link

am2pgs commented May 5, 2024

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.

@js4jiang5
Copy link

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.
BT proxy + HA only work for bluetooth devices, not the IR. For the infrared, it's still cloude based without Matter.

@alexbk66
Copy link

alexbk66 commented May 6, 2024

The hardware of the old and new ones are probably the same

I think Matter requires "Thread" chip?

@dcousens
Copy link

dcousens commented May 6, 2024

@am2pgs can you utilize the IR functionality of the Hub mini using matter?

@am2pgs
Copy link

am2pgs commented May 6, 2024

@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.

@js4jiang5
Copy link

The hardware of the old and new ones are probably the same

I think Matter requires "Thread" chip?

No. Matter support multiple PHY standards. Thread is just one of them. WiFi and Bluetooth are all supported by Matter.

@DutchmanNL
Copy link

DutchmanNL commented May 16, 2024

funny that after 4 year we still try to solve this and no reaction from the vendor at all....

honestly, I did throw all switchbot devices to the trash. Support and customer wishes sucks and I didn't even won't to try selling it to others

I was even more satisfied doing that than using it

@SiriosDev
Copy link
Contributor

There are news?
Screenshot_20240712-183541_Avvio app Pixel
Cause if there is this option and we can't use it ourselves directly the situation becomes really comical

@Ovis
Copy link

Ovis commented Jul 31, 2024

A product called Nature Remo, which functions similarly to Switchbot, is available in Japan.

This product is experiencing a failure as of this writing, apparently due to problems with AWS.
In the extremely hot Japanese summer, the inability to control the air conditioner is directly related to death.
However, this product supports local APIs, so those who are familiar with the product can use those APIs.

Since Switchbot also uses the cloud API, it is quite possible that it may become unusable due to a failure on the cloud side.
For such cases, the local API is considered indispensable.

@archer007
Copy link

I'm actually OK with not getting this as long as I can control everything via Matter and Home Assistant, that's basically all I need. If they just make everything accessible via Matter I'm all set

@SiriosDev
Copy link
Contributor

I'm actually OK with not getting this as long as I can control everything via Matter and Home Assistant, that's basically all I need. If they just make everything accessible via Matter I'm all set

True, Another very important thing is to correctly associate the devices with the corresponding Matter (Not currently manageable by the user), for example an IR air conditioner cannot be served as a thermostat when matter from 1.2 offers the room air conditioner type. Also for the sake of being able to use all the necessary (compatible) commands

@AJolly
Copy link

AJolly commented Sep 7, 2024

And still nothing :(

@git849376
Copy link

What is the current status?

@SiriosDev
Copy link
Contributor

What is the current status?

At present, locally we have only bluetooth api (limited support) and matter (some functions missing, in some devices)

@MrXANA91
Copy link

MrXANA91 commented Sep 12, 2024

What is the current status?

At present, locally we have only bluetooth api (limited support) and matter (some functions missing, in some devices)

Some devices (like the first version of the SwitchBot Hub Mini which I possess) are still cloud only.

@SiriosDev
Copy link
Contributor

What is the current status?

At present, locally we have only bluetooth api (limited support) and matter (some functions missing, in some devices)

Some devices (like the first version of the SwitchBot Hub Mini which I possess) are still cloud only.

Well yes, true, matter is only for who have a matter hub (like Hub 2), and Bluetooth API is for a very restricted range of device

@tjenkinson
Copy link

Worth bearing in mind too that having matter support doesn’t mean local control.

Support have confirmed unfortunately with the S1 even though it will support matter via the hub, it will still need an internet connection to work as their servers are still involved.

@tpftpf
Copy link

tpftpf commented Sep 13, 2024

Worth bearing in mind too that having matter support doesn’t mean local control.

Support have confirmed unfortunately with the S1 even though it will support matter via the hub, it will still need an internet connection to work as their servers are still involved.

It would be nice to get a roadmap for the implementation of the local API.

@SiriosDev
Copy link
Contributor

SiriosDev commented Sep 13, 2024

Worth bearing in mind too that having matter support doesn’t mean local control.

Support have confirmed unfortunately with the S1 even though it will support matter via the hub, it will still need an internet connection to work as their servers are still involved.

Omg 😱 it's true! do they have the courage to call this stuff matter compliant? I'm not saying it's a scam but it's very close to it.

@ric-101
Copy link

ric-101 commented Sep 26, 2024

We still REALLY need this... tbh I wouldn't have bought it if I knew it needs the cloud to work. Local control is fundamental for high security environments, and to ensure things still work when internet is down.

Please, please PLEASE release APIs for local control, or the tools we need to implement them ourselves. It doesn't even make sense that we need the cloud involved to unlock our doors, and it feels unsafe... why??

@alexbk66
Copy link

I suspect SwitchBot won't make any changes, for them you can use BLE for "Local" control, and "Matter" is the future, however it's moving too slow...

@ric-101
Copy link

ric-101 commented Sep 27, 2024

I suspect SwitchBot won't make any changes, for them you can use BLE for "Local" control, and "Matter" is the future, however it's moving too slow...

Yeah I'm afraid so too. I'd be fine using Matter, but seems it doesn't support all functions, and that also requires connecting to their cloud? (from some comments)

@ric-101
Copy link

ric-101 commented Oct 1, 2024

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

Hi Davidson (and to all the dev team). Since it has been very long and still no good solution in sight, could you maybe release a way for us to run a SwitchBot Cloud instance locally? (a docker file, a project we can run, a virtual machine, a raspberry ISO with the server already up and running... anything would do). In this way we could just change the server URL (from https://api.switch-bot.com to our local instance) and have our local environment very little effort from your side....

With a local environment we'd be able to use your system in many more cases, since we don't have hard performance limitations, more control, and most importantly many security conscious companies and privates would be able to use your products, while know they cannot since it's impossible to completely trust a could service which can control our doors and environment...

Pretty PLEEEEASE? ;)

@alexbk66
Copy link

alexbk66 commented Oct 1, 2024

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

Hi Davidson (and to all the dev team). Since it has been very long and still no good solution in sight, could you maybe release a way for us to run a SwitchBot Cloud instance locally? (a docker file, a project we can run, a virtual machine, a raspberry ISO with the server already up and running... anything would do). In this way we could just change the server URL (from https://api.switch-bot.com to our local instance) and have our local environment very little effort from your side....

With a local environment we'd be able to use your system in many more cases, since we don't have hard performance limitations, more control, and most importantly many security conscious companies and privates would be able to use your products, while know they cannot since it's impossible to completely trust a could service which can control our doors and environment...

Pretty PLEEEEASE? ;)

I suspect it's a bit too much to ask ;)

@ric-101
Copy link

ric-101 commented Oct 1, 2024

I suspect it's a bit too much to ask ;)

Maybe, but a man can dream lol. Also it seem like a really smart move to me which makes lots of business sense:

  • Currently they have costs to keep their cloud running, but cannot charge customers a periodic fee or it'd be a riot, and no one would buy anymore their products. If they offer a reasonable option to host your own cloud for free, you can then reasonably charge a small free for providing a more convenient service to those who'd rather have them handle that
  • They sell hardware, software is specific to their hardware, so no risk losing business by releasing the software
  • If they open source it (not even required, but nice to have) with the right EULA, they'll get improvements, fixes and cool features for free
  • They'd get access to a much larger base of potential customers, for example I like the hardware, but cannot install it professionally the way it is since I could not formally guarantee security.
  • they could get all of this with very little effort (assuming their software design is decent, if not, it's a good chance to clean up tech debt, before it collapses the system and the company)

Keeping my fingers crossed!

@alexbk66
Copy link

alexbk66 commented Oct 1, 2024

I suspect it's a bit too much to ask ;)

Maybe, but a man can dream lol. Also it seem like a really smart move to me which makes lots of business sense:

  • Currently they have costs to keep their cloud running, but cannot charge customers a periodic fee or it'd be a riot, and no one would buy anymore their products. If they offer a reasonable option to host your own cloud for free, you can then reasonably charge a small free for providing a more convenient service to those who'd rather have them handle that
  • They sell hardware, software is specific to their hardware, so no risk losing business by releasing the software
  • If they open source it (not even required, but nice to have) with the right EULA, they'll get improvements, fixes and cool features for free
  • They'd get access to a much larger base of potential customers, for example I like the hardware, but cannot install it professionally the way it is since I could not formally guarantee security.
  • they could get all of this with very little effort (assuming their software design is decent, if not, it's a good chance to clean up tech debt, before it collapses the system and the company)

Keeping my fingers crossed!

Understand. But most Chinese companies have different view. They want to force users use their servers to collect customer data and have access to your devices and network.

@ric-101
Copy link

ric-101 commented Oct 1, 2024

@alexbk66 that might be the problem here, which sadly is a good case for returning (/ditching) all products I got from them, and using some other system. Are you aware of any alternative product which offers a good API and can work without internet access?
In particular I'm interested in door locks, and controlling IR devices. Cheers :)

@alexbk66
Copy link

alexbk66 commented Oct 2, 2024

@alexbk66 that might be the problem here, which sadly is a good case for returning (/ditching) all products I got from them, and using some other system. Are you aware of any alternative product which offers a good API and can work without internet access? In particular I'm interested in door locks, and controlling IR devices. Cheers :)

For IR devices I think Bond Bridge is the best, it's very professional device, unlike Chinese ones. https://forums.homeseer.com/forum/hs4-products/hs4-plugins/wireless-receiver-transceiver-plug-ins-aa/ak-bond-alexbk66-aa/1448276-plugin-for-bond-bridge-and-smart-by-bond-devices-introduction-configuration

Not sure about locks, definitely it should use local API, you can't rely on cloud server to open your door.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pinned pin important issues
Projects
None yet
Development

No branches or pull requests