Would it be possible to get the ambient light level or illumination level from the Hub2?
Has anyone got the the Switchbot Curtain 3 working with the app?
I have the main switchbot device, as well as the Switchbot Events app configured so that they do not log debug statements.
I am seeing debug statements in the logs every 5 minutes from my contact sensor.
Any idea what might be going on?
In the "SwitchBot Contact Sensor" driver, comment out line# 56:
(this was probably just an oversight left over from early development)
Thanks @tomw so much for making this driver! I've followed your readme instructions, and I'm partially successful in getting it to work.
My SwitchBot setup:
- 1 x SwitchBot Hub 2 (device named "Hub 2 D1")
- 1 x SwitchBot Curtain Original (device named "MB_Curtain_1" in SwitchBot app)
- 2 x SwitchBot Curtain 3 (device named "MB_Curtain_2" and "MB_Curtain_3" in SwitchBot app)
I've got the Hub 2 Meter and the original version SB Curtain to show up as child devices under the SwitchBot parent device, and both work as expected. However, I'm unsuccessful in getting the SwitchBot Curtain 3s to show up as child devices. Tried deleting and recreating the child devices with no success.
Here's the log output from when I hit the "Create Child Devices" button within the SwitchBot System device (not that it matters, but log is read from bottom to top):
device = [deviceType:Curtain, hubDeviceId:D8291366CCD1, calibrate:true, openDirection:right, curtainDevicesIds:[C9306231EFCE], deviceId:C9306231EFCE, deviceName:MB_Curtain_1, enableCloudService:true, group:false, master:true]
device = [hubDeviceId:D8291366CCD1, calibrate:true, openDirection:left, deviceId:CDC868A8A8EC, deviceName:MB_Curtain_2, enableCloudService:true, master:true]
device = [deviceType:Meter, hubDeviceId:, deviceId:D8291366CCD1, deviceName:Hub 2 D1, enableCloudService:true]
device = [hubDeviceId:D8291366CCD1, calibrate:true, openDirection:left, deviceId:DB9727492424, deviceName:MB_Curtain_3, enableCloudService:true, master:true]
From the logs, it looks like for the child devices that were created successfully (i.e. Hub 2 D1 and MB_Curtain_1), those devices were given a "deviceType", whereas the unsuccessfully-added child devices missed those activities.
Is it that the SwitchBot Curtain 3 is too new and not currently supported by the driver?
Any help would be greatly appreciated. Thanks!
Hi everyone. Just wanted the community to know that after a little troubleshooting with @tomw, the SwitchBot Curtain 3 - being a brand new model - is either not yet supported by SwitchBot's API, or there's a bug in the API that hasn't assigned a device type for this device.
Simply put, when the API is called, the API fails to assign a device type for Curtain 3 devices.
It's been reported here: No deviceType field for Curtain 3 · Issue #241 · OpenWonderLabs/SwitchBotAPI · GitHub
Thanks @tomw for helping with the troubleshooting! Guess for now, we'll just have to hang tight and hope SwitchBot comes with a fix soon.
I have found a workaround for the Curtain 3 not being in the API yet. I created basic scenes in the Switchbot app, and called them from Rule Machine.
You get the SceneID from the State Variables of your hub device.
Then you can execute a custom action, I used Actuator, executeScene command, and the Scene ID from before.
This has given me basic control for now, and does most of what I need.
Hope that helps someone out.
Awesome workaround. It worked for me as well. Good thinking!
@tomw do your drivers support the new curtain bot 3?
I am not smart enough to write the code myself, so if not is there anything I can do to help you make that happen?
See my Sept. 24 post above.
@tomw 's drivers work as intended. The problem is Switchbot's API hasn't been updated to support Curtain 3 (yet). It's anyone's guess when they'll add that device to their API.
In the meantime, the only way to make Curtain 3 work is by employing @fredpd 's workaround whereby you setup a basic scene in the Switchbot app that includes the Curtain 3, then call that scene in Hubitat using @tomw 's driver.
Hello, I have switchbot blinds setup on either end of the house. If I put the hub on one end of the house, the blinds on the other end of the house do not respond and vice versa. If I put the hub in the middle of the house I get varying degrees of success. So, the logical step is to get another hub. I now have two and everything works great through the switchhub app. However, hubitat control only seems to work through the first hub, where ever I put it.
This doesn't really make sense to me if all we are doing is making an api call to open or close the blinds. It would seem to me that actually controlling of the blinds from that point is up to switchbot and not controlled in the driver. But perhaps I am wrong.
Or maybe I am missing something else?
You're right- the cloud API I use doesn't address anything about the paired SwitchBot hub directly, so it should work normally with multiple hubs (as long as it works in the SwitchBot app, like you said).
What exactly happens when you try to operate the devices? If you enable logging, does anything show up?
This is a great work around! Thank you. That being said I am struggling to figure out how to call a scene. I can see how to execute a scene in the device page, but in the rules section I am not seeing a way to send that as an action
Through the switchbot app, everything works as expected. I can control any of my blinds devices including the one nearest the second hub.
Through hubitat, I can only control the devices near the first hub.
The log seems to indicate that the command was successful.
dev:11222023-10-29 10:04:44.184 AMdebugresp.data = [body:[items:[[code:100, deviceID:FE7879656130, message:success, status:[battery:100, connectAllow:true, deviceChain:1, direction:horizontal, isCalibrate:true, isStuck:false, position:50, power:on, runStatus:static]]]], message:success, statusCode:100]
However, in the switchbot logs, it says it failed to connect to the device.
Both hubs show up in the devices variable for the switchbot system. However, the second hub does not show it being enabled for cloud services.
{deviceType=Meter, hubDeviceId=, deviceId=D3F077C40582, deviceName=SB Hub MB, enableCloudService=true}
{deviceType=Hub Mini, hubDeviceId=, deviceId=EBBD8FAECA45, deviceName=SB Hub Play Room, enableCloudService=false}
This is probably the problem, however, I can find no means of enabling it for cloud service. I am still troubleshooting it but I am pretty sure the it is on my side or switchbot's side.
This issue here ended up being that the blinds device that I could not control with the new hub was actually not associated with the new hub but rather the old one.
If adding a new hub, remember to undo the cloud services for any devices you want the new hub to use and add cloud services again so that you can choose your new hub.
This is how I did it, in the Rule Machine actions, I chose 'run a custom action', then see below. Good luck!
Perfect, finally figured it out and it is working! Thank you!
@tomw , I'm seeing this error
java.lang.NullPointerException: Cannot invoke method parse() on null object on line 190 (method observeEvent)
Shows up along side each processed event or incoming event:
Not sure what other information you might need but just in case:
- Using Hub 2,
- I do have curtain 3s, which I know are currently not working with the API.
- Everything seems to be working as expected, despite this error.
Let me know if I can provide any other info.
It looks like something is odd with your SwitchBot Events app setup.
Can you go back through the app configuration and make sure you have a SwitchBot System device selected? Be sure to click Done to allow the app to finish its configuration.
Nailed it. Thank you. I had recently removed the devices and re-added them (due to upgrading from Hub to Hub 2) and so the switchbot events app had no system selected.