SwitchBot gets an open API!

I have been pushing the On and Off buttons.
What is status code:160, No this command?:thinking:

Partial success, I can turn my TV on and off using HE, my receiver doesn't respond to HE on/off commands, yet both work flawlessly using the Switchbot app. The receiver remote has separate buttons for on and off while the TV button is an on/off toggle.

Looking at the Switchbot app logs for the receiver, it shows
Turned On API
Failed to execute, try again.

For the TV, it shows
Power API
Ran successfully

I think I know the problem, the receiver is device type "other" and that isn't supported by third party apps or the API.

Sorry to trouble you with this TomW, I learned something today!

1 Like

@tomw
Curious on these log entries. I have been getting them the last few days on my tilts.
Is this a Switchbot end problem?

dev:21182024-01-24 00:30:27.416errorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 523 (method readDeviceStatus)

dev:21182024-01-23 17:30:08.150errorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 523 (method readDeviceStatus)

dev:21182024-01-21 10:33:12.207errorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 523 (method readDeviceStatus)

I've got the child device for curtains installed but it's not creating a child device for my curtain device.

Currently using the latest hub2 and curtain3

Relevant part of Json response:
deviceList=[{deviceType=Curtain3, hubDeviceId=, calibrate=true, openDirection=left, deviceId=DD3217E36DD8, deviceName=Curtain, enableCloudService=false, master=true}

Logs don't show anything relevant. Meter child device (from the hub itself) gets created though.

Any ideas?

According to that GitHub issue report, it is now fixed:

All 3 of my curtains show up in the state variable json, but only the curtain2 "deck curtain" shows up as a child device.

I do have my two Curtain 3s "grouped" and both Mac address are listed (as curtainDeviceIds]".

{deviceType=Curtain, hubDeviceId=C0169E74A662, calibrate=true, openDirection=left, curtainDevicesIds=[C28FD8521BCC], deviceId=C28FD8521BCC, deviceName=Deck curtain, enableCloudService=true, group=false, master=true}, {hubDeviceId=000000000000, calibrate=true, openDirection=right, curtainDevicesIds=[EC5D6ACF8D28, D82A50085937], deviceId=D82A50085937, deviceName=Left curtain, group=true, master=false},

Not sure why they (or it as a group?) is not showing up as a child device.

@tomw same issue here

I added a change to my SwitchBot System driver to incorporate their fix. Curtain3 devices should work properly now.

I didn't bump the version for this bugfix, so just use the HPM "Repair" feature to pick up the change.

2 Likes

Fixed! Thanks!

I may have spoken too soon. Control are not going through.

Worked for me!

After doing the app repair and hitting the reinitialize button and create children button in the parent device, my two Curtain 3's showed up as children devices.

For some reason, it took a few tries hitting a combo of open/close/refresh buttons in the Curtain 3 device controls in Hubitat, followed by commanding them by the native Switchbot app, then again through Hubitat a couple times before it finally worked. I don't know if it's the combo of commands between Hubitat and Switchbot app that made it eventually work in Hubitat, or if it was just that some time had to pass before it worked.

Thanks @tomw!

I enabled cloud services in switchbot and it’s working now.

1 Like

@tomw
I get a lot of errors and I assume they are from the sometimes spotty responses I get from the BLE connection (logs) to the Tilt blinds. I moved the hub closer and it seemed to fix it for a bit but now they're back. Can you catch these errors and move to a debug level reporting status so they don't clog up the logs?
Obviously an if you can, when you can, or never. :slight_smile:

dev:21182024-02-12 02:16:27.658errorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:21182024-02-11 14:00:02.047errorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 544 (method writeDeviceCommand)

[dev:2118]2024-01-24 00:30:27.416[errorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 523 (method readDeviceStatus)

@tomw I get a ton of these error 500s too. Don't know if it's BLE or not.
Examples so far today.
dev:25502024-04-30 06:43:01.984 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-04-30 06:38:01.399 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-04-30 06:28:00.100 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-04-30 06:02:57.142 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-04-30 05:47:55.173 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-04-30 05:02:48.895 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-04-30 04:57:48.251 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-04-30 04:52:47.759 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-04-30 04:27:44.416 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-04-30 02:57:24.533 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-04-30 02:22:19.865 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

Thanks. Things generally work well, but these errors persist.

As you see I had these too. Moving the hub closer took away some of the logs errors which I attibute to BLE distance/interfence.
Those 500's I think were just comms issues with Chairman Mao.
They haven't been back since my post. New firmaware pushed last week for the blinds BTW.

Interesting. I’ll try moving it closer. No update showing for my curtain 3 unit yet.

I found being in my office 10 meters away and close to the HE hub plus 2 Blink hubs caused the Switchbot hub logs to have errors.
Moving to within 3 meters helped with that but didn't help with the command delivery/execution.
I still have to send each command twice with a delay to have 99% proper action.

Hmm. No improvement of error 500s since moving the SwitchBot Hub about 5 feet from the curtainbot 3.
dev:25502024-05-01 08:07:34.092 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-05-01 08:07:33.892 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 08:02:33.554 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-05-01 07:22:27.362 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 07:12:26.538 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-05-01 07:12:26.337 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 07:07:25.667 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 07:07:25.666 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 07:02:25.184 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 06:47:23.482 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-05-01 06:37:21.730 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 06:32:21.159 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 06:32:21.157 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 06:22:20.096 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-05-01 06:22:19.894 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 05:37:13.538 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 05:27:12.225 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 05:07:09.763 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-05-01 05:07:09.564 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 05:02:47.552 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-05-01 05:02:09.286 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-05-01 05:02:08.884 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 04:47:06.846 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 04:42:06.634 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 04:37:05.838 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 04:22:04.226 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-05-01 04:22:03.824 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 04:12:02.754 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 04:12:02.752 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 04:07:02.542 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-05-01 04:07:02.341 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 04:02:01.772 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 04:02:01.573 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 03:57:01.445 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-05-01 03:57:00.986 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 03:52:00.656 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 03:36:58.544 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 03:26:57.472 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-05-01 03:21:56.631 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 03:16:55.871 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 03:16:55.869 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 02:51:52.735 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-05-01 02:31:49.909 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 02:26:49.212 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 02:16:48.013 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 01:46:43.720 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 01:31:41.927 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-05-01 01:31:41.727 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 01:26:41.132 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 01:21:40.547 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 01:16:39.815 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 12:51:35.747 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 12:36:34.079 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-05-01 12:36:33.878 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

dev:25502024-05-01 12:26:32.901 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-05-01 12:21:32.001 AMerrorgroovyx.net.http.HttpResponseException: status code: 500, reason phrase: Internal Server Error on line 516 (method readDeviceStatus)

dev:25502024-05-01 12:06:29.568 AMdebugrefresh() failed: status code: 500, reason phrase: Internal Server Error

I started with Tom's integration specifically for the Switchbot Curtains. It did work very well but unfortunately it is a cloud-based integration. I don't like cloud-based based integrations. I added Home Assistant to my setup and was surprised I can use Switchbot Curtains (plus many other devices) 100% locally. And as of today with matter-enabeled Switchbot Hub 2 it is possible to get rid of Switchbot cloud-based integration. Why not?

Use the Matter Advanced Bridge for local control from Hubitat, several users already confirmed that the control of SwitchBot curtains is working OK.

Yes, I saw a messages regarding Switchbot Matter support and will keep it in mind. But as of now I already have 100% local control with Home Assistant. Currently I don't see a necessity to add a new device (Switchbot Hub 2) to my setup. But who knows...

1 Like